Application Development and Automation 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: 
Read only

Calling an FM in Background Task

Former Member
0 Likes
611

Hi Experts,

I am calling an RFC Function module in Background Task. I need to capture the return table of this FM. Since i call in background task am unable to capture the return table. Can you provide any other appropriate solution where i can make use of the return table paramters from the FM?

Pls Help.

Regards

Ramanan RS

3 REPLIES 3
Read only

LucianoBentiveg
Active Contributor
0 Likes
563

You can save records into a DB table.

Read only

Former Member
0 Likes
563

Create A DB dtab table with table with components of the return table of the function module.

After the function module completes successfully.

Add code to

Loop after the return table of the FUN module

itab--> internal table

istr line of itab

loop at itab into istruc

append istruc to dtab.

if sy-subrc <>0

error.

ENDLOOP

Edited by: Vighneswaran CE on Nov 29, 2010 2:23 PM

Read only

Former Member
0 Likes
563

Hi,

Are you using a "starting new task" approach??

If this is the case, have you tried the addition "PERFORMING ..... ON END OF TASK"??

You most declare a routine as follows


form process_results.
......
.....

RECEIVE RESULTS FROM 'FUNCTION_MODULE'.

.....
....

endform.

Doing this, your calls to the FUNCTION_MODULE may look like this:


Call function 'FUNCTION_MODULE' starting new task g_taskname
destination in group g_group
performing process_results on end of task
.....
....

With this you can process the return table.

I hope this may help you.