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 data issue

Former Member
0 Likes
1,307

i have a internal table i_final in program 1 and this internal table data need to be input of other program, so how i need to pass the i_final data to other program.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,272

Hmmm, I tried it and it worked fine:

Report 1:

DATA: BEGIN OF lt_test OCCURS 0.

INCLUDE STRUCTURE bkpf.

DATA: END OF lt_test.

I've added a line in debug mode.

EXPORT lt_test TO MEMORY ID 'zftest'.

Submit report2.

Report 2:

DATA: BEGIN OF lt_test OCCURS 0.

INCLUDE STRUCTURE bkpf.

DATA: END OF lt_test.

IMPORT lt_test FROM MEMORY ID 'zftest'.

Please check of the table definition is the same and both reports. If so, please let me know your release and the text of the dump.

Regards

Nicola

12 REPLIES 12
Read only

former_member225631
Active Contributor
0 Likes
1,272

Use submit.

submit prg_name.

Declare same internal table in target proram also.

Read only

0 Likes
1,272

do u have any ex for this .

Read only

Former Member
0 Likes
1,272

If you don't have a chance to use perform routines you'll have to use 'EXPORT TO MEMORY' and in the other program 'IMPORT FROM MEMORY'.

Regards

Nicola

Read only

former_member225631
Active Contributor
0 Likes
1,272

Simply use submit statement.

submit test. (test is target program).

declare the same internal table in target program.

Use the data in target program.

Read only

Former Member
0 Likes
1,272

Sure,

e.g.:

EXPORT lt_table TO MEMORY ID 'ZFTABLE'.

IMPORT lt_table FROM MEMORY ID 'ZFTABLE'.

in both reports the table definition and the name of the ID has to be the same (you can choose any name you like).

Hope that helps!

Nicola

Read only

former_member225631
Active Contributor
0 Likes
1,272

Simply use submit statement.

submit test. (test is target program).

declare the same internal table in target program.

Use the data in target program.

Read only

Former Member
0 Likes
1,272

it doesn't work with submit, at least not up to release 4.7

With submit you can transfer a selection table but not an internal table with data.

Regards

Nicola

Read only

0 Likes
1,272

hi nicolas,

i have tried using export and import its not working.

Read only

0 Likes
1,272

this is the code in program 1:

ENDIF.

**appending work area to internal table.

APPEND wa_final TO i_final.

ENDLOOP.

EXPORT i_final to memory id 'zfinal'.

this is the code in program 2:

TYPES: BEGIN OF t_final,

bukrs TYPE bkpf-bukrs,

belnr TYPE bkpf-belnr,

blart TYPE bkpf-blart,

xblnr TYPE bkpf-xblnr,

ebeln TYPE ekbe-ebeln,

ebelp TYPE ekbe-ebelp,

belnr1 TYPE ekbe-belnr,

xblnr1 TYPE ekbe-xblnr,

ebeln1 TYPE ekko-ebeln,

exnum TYPE ekko-exnum,

lands TYPE ekko-lands,

stceg_l TYPE ekko-stceg_l,

END OF t_final.

DATA: i_final TYPE STANDARD TABLE OF t_final WITH HEADER LINE.

DATA: wa_final TYPE t_final.

IMPORT i_final from memory ID 'zfinal'.

write: i_final.

its giving Dump.

Read only

Former Member
0 Likes
1,274

Hmmm, I tried it and it worked fine:

Report 1:

DATA: BEGIN OF lt_test OCCURS 0.

INCLUDE STRUCTURE bkpf.

DATA: END OF lt_test.

I've added a line in debug mode.

EXPORT lt_test TO MEMORY ID 'zftest'.

Submit report2.

Report 2:

DATA: BEGIN OF lt_test OCCURS 0.

INCLUDE STRUCTURE bkpf.

DATA: END OF lt_test.

IMPORT lt_test FROM MEMORY ID 'zftest'.

Please check of the table definition is the same and both reports. If so, please let me know your release and the text of the dump.

Regards

Nicola

Read only

0 Likes
1,272

tks nicola my problem is solved

Read only

Former Member
0 Likes
1,272

You're welcome )

Nicola