Q

Can another LOOP..ENDLOOP be written?

Inside a LOOP..ENDLOOP of an internal table that has control level codes such as AT NEW.., AT END OF.., can I write another LOOP..ENDLOOP within any of the control levels AT..ENDAT? Is this kind of coding valid or will there be any unpredictable results?

Inside a LOOP..ENDLOOP of an internal table that has control level codes such as AT NEW.., AT END OF.., can I write another LOOP..ENDLOOP within any of the control levels AT..ENDAT? Is this kind of coding valid or will there be any unpredictable results?
Yes, you can. Obviously within the AT you only have access to the data up to the control level. For example, if you have a table {WERKS, MATNR,MENGE} in the AT NEW MATNR, MENGE is undefined. But there is nothing to stop you doing a READ of your table to get the value of MENGE, nor a LOOP of your table.

AT control levels still remain unpredictable if you use the WHERE clause, however. In this instance, you have to code the control levels yourself.

Dig Deeper on SAP ABAP

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchContentManagement

SearchHRSoftware

Close