‎2006 May 24 1:24 PM
Hi Friends,
See the blow code:
REPORT ZEXPORT .
tables: kna1.
data: begin of itab occurs 0.
include structure kna1.
data: end of itab.
select * from kna1 into table itab.
if not itab is initial.
EXPORT itab to MEMORY ID 'mid'.
IF SY-SUBRC = 0.
WRITE:/ 'EXPORTED'.
ENDIF.
endif.
REPORT ZIMPORT .
data: begin of Jtab occurs 0.
include structure kna1.
data: end of Jtab.
IMPORT itab to jtab from MEMORY ID 'mid'.
loop at jtab.
write:/ jtab.
endloop.
in the first report, exported not printing the control is going back from export.
in the second report it is not printing jtab valyes.it is giving sy-subrc = 4 after import statement.
Can any body tell me what may be the problem?
Thanks in Advance.
‎2006 May 24 1:27 PM
PL try as follows..
REPORT ZEXPORT .
tables: kna1.
data: begin of itab occurs 0.
include structure kna1.
data: end of itab.
select * from kna1 into table itab.
if not itab[] is initial.
EXPORT itab[] to MEMORY ID 'mid'.
IF SY-SUBRC = 0.
WRITE:/ 'EXPORTED'.
ENDIF.
endif.
REPORT ZIMPORT .
data: begin of itab occurs 0.
include structure kna1.
data: end of itab.
IMPORT itab[] from MEMORY ID 'mid'.
loop at itab.
write:/ itab.
endloop.
Regards,
Suresh Datti
‎2006 May 24 1:27 PM
TRy Capital letters for mid
REPORT ZEXPORT .
tables: kna1.
data: begin of itab occurs 0.
include structure kna1.
data: end of itab.
select * from kna1 into table itab.
if not itab is initial.
EXPORT itab to MEMORY ID 'MID'.
IF SY-SUBRC = 0.
WRITE:/ 'EXPORTED'.
ENDIF.
endif.
REPORT ZIMPORT .
data: begin of Jtab occurs 0.
include structure kna1.
data: end of Jtab.
IMPORT itab to jtab from MEMORY ID 'MID'.
loop at jtab.
write:/ jtab.
endloop.
‎2006 May 24 1:30 PM
Hallo Jak,
as the report uses 'export to memory' it exports to ABAP Memory, which is the same external mode / call hierarchy. If the first reports submit the 2nd one the sy-SubRc should be 0.
Regards
Klaus
Online Help: ABAP Memory
This sequence is created if you can return from the called program to the calling program at the call of an ABAP-Program with SUBMIT ... AND RETURN or CALL TRANSACTION. For this purpose, the data of the internal session of the caller remains on a stack. The programs of a call sequence have collective access to the ABAP Memory. A call sequence can be left completely using the statement LEAVE TO TRANSACTION.
‎2006 May 24 1:33 PM
Hi jak,
1. I tried it at my end.
Now it works fantastic.
2. Make this small corrections.
3. specify itab as itab[]
REPORT ZEXPORT .
tables: kna1.
data: begin of itab occurs 0.
include structure kna1.
data: end of itab.
select * from kna1 into table itab.
if not <b>itab[]</b> is initial.
EXPORT itab to MEMORY ID 'mid'.
IF SY-SUBRC = 0.
WRITE:/ 'EXPORTED'.
ENDIF.
endif.
submit zimport and return.
regards,
amit m.
‎2006 May 24 1:38 PM
‎2006 May 24 1:33 PM
‎2006 May 24 1:35 PM
Jak, make sure that the names of the tables are exactly the same in both programs.
REPORT ZEXPORT .
tables: kna1.
data: begin of itab occurs 0.
include structure kna1.
data: end of itab.
select * from kna1 into table itab.
if not itab is initial.
<b>EXPORT itab = itab to MEMORY ID 'mid'.</b>
IF SY-SUBRC = 0.
WRITE:/ 'EXPORTED'.
ENDIF.
endif.
REPORT ZIMPORT .
<b>data: begin of itab occurs 0.
include structure kna1.
data: end of itab.</b>
<b>IMPORT itab = itab from MEMORY ID 'mid'.</b>
loop at jtab.
write:/ jtab.
endloop.
Regards,
Rich Heilman