10-06-2008 10:19 AM
Hi Guyz,
How can i delete entries in the internal table based on the selection screen , ie, i have range of clientnumber on the selection screen..i should delete all my entries in the internal table which are not equal to the client numbers based on the selection screen.. plz advise
declaration:
select-options:
s_client type ztable-client
regds
10-06-2008 10:22 AM
Check this example..
tables: vbak.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
END OF itab.
SELECT-OPTIONS s_vbeln for vbak-vbeln.
DELETE itab WHERE NOT vbeln IN s_vbeln.
Regards,
Omkaram.
10-06-2008 10:21 AM
Hi,
loop at ztable where client in s_client .
delete ztable.
endloop.
or
delete ztable where client in s_client.
regards
Nicole
10-06-2008 10:24 AM
thanks for your replies..
but i need to delete the entries which are not specified on the selection screen..not the entries equal to the clientnumbers on the selection screen.
10-06-2008 10:22 AM
loop at s_client.
delete from internal where client = s_client-low.
endloop.
Regards
MD
10-06-2008 10:22 AM
Check this example..
tables: vbak.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
END OF itab.
SELECT-OPTIONS s_vbeln for vbak-vbeln.
DELETE itab WHERE NOT vbeln IN s_vbeln.
Regards,
Omkaram.
10-06-2008 10:25 AM
Hi ,
There are several ways you can delete the records,
One way is :
Loop at <final_table>
if <final_table> value = selection screen value Then
delete index sy-tabix.
endif.
Endloop.
Thanks,
Chidanand
10-06-2008 10:25 AM
Hi Brightside,
follow the logic below,
data: st_client like s_client.
loop at <your_internal_table>.
read s_client into st_client where client eq <your_internal_table>-client.
if sy-subrc ne 0.
delete <your_internal_table>.
endif.
endloop.
Regards,
Kiran
10-06-2008 10:30 AM