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.

This was last published in December 2004

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close