cancel
Showing results for 
Search instead for 
Did you mean: 

BOL Event based Rule

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

FCI
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Frederic,

Awesome, Thank you. I exactly want to do the same, I don't want to call DMC_ACSPL_SELECT for each record during replication. My intention was to call just once. I just changed my code and tested out, its working great.

Thanks

Sathish

Answers (0)