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

Modify Internal table

Former Member
0 Likes
485

Hi guys,

I have a scenario wherein i need to move data from 2 separate internal tables to a third internal table.

How do i go about it.

All 3 internal tables have the same structure.

Thanks and regards,

Frank

1 ACCEPTED SOLUTION
Read only

former_member182371
Active Contributor
0 Likes
464

Hi,

check this:

http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb36c8358411d1829f0000e829fbfe/content.htm

maybe something like:


APPEND LINES OF itab1 TO itab3.
APPEND LINES OF itab2 TO itab3.

Best regards.

4 REPLIES 4
Read only

vinod_vemuru2
Active Contributor
0 Likes
464

This message was moderated.

Read only

former_member182371
Active Contributor
0 Likes
465

Hi,

check this:

http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb36c8358411d1829f0000e829fbfe/content.htm

maybe something like:


APPEND LINES OF itab1 TO itab3.
APPEND LINES OF itab2 TO itab3.

Best regards.

Read only

MarcinPciak
Active Contributor
0 Likes
464

Hi frank,

You can do this is in several ways. One of it would be:


data: it_dest type table ...
        it_src1 type table ...
        it_src2 type table ...

APPEND LINES OF: it_src1 TO it_dest,
                               it_src2 TO it_dest.

Sencond way would be passing first part of task (coping first internal table) to kernel with statement:


it_dest[] = it_scr1[].  "this passes content of source tab to destination, it will overwrite content of it_dest if not empty
"second step has to remain as above, otherwise we would erase what we have just copied
APPEND LINES OF it_scr2 TO it_dest.

Other way would be looping through the tables and appending/inserting these to destination table, but these two above are sufficient.

Regards

Marcin

Read only

Former Member
0 Likes
464

HI,

You can transfer the data of tab1 and tab2 to table 3 which are having the same structure in the following way

APPEND LINES OF itab1 TO itab2

APPEND LINES OF itab2 TO itab3

APPEND LINES OF itab1 [FROM n1] [TO n2] TO itab2.

where n1 and n2 specify the indexes of the first and last line of itab1 that you want to appned to itab2.

Regards

Sathish