Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Intertable Operations--help required

Former Member
0 Likes
474

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

2 REPLIES 2
Read only

Former Member
0 Likes
442

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

Read only

Former Member
0 Likes
442

For the second problem:


SORT itab.
DELETE ADJACENT DUPLICATES FROM itab.

Rob