on 06-18-2015 5:55 AM
Hi Team,
I would like to use Begin of Loop (BOL) for one of my usecase and I have written the below logic (LTRS) to extract the data from source to HANA via SLT. However, the same is working if I use Begin of Record (BOR). Can you please help/guide me understand where I'm wrong with BOL event?
Thanks for your help on this!
SELECT * FROM dmc_acspl_select INTO TABLE lt_acspl_select WHERE migr_obj_alias = 'VBRK'.
READ TABLE lt_acspl_select INTO ls_acspl_erdat WITH KEY field = 'ERDAT' BINARY SEARCH.
*Begin of Record (BOR)
IF <wa_s_vbrk>-erdat GE ls_acspl_erdat-value.
ELSE.
skip_record.
ENDIF.
I follow the same syntax mentioned in the Replication Guide.
BOL – Begin of loop
LOOP AT source table
MOVE-CORRESPONDING source work area TO target work area
BOR – Begin of record
Individual field mapping (parameter rules)
EOR – End of record
Insert target work area into target table
ENDLOOP
EOL—End of loop
*Begin of Loop (BOL)
LOOP AT vbrk.
MOVE-CORRESPONDING <wa_s_vbrk> into <wa_r_vbrk>.
IF <wa_s_vbrk>-erdat GE ls_acspl_erdat-value.
<wa_r_vbrk>-MANDT = <wa_s_vbrk>-mandt.
<wa_r_vbrk>-VBELN = <wa_s_vbrk>-vbeln.
<wa_r_vbrk>-FKART = <wa_s_vbrk>-fkart.
<wa_r_vbrk>-FKTYP = <wa_s_vbrk>-fktyp.
<wa_r_vbrk>-VKORG = <wa_s_vbrk>-vkorg.
<wa_r_vbrk>-VTWEG = <wa_s_vbrk>-vtweg.
<wa_r_vbrk>-BELNR = <wa_s_vbrk>-belnr.
<wa_r_vbrk>-GJAHR = <wa_s_vbrk>-gjahr.
<wa_r_vbrk>-POPER = <wa_s_vbrk>-poper.
<wa_r_vbrk>-ERDAT = <wa_s_vbrk>-erdat.
<wa_r_vbrk>-KUNAG = <wa_s_vbrk>-kunag.
INSERT <wa_r_vbrk> INTO vbrk.
ELSE.
skip_record.
ENDIF.
ENDLOOP.
Regards,
Sathish
Hi Satish,
The syntax you mention is only to indicate when the different events are raised (BOL, BOR etc.) in the SAP algorithm.
You have no access to the data at the BOL level. Data is only available for the events BOR and EOR.
So you can do your SELECT on "dmc_acspl_select" at the BOLevent but you will have to skip your records at the BOR event.
Regards,
FCI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.