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: 

How to transfer data to a function module which is being execu in backgroun

MNaveen
Employee
Employee
0 Kudos

Hello all,

In my requirement in a function module FM1 i am submitting a report to be executed in background. Inside this report there is a call to another function module FM2. Now the data for the importing parameters for function module FM2 are known to me before submitting the report to execute in background in FM1 but how do i pass this to the report when i submit it so that it can be used in the FM2 which is called in the report.

The parameters that i am passing is a table and a structure.

Can you please give the code which can do this.

Warm Regards,

Naveen M

1 ACCEPTED SOLUTION

venkat_o
Active Contributor
0 Kudos

Hi Naveen, Use EXPORT/IMPORT statements to pass data between two internal sessions. <li>In FM1 use EXPORT to transfer itab/structure data like below

EXPORT itab TO MEMORY ID 'TAB1'.
<li>In Called program use IMPORT to retrieve itab/structure data like below
IMPORT itab FROM MEMORY ID 'TAB1'.
<li>Structures should be the same in both places. Thanks Venkat.O

5 REPLIES 5

venkat_o
Active Contributor
0 Kudos

Hi Naveen, Use EXPORT/IMPORT statements to pass data between two internal sessions. <li>In FM1 use EXPORT to transfer itab/structure data like below

EXPORT itab TO MEMORY ID 'TAB1'.
<li>In Called program use IMPORT to retrieve itab/structure data like below
IMPORT itab FROM MEMORY ID 'TAB1'.
<li>Structures should be the same in both places. Thanks Venkat.O

0 Kudos

Hello Venkat,

I tried with import and export parameters. But it dint work. Before i scheduled the report in background i exported the data in then submitted the report to execute in background. Inside the report used import but the data was not imported from the memory id.

Can anyone tell any means of fullfilling this requirement.

Warm Regards,

Naveen M

kiran_k8
Active Contributor
0 Kudos

Naveen,

Memory ID will not hold the values if the process goes thorugh different sessions.So,check in the debugging mode if the memory id is actually holding the value or not.If it is not holding then you create a ztable and capture the data in it.For further processing fetch the data from this ztable.

To check whether the memory id is actually holding the values or not you can check as below

In the debugging mode GOTO >>SYSTEM AREAS >> ABAP MEMORY/SAP MEMORY

K.Kiran.

former_member218674
Contributor
0 Kudos

Hello Naveen,

There is no difference to pass parameters to function module in foreground or background. You can pass them as the normal way you do.

Thanks,

Augustin.

former_member218674
Contributor
0 Kudos

Hello Naveen,

There is no difference to pass parameters to function module in foreground or background. You can pass them as the normal way you do.

Thanks,

Augustin.