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

Former Member
0 Kudos

hi,

can anyone tell me how to move the content of internal table to another internal table which is in another report program.

thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

-


Program1----


REPORT demo_program_rep3 NO STANDARD PAGE HEADING.

DATA: number TYPE i,

itab TYPE TABLE OF i.

SET PF-STATUS 'MYBACK'.

DO 5 TIMES.

number = sy-index.

APPEND number TO itab.

WRITE / number.

ENDDO.

TOP-OF-PAGE.

WRITE 'Report 2'.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'MBCK'.

EXPORT itab TO MEMORY ID 'HK'.

LEAVE.

ENDCASE.

-


Program2----


REPORT demo_programm_leave NO STANDARD PAGE HEADING.

DATA: itab TYPE TABLE OF i,

num TYPE i.

SUBMIT demo_program_rep3 AND RETURN.

IMPORT itab FROM MEMORY ID 'HK'.

LOOP AT itab INTO num.

WRITE / num.

ENDLOOP.

TOP-OF-PAGE.

WRITE 'Report 1'.

ULINE.

-


end of program 2----


Now you copy this programs with same name as i mentioned and execute demo_programm_leave Program.you will understnad clearly.

Notes::: A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .

An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).

Every program you start runs in an internal session.

To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.

If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.

To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.

Change according to your requirements...

Regds

Sivaparvathi

Please dont forget to reward points if helpful....

3 REPLIES 3

andreas_mann3
Active Contributor
0 Kudos

use import / export to memory

A.

Former Member
0 Kudos

use abap memory : export / import to memory

Former Member
0 Kudos

Hi,

-


Program1----


REPORT demo_program_rep3 NO STANDARD PAGE HEADING.

DATA: number TYPE i,

itab TYPE TABLE OF i.

SET PF-STATUS 'MYBACK'.

DO 5 TIMES.

number = sy-index.

APPEND number TO itab.

WRITE / number.

ENDDO.

TOP-OF-PAGE.

WRITE 'Report 2'.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'MBCK'.

EXPORT itab TO MEMORY ID 'HK'.

LEAVE.

ENDCASE.

-


Program2----


REPORT demo_programm_leave NO STANDARD PAGE HEADING.

DATA: itab TYPE TABLE OF i,

num TYPE i.

SUBMIT demo_program_rep3 AND RETURN.

IMPORT itab FROM MEMORY ID 'HK'.

LOOP AT itab INTO num.

WRITE / num.

ENDLOOP.

TOP-OF-PAGE.

WRITE 'Report 1'.

ULINE.

-


end of program 2----


Now you copy this programs with same name as i mentioned and execute demo_programm_leave Program.you will understnad clearly.

Notes::: A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .

An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).

Every program you start runs in an internal session.

To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.

If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.

To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.

Change according to your requirements...

Regds

Sivaparvathi

Please dont forget to reward points if helpful....