Start Routine To Populate All Columns at Once
Start Routine To Populate All Columns at Once
Scenario: Looking up for the sales document information from a DSO 0CDS_DS02 and
populating the fields in a transformation.
The lookup is done globally instart routine so that all the other fields in the
transformation can be assigned from the global data type gs_sa_item in the individual rules as
RESULT= gs_sa_item-field name
This is the code to be placed in start routine
*$*$ begin of global - insert your declaration only below this line *-*
DATA: gs_sa_item TYPE /bi0/acds_ds0200.
DATA: gt_orders TYPE STANDARD TABLE OF /bi0/acds_ds0200.
DATA: gs_orders TYPE /bi0/acds_ds0200.
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE _ty_s_SC_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
DATA: ls_buffer TYPE _TY_S_SC_1.
DATA: lt_buffer TYPE STANDARD TABLE OF _TY_S_SC_1.
DATA: lv_idx TYPE sy-tabix.
DATA: ls_orders TYPE /bi0/acds_ds0200.
LT_BUFFER[] = SOURCE_PACKAGE[].
ENDIF.
ENDIF.
ENDLOOP.
SOURCE_PACKAGE[] = LT_BUFFER[].
IF SOURCE_PACKAGE[] IS NOT INITIAL.
SELECT * FROM /bi0/acds_ds0200
INTO TABLE gt_orders
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE doc_number = SOURCE_PACKAGE-vbeln
AND s_ord_item = SOURCE_PACKAGE-posnr.
ENDIF.
Place the code below in one of the field mapping routine which ever comes first.
IF sy-subrc = 0.
gs_sa_item = ls_orders.
ENDIF.
RESULT = gs_sa_item-lowr_bnd
RESULT = gs_sa_item-sold_to
*------------------------------------------------------------------------------------------------------- *