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

internal table

Former Member
0 Likes
366

how to copy one internal table data from one report program to other int. table in another program?

4 REPLIES 4
Read only

Former Member
0 Likes
345

Use ABAP memory :

See the example program ,here we have two programs ,we use Export and Import commands:

REPORT ZTEST_AMEM1.

tables : lfa1.

data : begin of i_lfa1 occurs 0 ,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of i_lfa1.

start-of-selection.

select lifnr

name1

land1 from lfa1

into table i_lfa1 up to 100 rows.

  • Export

export i_lfa1 to memory id 'SAP'.

submit ztest_amem2 and return.

write:/ 'hello'.

&----


*& Report ZTEST_AMEM2

*&

&----


*&

*&

&----


REPORT ZTEST_AMEM2.

data : begin of j_lfa1 occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of j_lfa1.

start-of-selection.

import i_lfa1 to j_lfa1 from memory id 'SAP'.

loop at j_lfa1.

write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.

endloop.

Read only

0 Likes
345

hi,

thanks for this.

Read only

Former Member
0 Likes
345

Hi ,

Can eloborate more about the exact requirement?

If you have written your program based on Subroutines or methods, which has export parameters as table then you can use call those subroutine or methods from other programs.

Read only

0 Likes
345

i hav tried it thru external subroutine but not succeeded. my requirement is i have to copy data of itab in prog1 to jtab in prog2? if it can b possible thru subroutines, than plz help me with example.