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 is deleting table from table

Former Member
0 Likes
1,049

Hello,

I used a ranges object in a 4.7system. If the range was empty, nothing would be deleted from my table. In a ECC6.0 system, if the range is empty, everything is deleted from the table. Could this be a bug that was fixed in ECC6.0?

Edited by: Julius Bussche on Feb 4, 2009 6:19 PM

Post split from hijacked ancient thread

Hi,

are you sure about it? I just tested it in 4.6C system and it deleted all lines from table. It also makes sense. When you have condition with range such as "field IN range" then any value fulfill this condition in case of initial range.

Cheers

4 REPLIES 4
Read only

former_member194669
Active Contributor
0 Likes
978

I think you are right.( I am in netweaver 7 PI version )


report  zars no standard page heading
        line-size 170
        line-count 65(4).
ranges : r_matnr for mara-matnr.
data : begin of i_mara occurs 0.
data : matnr like mara-matnr.
data : end of i_mara.

move '001' to i_mara-matnr.
append i_mara.
move '002' to i_mara-matnr.
append i_mara.

delete i_mara where matnr in r_matnr.

break-point.

Its deleting entire i_mara internal table if r_matnr is blank.

I don't think this will be a bug.

We need to check if range is not initial , like below mentioned


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

Read only

mvoros
Active Contributor
0 Likes
978

Hi,

are you sure about it? I just tested it in 4.6C system and it deleted all lines from table. It also makes sense. When you have condition with range such as "field IN range" then any value fulfill this condition in case of initial range.

Cheers

Read only

Former Member
0 Likes
978

Hi,

with ranges and select-options ,if they are empty ,it would delete all contents.This is main difference between parameters and select-options.

Read only

Former Member
0 Likes
978

Hi,

with ranges and select-options ,it would delete all contents(in your case) or select all contents which is main difference between parameters and select-options.