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

regarding Global transfer

Former Member
0 Likes
594

hi guys,

How to pass internal tables from one program to another in below situations.

Prog ZMainXXX

..............

<b>Loop at itab.

................

Create bdc_fields.

Call transaction ZXXX using BDCTAB.

...............

ENDLOOP.</b>

ZXXX is transaction created from std program

SAPLYXXX which has many includes and function modules.

<b>Prog SAPLYXXX

.............

Submit Report RSLXXXX.

End program</b>

Inside RSLXXXX Report program.

I have Internal table LISTTAB used. I want to pass this internal table values appended each time for each Loop at Itab at ZMainXXX Program

How to append Internal table LISTTAB values for each loop of IITAB at ZMAINXXX.

suggestion please.

Thanks

Ambichan.

hi guys,

How to pass internal tables from one program to another in below situations.

Prog ZMainXXX

..............

<b>Loop at itab.

................

Create bdc_fields.

Call transaction ZXXX using BDCTAB.

...............

ENDLOOP.</b>

ZXXX is transaction created from std program

SAPLYXXX which has many includes and function modules.

<b>Prog SAPLYXXX

.............

Submit Report RSLXXXX.

End program</b>

Inside RSLXXXX Report program.

I have Internal table LISTTAB used. I want to pass this internal table values appended each time for each Loop at Itab at ZMainXXX Program

How to append Internal table LISTTAB values for each loop of IITAB at ZMAINXXX.

suggestion please.

Thanks

Ambichan.

3 REPLIES 3
Read only

gopi_narendra
Active Contributor
0 Likes
563

you can use the EXPORT / IMPORT statements to pass the internal table from one prog to another.

export LISTTAB to memory id 'LSTB'.

in ur prog ZMainXXX

use the import statement

import LISTTAB from memory id 'LSTB'.

and then here in loop u can append all the records of LISTTAB to ITAB.

Regards

Gopi

Read only

0 Likes
563

hi gopi

Thanks for your reply.

You mean to say i need to declare LISTTAB inside ZMAINXXX program also.

Thanks

Ambichan

Read only

Former Member
0 Likes
563

Prince,

If your program name starts with "RS" means it is standard program.

my question is how can you change your program without key?If you have already

DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.

---In prog....RSLXXXX

DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.

---In prog....ZMainXXX

use EXPORT ITAB TO MEMORY ID 'table'. -In Prog RSLXXXX program.

IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.--In prog ZMainXXX

**************************

Take this example for your reference.

PROGRAM SAPMZTS1.

DATA TEXT1(10) VALUE 'Exporting'.

DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.

DO 5 TIMES.

ITAB-BOOKID = 100 + SY-INDEX.

APPEND ITAB.

ENDDO.

EXPORT TEXT1

TEXT2 FROM 'Literal'

TO MEMORY ID 'text'.

EXPORT ITAB

TO MEMORY ID 'table'.

SUBMIT SAPMZTS2 AND RETURN.

SUBMIT SAPMZTS3.

The first part of this program is the same as the example in the section Saving Data Objects in Memory. In the example, the programs SAPMZTS1 and SAPMZTS2 are called using SUBMIT. You can create and maintain the programs called using the SUBMIT statement by double-clicking their names in the statement. For further information about the SUBMIT statement, refer to Calling Executable Programs (Reports)

Example for SAPMZTS2:

PROGRAM SAPMZTS2.

DATA: TEXT1(10),

TEXT3 LIKE TEXT1 VALUE 'Initial'.

IMPORT TEXT3 FROM MEMORY ID 'text'.

WRITE: / SY-SUBRC, TEXT3.

IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.

WRITE: / SY-SUBRC, TEXT1.

Example for SAPMZTS3:

PROGRAM SAPMZTS3.

DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.

IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.

LOOP AT JTAB.

WRITE / JTAB-BOOKID.

ENDLOOP.

Pls. mark if useful