Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DELETE ONE ENTRY

Former Member
0 Likes
849

hi.

i want to delete the entry from the it_final if it the field value doesnot fall in the range of select options s_req.

please help.

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
829

Try this way


loop at itab where not req in s_req.
  delete itab index sy-tabix.
endloop.

a®

Read only

former_member156446
Active Contributor
0 Likes
829

try

delete it_final where value not in so_werks.

Read only

former_member203501
Active Contributor
0 Likes
829

hi do like this ...

loop at it_final .

delete it_final where field1 ne r_range .

endloop.

Read only

0 Likes
829

it is giving the error if i am doing like this

delete it_final where l_valpr_usd not in s_reqval.

please assist.

Read only

0 Likes
829

see this......

report ztest.

data: begin of itab occurs 0,

name type char10,

end of itab .

ranges: r_name for mara-matnr .

r_name-low = 'test01'.

r_name-sign = 'I'.

r_name-option = 'EQ'.

append r_name .

r_name-low = 'test02'.

r_name-sign = 'I'.

r_name-option = 'EQ'.

append r_name .

itab-name = 'test01'.

append itab .

itab-name = 'test02'.

append itab .

itab-name = 'test03'.

append itab .

itab-name = 'test04'.

append itab .

itab-name = 'test05'.

append itab .

delete itab where name in r_name .

loop at itab .

write:/ itab-name .

endloop.

Read only

0 Likes
829

Sample code which is working


tables:mara.
select-options: s_matnr for mara-matnr.

types: begin of t_mara,
       matnr type matnr,
       end of t_mara.

data: it_mara type standard table of t_mara.


select matnr into table it_mara
from mara where matnr in s_matnr.

delete it_mara where matnr in s_matnr.

Make sure that column in where clause of delete is a part of the internal table

Regards,

Prashant

Read only

0 Likes
829

Sample code which is working


tables:mara.
select-options: s_matnr for mara-matnr.

types: begin of t_mara,
       matnr type matnr,
       end of t_mara.

data: it_mara type standard table of t_mara.


select matnr into table it_mara
from mara where matnr in s_matnr.

delete it_mara where matnr in s_matnr.

Make sure that column in where clause of delete is a part of the internal table

Regards,

Prashant