‎2007 Aug 31 2:13 AM
Is it possible to loop through a table, examine each record and
delete the record if it meets a certain condition, all within the loop?
Like:
field-symbols <fs> like line of mytable.
loop at mytable assigning <fs>.
if <fs>-field_1 = someValue.
delete ......
endif.
endloop
‎2007 Aug 31 2:26 AM
Hi,
For performance reasons do delete outside of the loop.
field-symbols <fs> like line of mytable.
loop at mytable assigning <fs>.
if <fs>-field_1 = someValue.
append mytable_1
endif.
endloop
delete ......... from mytable_1
aRs
‎2007 Aug 31 2:21 AM
You can not delete directly from standard SAP tables, there are some predefined tcodes or bapis or procedures to it.
If you are talking abt custom tables ie Z tables, you can do it by using the Delete statement.
Regards
Gopi
‎2007 Aug 31 2:26 AM
Hi,
For performance reasons do delete outside of the loop.
field-symbols <fs> like line of mytable.
loop at mytable assigning <fs>.
if <fs>-field_1 = someValue.
append mytable_1
endif.
endloop
delete ......... from mytable_1
aRs