Application Development 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: 

calling other program

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi prabhu,

Yes you are right, you can use EXPORT & IMPORT to transfer data from calling program to called program & vice-versa...

Regards

Rengaraj

6 REPLIES 6

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi prabhu,

Yes you are right, you can use EXPORT & IMPORT to transfer data from calling program to called program & vice-versa...

Regards

Rengaraj

Former Member
0 Kudos

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.

0 Kudos

hi,

the called program is a SAP standard program.

regards

prabhu

Former Member
0 Kudos

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

Former Member
0 Kudos

could u please specify the name of the secondary program u r trying to call from ur program...