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

import/export internal tabl

Former Member
0 Likes
1,019

Hi,

This is regarding import/export internal table to 2 different prog, somehow when i execute in prog ztest_hl7, it doesnt work. Please help.

report ztest_hl7.

TYPES:

BEGIN OF tab_type,

para TYPE string,

dobj TYPE string,

END OF tab_type.

DATA:

id TYPE c LENGTH 10 VALUE 'TEXTS',

text1 TYPE string VALUE `IKE`,

text2 TYPE string VALUE `TINA`,

line TYPE tab_type,

itab TYPE STANDARD TABLE OF tab_type.

line-para = 'P1'.

line-dobj = 'TEXT1'.

APPEND line TO itab.

line-para = 'P2'.

line-dobj = 'TEXT2'.

APPEND line TO itab.

EXPORT itab TO MEMORY ID id.

submit ztest_hl6 and return.

-


report ztest_hl6.

data : id TYPE c LENGTH 10 VALUE 'TEXTS'.

TYPES:

BEGIN OF tab_type,

para TYPE string,

dobj TYPE string,

END OF tab_type.

DATA: itab TYPE STANDARD TABLE OF tab_type,

wa_itab type tab_type.

IMPORT itab FROM MEMORY ID id.

loop at itab into wa_itab.

write:

wa_itab-para,

wa_itab-dobj.

endloop.

Edited by: Hui Leng Yeoh on Jun 26, 2008 11:25 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
780

hi hui leng,

I don't see any error in your program.

After executing report ztest_hl7 program, it is working perfet.

Output of the program:

P1 TEXT1 P2 TEXT2

7 REPLIES 7
Read only

Former Member
0 Likes
780

Hi,

Modify only this part of ur code, as below

1 .IMPORT itab FROM MEMORY ID id. to

IMPORT itab to itab1 FROM MEMORY ID id.

declare ITAB1....like ITAB

If the hint is usefulu2026 Say thanks by rewardu2026.

Regards,

Prabhu Rajesh

Edited by: PrabhuRajesh Janardanan on Jun 26, 2008 11:33 AM

Read only

Former Member
0 Likes
780

Hi,

Test your code porperly, it is working.

if you want to check it, you execute the program in debugging mode.

Regards,

SB

Read only

vinod_vemuru2
Active Contributor
0 Likes
780

Hi There are few syntax errors. Comment ur code and Paste this code and check. It is working fine.


report ztest_hl7.
TYPES:
BEGIN OF tab_type,
para TYPE string,
dobj TYPE string,
END OF tab_type.

DATA:
id(10) TYPE c VALUE 'TEXTS',
text1 TYPE string, " VALUE `IKE`,
text2 TYPE string, " VALUE `TINA`,
line TYPE tab_type,
itab TYPE STANDARD TABLE OF tab_type.

text1 = 'IKE'.
text2 = 'TINA'.

line-para = 'P1'.
line-dobj = 'TEXT1'.
APPEND line TO itab.

line-para = 'P2'.
line-dobj = 'TEXT2'.
APPEND line TO itab.

EXPORT itab TO MEMORY ID id.

SUBMIT z7569411 AND RETURN.


data : id(10) TYPE c VALUE 'TEXTS'.

TYPES:
BEGIN OF tab_type,
para TYPE string,
dobj TYPE string,
END OF tab_type.

DATA: itab TYPE STANDARD TABLE OF tab_type,
wa_itab type tab_type.

IMPORT itab FROM MEMORY ID id.

loop at itab into wa_itab.
write:

wa_itab-para,
wa_itab-dobj.

endloop.

Thanks,

vinod.

Read only

Former Member
0 Likes
781

hi hui leng,

I don't see any error in your program.

After executing report ztest_hl7 program, it is working perfet.

Output of the program:

P1 TEXT1 P2 TEXT2

Read only

Former Member
0 Likes
780

Hi,

What is ur problem? I have executed ur code in ECC 5.0 and there it is working fine. If ur prob is with int. table import/export then u can specify the body of int. table during import/export.

like:

EXPORT itab[] TO MEMORY ID id.

IMPORT itab[] FROM MEMORY ID id.

instead:

EXPORT itab TO MEMORY ID id.

IMPORT itab FROM MEMORY ID id.

Regards,

Joy.

Read only

0 Likes
780

Thanks all.

End up, I change the internal table to itab[], with bracket added at the back of internal table.

Not quite understand why? Anyone?

Read only

VikasB
Active Participant
0 Likes
780

Hi,

Try with this one.

EXPORT itab FROM itab TO MEMORY ID 'TAB_ID'.

IMPORT itab FROM MEMORY ID 'TAB_ID'.

reward if helpful.

vikas.