2015 Mar 26 7:24 AM
Hi Expert,
May i use chain statement under loop?
Eg:
Loop itab into at w_itab,
Move: w_itab to w_itab2,
w_itab to w_itab2.
append w_itab2 to itab2.
Thanks
Neha 🙂
2015 Mar 26 7:30 AM
Yes, the statement block between LOOP and ENDLOOP can contain the keywords FIELD, MODULE, CHAIN and ENDCHAIN of the flow logic.
2015 Mar 26 7:45 AM
Hi Nehan,
Yes you can use the chain statements inside Loop statements. It wont affect the performance and all.
The statements which have same starting points are expressed as Chain statements which can be used at any where inside the program.
Also find the link below.
Regards
Rajkumar Narasimman
2015 Mar 26 7:50 AM
Hi,
I am not sure if you are asking about "chain" statement.
because your example looks like you are asking about "chained" statement.
If i understand you correctly, then yes, we can use chained statements inside a loop.
EG:
LOOP AT IT_STUD INTO WA_STUD.
MOVE: WA_STUD TO WA_STUD1,
WA_STUD TO WA_STUD2.
APPEND: WA_STUD1 to IT_STUD1,
WA_STUD2 TO IT_STUD2.
ENDLOOP.
To know more about chained statements, refer: ABAP Keyword Documentation
Thanks,
Velraj