2007 Dec 20 5:36 AM
Hi Experts,
I have records in itab. For. e.g.
Order No. Vornr Qty.
123 0010 15
123 0010 2
123 0020 3
123 0030 13
123 0030 12
123 0030 9.
I want to delete Vornr = 0010 and 0020 from itab. Only 0030 i want to keep.
There are multiple orders with multiple aufnr vornr.
Pl. guide me......
Yusuf
Hi Experts,
I have records in itab. For. e.g.
Order No. Vornr Qty.
123 0010 15
123 0010 2
123 0020 3
123 0030 13
123 0030 12
123 0030 9.
I want to delete Vornr = 0010 and 0020 from itab. Only 0030 i want to keep.
There are multiple orders with multiple aufnr vornr.
Pl. guide me......
Yusuf
2007 Dec 20 5:37 AM
2007 Dec 20 5:46 AM
Hi Jack,
This is not so simple that u were explaining.
There are multiple vornr and aufnr
Like vornr upto 120 in some of same order.
Yusuf
2007 Dec 20 5:55 AM
Create a range and fill all values of VORNR you want to delete in LOW and then use
delete itab where vornr in r_vornr.
" Here r_vornr is range
a®
2007 Dec 20 5:39 AM
2007 Dec 20 5:40 AM
2007 Dec 20 5:42 AM
hi.,
use following command after fetching the data into internal table.
delete itab where vornr NE 0030.
Reward points if useful
Edited by: Chandrasekhar Velpula on Dec 20, 2007 6:43 AM
2007 Dec 20 5:42 AM
if ur requirement is to delete 0010 and 0020
just go for delete itab where vornr = 0010 and vornr = 0020.
or u r requirement is something else ???
2007 Dec 20 5:42 AM
DELETE TABLE itab WITH TABLE KEY vornr = '0010'.
DELETE TABLE itab WITH TABLE KEY vornr = '0020'.
OR
DELETE Itab WHERE vornr ne '0030'.
2007 Dec 20 5:42 AM
Hi,
Do like this
Loop at itab.
if ( itab-vornr eq '0010' ) or
( itab-vornr eq '0020' ).
delete itab.
endif.
endloop.
Regards,
Prashant
2007 Dec 20 5:44 AM
2007 Dec 20 5:46 AM
2007 Dec 20 5:46 AM
Hi,
To delete more than one line using a condition, use the following statement:
DELETE <itab> WHERE <cond>.
In your case:
DELETE itab WHERE Vornr NE 0030.
Regards,
Bhaskar
2007 Dec 20 5:57 AM
Hi,
how many values u have doesnt matter,
say u have 10 vornr values, populate all vornr into A range like below
r_vornr-option = 'I'.
r_vornr-sign = 'EQ'.
move '0030' to r_vornr-low.
append r_vornr.
clear r_vornr-low.
r_vornr-option = 'I'.
r_vornr-sign = 'EQ'.
move '0050' to r_vornr-low.
append r_vornr.
clear r_vornr-low.
.
.
.
sort itab.
loop at itab where vornr in r_vornr.
move itab to itab_new.
append itab_new.
clear itab_new.
endloop.
now itab_new will contain required values alone
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |