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: 

passing itab b/t teo reports

Former Member
0 Kudos

hi

could anybody tell me

how to pass internal table between two reports..?

is ther any way ?

thanking you

Bharadwaj

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Bharadwaj,

You can pass internal table between two reports.

pls check the below code for the same.

REPORT ypa1_test10.

DATA : BEGIN OF itab OCCURS 0,

lin(80) TYPE c,

END OF itab.

itab-lin = 'This is first line.'.

APPEND itab.

itab-lin = 'This is second line.'.

APPEND itab.

EXPORT itab TO MEMORY ID 'ID1'.

SUBMIT yap1_test11.

second program

REPORT ypa1_test11.

DATA : BEGIN OF itab OCCURS 0 ,

lin(80) TYPE c,

END OF itab.

IMPORT itab FROM MEMORY ID 'ID1'.

itab-lin = 'In the second program'.

append itab.

LOOP AT itab.

WRITE 😕 itab-lin.

ENDLOOP.

I hope this will give some idea

Bye

Pavan

8 REPLIES 8

Former Member
0 Kudos

Bharadwaj,

Use IMPORT and EXPORT commands. This should solve your problem.

REgards,

Ravi

Note : Please remember to reward points if the answers help you.

Former Member
0 Kudos

Hi,

Place your ITAB in Include file.

You can call this Include where ever you want.

CHEERS

Former Member
0 Kudos

Hi Bharadwaj,

You can pass internal table between two reports.

pls check the below code for the same.

REPORT ypa1_test10.

DATA : BEGIN OF itab OCCURS 0,

lin(80) TYPE c,

END OF itab.

itab-lin = 'This is first line.'.

APPEND itab.

itab-lin = 'This is second line.'.

APPEND itab.

EXPORT itab TO MEMORY ID 'ID1'.

SUBMIT yap1_test11.

second program

REPORT ypa1_test11.

DATA : BEGIN OF itab OCCURS 0 ,

lin(80) TYPE c,

END OF itab.

IMPORT itab FROM MEMORY ID 'ID1'.

itab-lin = 'In the second program'.

append itab.

LOOP AT itab.

WRITE 😕 itab-lin.

ENDLOOP.

I hope this will give some idea

Bye

Pavan

0 Kudos

Thnx to all ...

i awarded some points to everyone.

bharadwaj

Former Member
0 Kudos

Hi,

Passing data from one ABAP program to another:

1. You have to define an internal table ITAB in program AAA.

2. In the program AAA you export your ITAB to the memory.

<b> EXPORT ITAB TO MEMORY ID 'TD'</b> (ID is the name of memory, you don't need to create it ).

3. In program BBB you have to declare The same table (same table's name and same fields).

4. In BBB you can import ITAB :

<b>IMPORT ITAB FROM MEMORY ID 'TD'</b>

5. Now you can export it to AAA after modifications.

<b>EXPORT ITAB TO MEMORY ID 'TD'</b>

6. In AAA :

<b>IMPORT ITAB FROM MEMORY ID 'TD'</b>

This solution is independant to SUBMIT.

Hope it helps u

Thanks&Regards

Ruthra.R

Former Member
0 Kudos

Bharadwaj,

If you are done with the thread, request to please close the thread by clicking on the start icon, which indicate the question is resolved.

Regards,

Ravi

Former Member
0 Kudos

Hi,

The internal table contents that you pass to Memory ID using <b>IMPORT/EXPORT</b> statements will only be there for the current Session.

Say you call the same transaction( the program you are running now) again you won't get those contents.

In these cacse yiou need to use <b>DATABASE INDEX</b> to achieve this.

Please reward points if this explanation is useful.

Regards,

Siva

Former Member
0 Kudos

see basically yyou can transport the internal tabel in two ways

1 import/export - abap memory (in the same transaction )

2. INDX cluster database - SAp memory (B/W transaction ).

now.if you use first method try to use following syntax

export <itab> to memory <id>

and in the report wher you want to send you shoul write the folowing code in that report.

import <itab> from memory <id>

<id> should be same in both the cases this can be any valid unique number.

2. if you use the second methoduse this syntax.

export <itab> to INDX(ar) id <key>

in the report where you want to use wtite teh following code.

import <itab> from INDX(ar) id <key>

pls reply if any doubts

cheers