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

range

Former Member
0 Likes
373

hi all,

Please tell me if this statement is wrong:

delete t_mat where matnr in r_matnr[].

presently, r_matnr ( defined as range) is empty but still t_mat is getting deleted.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
349

If there is nothing in the range then all records will be deleted.

You need to do a

CHECK NOT R_MATNR[] IS INITIAL

4 REPLIES 4
Read only

Former Member
0 Likes
350

If there is nothing in the range then all records will be deleted.

You need to do a

CHECK NOT R_MATNR[] IS INITIAL

Read only

Former Member
0 Likes
349

Hello,

because the range-table is empty every record is deleted. An empty range table is used as "all".

Best regards

Frank

Read only

Former Member
0 Likes
349

try this..

if not r_matnr[] is initial.
delete t_mat where matnr in r_matnr[].
endif.

Read only

Former Member
0 Likes
349

the funcionnality is like that.

so try like this..

ranges: r_matnr for mara-matnr.

data:

t_mara type table of mara with header line.

select *

from mara

up to 5 rows

into table t_mara.

if not r_matnr[] is initial.

delete t_mara where matnr in r_matnr.

endif.

write: 'test'.