Skip to Content
Author's profile photo Former Member

Activation of Transformation in Production Environment

Summary

Transformations are important objects that play a major role in ETL process. If transformations turn inactive it can hamper the ETL processes. But there are many scenarios wherein the transformations turn inactive in the production box which results in delay in data load thus causing SLA misses. The only effective way to get the transformation activated again is transportation of the same from the development environment. The transformation comes with O-ABAP concepts and makes use of classes for its programming. A customized program can be written with help of these classes to activate the transformations. Following is the class which is useful for the same:        

  • cl_rstran_trfn_collection

 

Step by Step Solution

Checking Transformation

It is recommended not to directly activate the transformation. First do a complete check to see if the transformation is correct and as required. If any inconsistencies are found then it is advisable to do a re-transport of the transformation. Otherwise the transformation can be activated directly.

Activating Transformation

Create a customized program in the development box (Code is provided at the end of blog). After intensive testing of the program transport it to the upper environments. Now this program can be used to activate the transformations erasing the need to do transports. The only input needed by the program is the technical name of the transformations.

Re-Checking Transformation

After successful run of program it is recommended to check the transformations if its definition is intact.

 

Sample Code

 

TABLES :RSTRAN.

SELECT-OPTIONS : TRAN for  RSTRAN-TRANID OBLIGATORY NO INTERVALS MATCHCODE OBJECT RSTRANID.

DATA : l_objnm type sobj_name.
DATA : itab type TABLE OF RSTRAN WITH HEADER LINE.
DATA:  l_th_tlogo_error TYPE rso_th_tlogo,       
           l_t_tranid       TYPE TABLE OF rstranid.

TYPES: rs_char1(1) TYPE c.
TYPES: rs_objvers  TYPE rs_char1.

CONSTANTS: rs_c_false TYPE rs_bool VALUE ‘ ‘,           
                   rs_c_true  TYPE rs_bool VALUE ‘X’.

CONSTANTS: BEGIN OF rs_c_objvers,             
                    modified   TYPE rs_objvers VALUE ‘M’,           
                  END OF rs_c_objvers.

DATA : l_r_collection    TYPE REF TO cl_rstran_trfn_collection,      
          l_not_modifyable  TYPE rs_bool.

CREATE OBJECT l_r_collection.

***************************************************************     

Looping on all the entered Inactive Transformation
***************************************************************

LOOP at TRAN.

  SELECT * FROM RSTRAN INTO TABLE ITAB WHERE TRANID = TRAN-LOW.        
    IF  sy-subrc NE 0.           
      MESSAGE ‘Transformation does not exist’ TYPE ‘I’.

    ELSE.              
      l_objnm = TRAN-low.                

      CALL METHOD l_r_collection->add_tlogo                    
       EXPORTING                      
        i_objnm             = l_objnm                      
        i_modify             = rs_c_true                      
        i_with_cto            = rs_c_false                      
        i_objvers             = rs_c_objvers-modified                      
        i_detlevel            = ‘1’                    
       IMPORTING                      
        e_not_modifyable = l_not_modifyable.                

      CALL METHOD l_r_collection->activate                   
       EXPORTING                     
        i_with_cto                   = rs_c_false                     
        i_force_activation        = rs_c_true                     
        i_show_check_protocol = rs_c_false                     
        i_with_check               = rs_c_true                     
        i_after_import_mode   = rs_c_true                     
        i_detlevel                   = ‘1’                   
       IMPORTING                      
        e_th_tlogo_error          = l_th_tlogo_error.                 

       IF sy-subrc = 0.                   
         MESSAGE ‘Transformation Activated Successfully’ TYPE ‘I’.                 
       ELSE.                    
         MESSAGE ‘Transformation Not Activated’ TYPE ‘I’.                
       ENDIF. 
    ENDIF.
ENDLOOP.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      A very useful program indeed. Thanks.
      Author's profile photo Former Member
      Former Member
      Thank you for this useful tool. Do you know how to extend it to reactivate DTP as well ?

      Philippe