‎2006 Feb 01 4:02 AM
Hi Abapers,
i want to delete itab using 'in' operator but it's not supporting...
So can any one say what is the substitute for in operator?
Example Like This..
delete itab where mtart in ('HALB' 'ROH') and also
delete itab where mtart not in ('HALB' 'ROH')
Thanks...
Have a nice day..
Regards
OJP..
‎2006 Feb 01 4:26 AM
Hi Priya,
You can try using Select options as...
SELECT-OPTIONS check_in FOR mtart NO-DISPLAY.
s_number-sign = 'I'.
s_number-option = 'EQ'.
s_number-low = 'HALB'.
APPEND check_in TO check_in.
s_number-sign = 'I'.
s_number-option = 'EQ'.
s_number-low = 'ROH'.
APPEND check_in TO check_in.
delete statement
Regards,
Uma
‎2006 Feb 01 4:04 AM
Hi Priya,
try : with Comma between HALB and ROH
delete itab where mtart in ('HALB','ROH' ).
Lanka
‎2006 Feb 01 4:05 AM
‎2006 Feb 01 4:22 AM
RANGES range for mara-mtart.
range-sign = 'I'.
range-option = 'EQ'.
range-low = 'HALB'.
range-high = 'ROH'.
APPEND range.
DELETE : itab where mtart in range.
‎2006 Feb 01 4:46 AM
Hi,
ranges: r_mtart for mara-mtart.
r_mtart-sign = 'I'.
r_mtart-option = 'EQ'.
r_mtart-low = 'HALB'.
APPEND r_mtart.
r_mtart-sign = 'I'.
r_mtart-option = 'EQ'.
r_mtart-low = 'ROH'.
APPEND r_mtart.
delete itab where mtart not in r_mtartregards
vijay
Message was edited by: Vijay Babu Dudla
‎2006 Feb 01 4:05 AM
Priya,
You cannot use it like that.
Declare a variable RANGES, append all your values there and then use the IN clause. You can use I and EQ for the Sign and Option fields.
DELETE itab where MATNR in R_MATNR.
Regards,
Ravi
Note : Reward the posts that help you.
‎2006 Feb 01 4:26 AM
Hi Priya,
You can try using Select options as...
SELECT-OPTIONS check_in FOR mtart NO-DISPLAY.
s_number-sign = 'I'.
s_number-option = 'EQ'.
s_number-low = 'HALB'.
APPEND check_in TO check_in.
s_number-sign = 'I'.
s_number-option = 'EQ'.
s_number-low = 'ROH'.
APPEND check_in TO check_in.
delete statement
Regards,
Uma
‎2006 Feb 01 4:30 AM
A correction to the previous post as Uma had suggested.
RANGES range for mara-mtart.
range-sign = 'I'.
range-option = 'EQ'.
range-low = 'HALB'.
APPEND range.
range-sign = 'I'.
range-option = 'EQ'.
range-low = 'ROH'.
APPEND range.
DELETE : itab where mtart <b>NOT IN</b> range.
‎2006 Feb 01 4:50 AM
Performance wise, I would just recommend using two statements instead of one as follows.
DELETE itab WHERE mtart = 'HALB'.
DELETE itab WHERE mtart = 'ROH'.
‎2006 Feb 01 5:09 AM
hi priya,
to my knowledge, 'IN' is replaced for 'OR'
and 'Not in' by 'AND'.
so you could try it out.
delete itab where mtart eq 'HALB' or mtart eq 'ROH'
delete itab where mtart ne 'HALB' and mtart ne 'ROH'
reward me if it was helpful.
regards,
Aditya.
‎2006 Feb 01 6:42 AM
Hi All,
Kindly note that Range is not same as operator IN
e.g IN (A , B , F) .. this will delete the entries wid value as A or B or F (this represents a SET not a range)
if you use the range table between A and F it will delete all entries between A and F i.e A , B , C , D , E and F.
The best solution is the one advised by Mr. Adavi.
regards,
Sumeet Mishra,
Reward points if this helps. : )