2023 Jul 04 7:03 AM
Hi All,
Can anyone tell about the Loop & endloop , parllel cursor why it is used exact meaningful use for loop & endloop ?
what is parellel cursor why it is used exact meaning for the parlell cusrsor ?
2023 Jul 04 7:07 AM
Do you know there are some documentation about all that
What it is not clear in these docs, blogs ... ?
2023 Jul 04 7:10 AM
Hi yasu_1096,
There are lot of threads available on SCN on this.
https://answers.sap.com/questions/4324015/what-is-meant-by-parallel-cursor.html
https://answers.sap.com/questions/10664194/correct-usage-of-parallel-cursors.html
https://answers.sap.com/questions/3814347/parallel-cursor.html
https://answers.sap.com/questions/5869000/parallel-cursor-method.html
2023 Jul 04 9:19 AM
The parallel cursor technique is obsolete and has been for nearly 25 years. The advent of HASHED and SORTED internal tables removed the need for this technique.
2023 Jul 06 9:57 AM
TO follow the concept you need minimum 2 tables which are have common keys for example if I take PO related data of EKKO, EKPO and EKET. I will need to do as follows:
sort: iekko by ebeln, iekpo by ebeln ebelp, ieket by ebeln ebelp ETENR.
loop at iekko.
read table iekpo with key ebeln = iekpo-ebeln.
check sy-subrc is intital.
loop at iekpo from sy-tabix.
if iekpo-ebeln ne iekko-ebeln.
exit.
endif.
... process logic.
read table ieket with key ebeln = iekpo-ebeln ebelp = iekpo-ebelp.
check sy-subrc is initial.
loop at ieket from sy-tabix
if ieket-ebeln ne iekpo-ebeln or ieket-ebelp ne iekpo-ebelp.
exit.
endif.
... process logic.
endloop
endloop.