Tuesday 6 September 2011

Parallel cursor method in sap abap

sort: lt_vbpa by kunnr,  "Sorting by key is very important
      lt_kna1 by kunnr.  "Same key which is used for where condition is used here
loop at lt_vbpa into wa_vbpa.
  read lt_kna1 into wa_kna1     " This sets the sy-tabix
       with key kunnr = wa_vbpa-kunnr
       binary search.
  if sy-subrc = 0.              "Does not enter the inner loop
    v_kna1_index = sy-tabix.
    loop at lt_kna1 into wa_kna1 from v_kna1_index. "Avoiding Where clause
      if wa_kna1-kunnr <> wa_vbpa-kunnr.  "This checks whether to exit out of loop
        exit.
      endif.

****** Your Actual logic within inner loop ******

   endloop. "KNA1 Loop
  endif.
endloop.  " VBPA Loop

No comments:

Post a Comment