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

getting one extra row for each object_id using insert lines statement.

Pranil1
Participant
0 Likes
525

Hi.

I m using insert lines statement to merge two internal table. Its working properly but i m getting one blank row extra for each object id. so i wanna know how to delete this one extra row.

I m using the following syntax.

LOOP AT ITAB.

LOOP AT NTAB WHERE PARTNER_FCT = '00000015'.

IF NTAB-object_id = iTAB-object_id .

itab-partner_no2 = NTab-partner_no2.

itab-partner_fct = ntab-partner_fct.

itab-bez30 = ntab-bez30.

itab-bez20 = ntab-bez20.

itab-bez2 = ntab-bez2.

itab-others = ntab-others.

INSERT lines of nTAB INTO ITAB.

modify itab.

sort itab by OBJECT_ID descending PARTNER_NO2 .

delete adjacent duplicates from itab comparing partner_no2 object_id.

ENDIF.

endloop.

endloop.

Thanx in Advance.

Pranil Shinde.

3 REPLIES 3
Read only

Former Member
0 Likes
507

Are you trying to update some fields of a single row of itab from ntab or want to insert a new line in itab?

Read only

0 Likes
507

I am trying to update some fields of a single row of itab from ntab

Read only

Former Member
0 Likes
507

Hey try using in following way...

LOOP AT ITAB.

LOOP AT NTAB WHERE PARTNER_FCT = '00000015' and object_id = iTAB-object_id .

itab-partner_no2 = NTab-partner_no2.

itab-partner_fct = ntab-partner_fct.

itab-bez30 = ntab-bez30.

itab-bez20 = ntab-bez20.

itab-bez2 = ntab-bez2.

itab-others = ntab-others.

modify itab.

sort itab by OBJECT_ID descending PARTNER_NO2 .

delete adjacent duplicates from itab comparing partner_no2 object_id.

endloop.

endloop.

Regards

Prax