Parallel cursor Methods
1 Parallel Cursor is a
technique to increase the performance of the program when there are nested loops
DATA: gt_vbak TYPE STANDARD TABLE OF vbak,
gt_vbap TYPE STANDARD TABLE OF vbap,
lv_tabix TYPE sy-tabix.
FIELD-SYMBOLS: <fs_vbak> TYPE vbak,
<fs_vbap> TYPE vbap.
SELECT * FROM vbak INTO TABLE gt_vbak UP TO 1000 ROWS.
SELECT * FROM vbap INTO TABLE gt_vbap UP TO 10000 ROWS.
SORT gt_vbak BY vbeln.
SORT gt_vbap BY vbeln posnr.
LOOP AT gt_vbak ASSIGNING <fs_vbak>.
IF sy-subrc EQ 0.
READ TABLE gt_vbap TRANSPORTING NO FIELDS WITH KEY vbeln = <fs_vbak>-vbeln.
IF sy-subrc EQ 0.
lv_tabix = sy-tabix.
LOOP AT gt_vbap FROM lv_tabix ASSIGNING <fs_vbap>.
IF sy-subrc EQ 0.
IF <fs_vbak>-vbeln NE <fs_vbap>-vbeln.
EXIT.
ENDIF.
********************* process your logic here *****************************************.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
Comments
Post a Comment