‎2007 Oct 21 2:47 PM
Hi
I had a internal table with 20 records with 15 empty,i have to delete these empty records,plz tell me how to do it?
alos i hav a table with 15 records & one with 5 records(common).so how to delete these common records from 15 record table.
plz tell me how to do,i need help.
Regards
Vipin
‎2007 Oct 21 3:10 PM
Check my notes below -
I had a internal table with 20 records with 15 empty,i have to delete these empty records,plz tell me how to do it?
--> suppose your internal table name is ITAB and field name is FIELD1.
You can use this command.
DELETE ITAB WHERE FIELD1 IS INITIAL.
alos i hav a table with 15 records & one with 5 records(common).so how to delete these common records from 15 record table.
-->Suppose table with 15 records is ITAB1 and table with 5 records is ITAB2.
SORT ITAB1. SORT ITAB2.
LOOP AT ITAB1.
READ TABLE ITAB2 WITH KEY FIELD1 = ITAB1-FIELD1.
IF SY-SUBRC EQ 0.
DELETE ITAB1.
ENDIF.
ENDLOOP.
Hope this helps.
ashish
Message was edited by:
Ashish Gundawar
‎2007 Oct 21 4:57 PM
For the second problem:
SORT itab.
DELETE ADJACENT DUPLICATES FROM itab.
Rob