07-23-2009 8:17 AM
Hi Experts,
I Have My Internal table It_main, i want to retrive my data from other program using submit report.
how to use submit,import & export to get data from other report ?both the internal tables are same i have given
please sugest me how to use this submit, export & import in report. thanks in advance .
Regards
07-23-2009 8:23 AM
07-23-2009 8:24 AM
Hi,
Using SUBMIT program you will not be able to get any internal data of the program.
SUBMIT will just process the 2nd program. In case you use the addition EXPORTING LIST TO MEMORY then the report output will be sent to memory which you can extract making use of FM LIST_FROM_MEMORY and LIST_TO_ASCI.
What is your exact requirment?
Regards,
Ankur Parab
07-23-2009 8:25 AM
HI,
Pls find here a small piece of code...
Calling Program:
SUBMIT zdelete_delivery
WITH p_deli EQ delivery "Delivery
WITH p_item EQ item_number
AND RETURN.
Retrieve Return table from ABAP Memory
IMPORT return5 FROM MEMORY ID 'RETURN5'.
FREE MEMORY ID 'RETURN5'.
Submit program:
EXPORT return5 TO MEMORY ID 'RETURN5'.
Regards,
Aditya
07-23-2009 8:27 AM
If your requirement is just to get the data of an itab from report A to report B you dont have to use submit.
There are several ways
1. You can use import export itab (check the keyword documentation on how to use)
2. If this is a recursive requirement think about making a class and use a method to create this table by encapsulating the logic or if these reports are run subsequently you can have a ztable as a buffer.
Hope this helps you.
Rgds
Sameer.
07-23-2009 8:28 AM
Hi,
I have the same issue. I solve this way. I will call program B from program A. Now in progrma B, I will export the final table to memorry ID and use code,
if sy-tcode ne 'tcode for B',
export it_final to memorry id 'MEM'.
else.
perform go_for_display .
endif.
" thus the report will not execute when I use submit .
now in program A write import it_final from memorry id 'MEM,.
define the same structure of it_final in both the report.
Regards,
Kaushik
07-23-2009 8:32 AM
Hi,
follow the steps.
<li> In called program, you need to set like below.
<li>In calling program use below statement to execute the called program and sending itab to memory.
EXPORT it_main TO MEMORY ID 'IT_DATA'.
<li>After submit statement use IMPORT statement to get the itab data from memory.
"If variant is created for called program
SUBMIT ztest_notepad USING SELECTION-SET <varint_name>.
"OR
"If you want to pass selection-screen data of called program dynamically.
SUBMIT ztest_notepad WITH SELECTION-TABLE <itab_for_selection_scrren_of_called_program> AND RETURN.
"itab_for_selection_scrren_of_called_program type RSPARAMS
<li>Internal tables structures must be same.
Thanks
Venkat.OIMPORT it_main FROM MEMORY ID 'IT_DATA'.
07-23-2009 8:41 AM
Hi,
REPORT REP1 NO STANDARD PAGE HEADING.
DATA: ITAB TYPE I OCCURS 10,
NUM TYPE I.
SUBMIT REP2 AND RETURN.
IMPORT ITAB FROM MEMORY ID 'HK'.
LOOP AT ITAB INTO NUM.
WRITE / NUM.
ENDLOOP.
TOP-OF-PAGE.
WRITE 'Report 1'.
ULINE.
This program calls the following executable program (report):
REPORT REP2 NO STANDARD PAGE HEADING.
DATA: NUMBER TYPE I,
ITAB TYPE I OCCURS 10.
SET PF-STATUS 'MYBACK'.
DO 5 TIMES.
NUMBER = SY-INDEX.
APPEND NUMBER TO ITAB.
WRITE / NUMBER.
ENDDO.
TOP-OF-PAGE.
WRITE 'Report 2'.
ULINE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'MBCK'.
EXPORT ITAB TO MEMORY ID 'HK'.
LEAVE.
ENDCASE.
=============================================================
SYNTAX ;SUBMIT... [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>].