Application Development 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: 

Internal Table Processing

Former Member
0 Kudos
79

I have two internal Tables ITAB and JTAB. I want to append 1st and 5 th rows of ITAB's to JTAB.....How could i do that....

Also using Modify statement I want to change only column of ITAB without changing other's data... How to acheive it.

4 REPLIES 4

former_member225631
Active Contributor
0 Kudos
49

declare one counter.

then use like

if counter = 1 or counter = 5.

do.

endif.

former_member225631
Active Contributor
0 Kudos
49

loop at itab.

if sy-tabix eq 1 or sy-tabix eq 5.

jtab = itab.

append jtab.

endif.

endloop.

raymond_giuseppi
Active Contributor
0 Kudos
49

First question : use the following syntax

APPEND LINES OF <itab1> [FROM <n1>] [TO <n 2>] TO <itab2>.

Second question :

MODIFY itab [FROM wa] TRANSPORTING f1 ... fn 

Regards

Former Member
0 Kudos
49

Hi..,

<b>

To append only the 1st and 5th rows ....</b>

loop at itab into wa_itab.

if sy-tabix eq 1 or sy-tabix eq 5.

wa_jtab = wa_itab.

append wa_jtab to jtab.

clear wa_jtab.

endif.

endloop.

<b>

To append rows from 1 to 5..</b>

append lines of itab from 1 to 5 to jtab.

<b>To change onli some particular column values .. we have the option called TRANSPORTING</b>

wa_itab should contain the new values to be modified..

modify itab from wa_itab transporting <C1> <C2>...

reward points if helpful...

sai ramesh