‎2008 Jun 26 10:25 AM
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
‎2008 Jun 26 10:44 AM
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
‎2008 Jun 26 10:33 AM
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
‎2008 Jun 26 10:38 AM
Hi,
Test your code porperly, it is working.
if you want to check it, you execute the program in debugging mode.
Regards,
SB
‎2008 Jun 26 10:38 AM
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.
‎2008 Jun 26 10:44 AM
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
‎2008 Jun 26 10:45 AM
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.
‎2008 Jun 27 1:58 AM
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?
‎2008 Jun 26 10:45 AM
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.