DATA. lp_data TYPE REF TO DATA. FIELD-SYMBOLS:
TYPE ANY, TYPE ANY. CREATE DATA lp_data LIKE LINE OF . ASSIGN lp_data->* to . ASSIGN COMPONENT 'FIELD1' OF STRUCTURE TO . LOOP AT INTO . CHECK EQ 'X'. DELETE TABLE FROM . ENDLOOP.
Another possibility is to use, for example, with a table that has key fields kf1 and kf2:
With fully specified keys this is very efficient for HASHED tables, somewhat efficient for SORTED tables, and not very efficient, usually, for STANDARD tables.
As ever, what you actually write depends on precisely what you are trying to achieve.
Dig Deeper on SAP data management
Related Q&A from Matthew Billingham
A SearchSAP.com reader who is writing a program to update SAP tables wants to know how to make updates visible in a change log by using an SAP change... Continue Reading
Find out how to correct an SAP ABAP dump with an oversize condition to avoid an SAP ABAP dump giving an DBIF_RSQL_ INVALID_RSQL error at the SQL ... Continue Reading
Learn how to create a function group and authorization group using an SAP ABAP table maintenance generator on a Z table. Continue Reading