‎2007 Sep 25 3:00 PM
hi,
i have internal table lt_vbak and i wont to delete from itab rows where field auart =
YAN77
YCR0
YCR1
YCR7
YCR8
YDR0
YCR1
YCR6
YCR9
YDR13
what is the best way to do that?
Regards
‎2007 Sep 25 3:13 PM
Hi,
Please try this.
tables: vbak.
ranges: r_auart for vbak-auart.
r_auart-sign = 'I'.
r_auart-option = 'EQ'.
r_auart-low = 'YAN77'.
append r_auart.
r_auart-low = 'YCR0'.
append r_auart.
...
r_auart-low = 'YDR13'.
append r_auart.
delete it_vbak where auart in r_auart.
Regards,
Ferry Lianto
‎2007 Sep 25 3:10 PM
try this..
delete lt_vbak where ( auart = 'YAN77' or
auart = 'YCR0' or
auart = 'YCR1' or
auart = 'YCR7' or
auart = 'YCR8' or
auart = 'YDR0' or
auart = 'YCR1' or
auart = 'YCR6' or
auart = 'YDR13' ).
Arya
‎2007 Sep 25 3:13 PM
Hi
delete lt_vbak where
auart = 'YAN77' or
auart = 'YCR0' or
auart = 'YCR1' or
auart = 'YCR7' or
auart = 'YCR8' or
auart = 'YDR0' or
auart = 'YCR1' or
auart = 'YCR6' or
auart = 'YDR13' .
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Sep 25 3:13 PM
Create a range like this...
TYPES: BEGIN OF ty_range,
sign TYPE c LENGTH 1,
option TYPE c LENGTH 2,
low TYPE string,
high TYPE string,
END OF ty_range.
DATA: t_range TYPE STANDARD TABLE OF ty_range,
w_range LIKE LINE OF t_range.
w_range-sign = 'I'.
w_range-option = 'EQ'.
w_range-low = 'YAN77'.
APPEND w_range TO t_range.
w_range-low = 'YCR0'.
APPEND w_range TO t_range.
Then do this...
DETELE TABLE WHERE FIELD IN T_RANGE.
Greetings,
Blag.
‎2007 Sep 25 3:13 PM
Hi,
Please try this.
tables: vbak.
ranges: r_auart for vbak-auart.
r_auart-sign = 'I'.
r_auart-option = 'EQ'.
r_auart-low = 'YAN77'.
append r_auart.
r_auart-low = 'YCR0'.
append r_auart.
...
r_auart-low = 'YDR13'.
append r_auart.
delete it_vbak where auart in r_auart.
Regards,
Ferry Lianto
‎2007 Sep 25 3:16 PM
Eliminate duplicates from the condition and put it in order:
DELETE it_vbak WHERE auart = 'YAN77' OR
auart = 'YCR0' OR
auart = 'YCR1' OR
auart = 'YCR6' OR
auart = 'YCR7' OR
auart = 'YCR8' OR
auart = 'YCR9' OR
auart = 'YDR0' OR
auart = 'YDR13'.
Rob