05-30-2007 12:17 PM
hi,
I have a scenario like i have to call another secondary program from main program and when the control returns from that secondary i need some which has to carried from there back to main program. how to achive this i tried with <b>SUBMIT </b> command but i am unable to get the data or do i need to use,<b>EXPORT and IMPORT</b>, please help me.
regards
prabhu
05-30-2007 12:25 PM
Hi prabhu,
Yes you are right, you can use EXPORT & IMPORT to transfer data from calling program to called program & vice-versa...
Regards
Rengaraj
05-30-2007 12:23 PM
Hi,
You use Submit to call an ABAP report from within another report.
For example:
submit 'ZREPORT1' using pernr = g_pernr
exporting list to memory
and return.
In this case we are submitting the report ZREPORT1, passing the parameter pernr a value of g_pernr (from the calling program) sending the output list to ABAP memory, and returning to the calling program.
You can retrieve the list using the function module LIST_FROM_MEMORY.
05-30-2007 12:25 PM
Hi prabhu,
Yes you are right, you can use EXPORT & IMPORT to transfer data from calling program to called program & vice-versa...
Regards
Rengaraj
05-30-2007 12:34 PM
Hi Prabhu,
<u><b>Calling program</b></u>
SUBMIT <prog> AND RETURN.
IMPORT TEXT3 FROM MEMORY ID 'text'.
WRITE: / SY-SUBRC, TEXT3.
IMPORT itab TO jtab FROM MEMORY ID 'table'.
WRITE: / SY-SUBRC, TEXT1.
<u><b>Called Program</b></u>
EXPORT TEXT1
TEXT2 FROM 'Literal'
TO MEMORY ID 'text'.
EXPORT ITAB
TO MEMORY ID 'table'.
Regards
Indrajit.
05-30-2007 12:40 PM
05-30-2007 12:44 PM
Hi,
U have one option in SUBMIT which is EXPORTING LIST TO MEMORY.
This addition stores the basic list for the program accessed in the ABAP Memory. It can only be used together with the addition AND RETURN.
The list is stored in the ABAP Memory as an internal table of the row type ABAPLIST, ABAPLIST being a structured data type in the ABAP Dictionary.
The calling program can access the list stored once program access is completed, using function modules belonging to the function group SLST.
The function module LIST_FROM_MEMORY loads the list from the ABAP Memory to an internal table of the row type ABAPLIST.
The function module WRITE_LIST inserts the content of an internal table of the row type ABAPLIST in the current list.
The function module DISPLAY_LIST displays the content of an internal table of the row type ABAPLIST in a separate list screen.
e.g:
Once the program report has been accessed, the list stored there in the ABAP Memory is read by means of function modules and inserted in the current list.
DATA list_tab TYPE TABLE OF abaplist.
SUBMIT report EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
Thanks & Regards
Santhosh
05-30-2007 1:11 PM
could u please specify the name of the secondary program u r trying to call from ur program...