Tuesday, July 19, 2016

Routines

BW Routines

DTP Routine
When a routine is created in BW, the below code is generated.
datal_idx like sy-tabix.
          read table l_t_range with key
               fieldname ''.              " Insert the name of the filter field
          l_idx sy-tabix.
          if l_idx <> 0.                    " Ignore the if condition,and populate the range table manually.
            modify l_t_range index l_idx.
          else.
            append l_t_range.
          endif.
          p_subrc 0.


Range table
     l_t_range-fieldname 'CRM_OBJ_ID'.
     l_t_range-option 'EQ'.
     l_t_range-sign 'I'.

LOOP AT lt_objid INTO lw_objid.
     l_t_range-low = lw_objid-object_id.
     l_t_range-low '12345'.
     APPEND l_t_range.
     CLEARlw_objid.
ENDLOOP.

Whatever values are appended, will be present in the DTP filter at time of execution.


InfoPackage Routine Code
Below is the code which gets generated, once Infopackage routine is created. We need to fill the range table with the values we want as filters.
\


In the above code, after the read statement , fill in the code for filling the range, depending on the type of range.
     l_t_range-    fieldname 'ZZTIME'.
     l_t_range-option 'EQ'.
     l_t_range-sign 'I'.
     l_t_range-low = '12345'
     
After this, the MODIFY statement in the code will take care of the modification.


No comments:

Post a Comment