2007 Aug 26 7:48 AM
i have a itab in which i have follow records
mblnr menge bwart smbln
0021 8 131
0024 5 131
0028 8 132 0021
i want to delete row with mblnr = 21 and 28.
can anyboby help. points will awarded surely.
2007 Aug 27 2:11 AM
Hi Sarabjit,
For deleting the records with a specific Movement Type, you need to code just one line.
DELETE itab WHERE bwart = 'Movement type you want to exclude'.
For ex.: DELETE itab WHERE bwart = '132'.
For deleting the records, where the mblnr values is contained by any other record in smbln:
Here you will need to use a loop.
Fill a range for smbln first. RANGES : r_smbln FOR smbln.
LOOP AT itab.
IF NOT itab-smbln IS INITIAL.
MOVE : 'I' to r_smbln-sign,
'EQ' to r_smbln-option,
itab-smbln to r_smbln-low.
APPEND r_smbln.
ENDIF.
ENDLOOP.
Now delete the records.
DELETE itab WHERE mblnr IN r_smbln.
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**
Hi Sarabjit,
For deleting the records with a specific Movement Type, you need to code just one line.
DELETE itab WHERE bwart = 'Movement type you want to exclude'.
For ex.: DELETE itab WHERE bwart = '132'.
For deleting the records, where the mblnr values is contained by any other record in smbln:
Here you will need to use a loop.
Fill a range for smbln first. RANGES : r_smbln FOR smbln.
LOOP AT itab.
IF NOT itab-smbln IS INITIAL.
MOVE : 'I' to r_smbln-sign,
'EQ' to r_smbln-option,
itab-smbln to r_smbln-low.
APPEND r_smbln.
ENDIF.
ENDLOOP.
Now delete the records.
DELETE itab WHERE mblnr IN r_smbln.
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**
2007 Aug 26 8:05 AM
hi kaur,
delete itab where mblnr = 0021 and mblnr = 0028.
Thanks & regards,
S.Suresh.
Reward Point if useful...
2007 Aug 26 8:16 AM
Hi Kaur,
Use DELETE statement to delete the internal table entries
DELETE itab WHERE MBLNR = '0021' OR MBLNR = '0028'.
Check this link for DELETE statement
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/delete_i.htm
Thanks,
Vinay
2007 Aug 26 8:20 AM
hi,
You have to use the below code :
delete itab where mblnr = '0021' or
mblnr = '0028'.
Thanks,
Sriram Ponna.
Message was edited by:
Sriram Ponna
2007 Aug 26 8:23 AM
but i want to delete records based on movement type and smbln such as delete those records which have movement type = 132 or smbln = mblnr, in my case thsese records are 0028 and 0021
2007 Aug 26 8:57 AM
Hi,
I want to add some more points to mr.vinay's reply.
ranges : r_mblnr for table-mblnr.
r_mblnr-low = '0021'.
append r_mblnr.
r_mblnr-low = '0028'.
append r_mblnr.
now.. use the delete statement as below....
DELETE itab WHERE MBLNR in r_mblnr.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/delete_i.htm
Please reward points if it is useful.....
Please feel free to contact....
Regards
Sreenivasa sharma
2007 Aug 27 2:11 AM
Hi Sarabjit,
For deleting the records with a specific Movement Type, you need to code just one line.
DELETE itab WHERE bwart = 'Movement type you want to exclude'.
For ex.: DELETE itab WHERE bwart = '132'.
For deleting the records, where the mblnr values is contained by any other record in smbln:
Here you will need to use a loop.
Fill a range for smbln first. RANGES : r_smbln FOR smbln.
LOOP AT itab.
IF NOT itab-smbln IS INITIAL.
MOVE : 'I' to r_smbln-sign,
'EQ' to r_smbln-option,
itab-smbln to r_smbln-low.
APPEND r_smbln.
ENDIF.
ENDLOOP.
Now delete the records.
DELETE itab WHERE mblnr IN r_smbln.
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**
2007 Aug 27 8:52 AM
thanx vikas you told me a new thing.thanx alot awarded you full points.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |