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 RFC enabled FM IN BACKGROUND TASK

Former Member
0 Likes
2,005

Hi Frnds,

I have a requirement where in I need to call a FM which executes 'VA02' BDC in some user exit.

Since this has to be executed after the commit work is executed in the calling program i am using the background mode.

something like below,

CALL FUNCTION 'Z_SD_AVAILABILITY_CHECK_BDC'

IN BACKGROUND TASK

DESTINATION 'NONE'

TABLES

t_vbap = xvbap.

This above FM is RFC enabled.

And this FM is also called successfully and VA02 is executed without any error. But the FM's session does not get killed after its executed completly. Instead it creates another session of the same FM and executes the BDC again. This is goion on and on and multiple sessions are created at the end.

Am I missing something here? Do I have to include the Performing RETURN_INFO ON END OF TASK also?

Please give ur suggestions.

regards,

Karthick C

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,127

Hi,

Check the SM58 to see how many calls are there. It might be that the function is called multiple times every time the user exit is triggered. So put a break point in the user exit and check that the function is actually only called once per transaction.

As the SAP help says that the calls are stored in the tables ARFCSSTATE and ARFCSDATA, it might be worth checking the entries of this table for the function calls before the transaction commit work is executed. See [here|http://help.sap.com/saphelp_nw04/helpdata/en/8e/d05f3ce4dd3370e10000000a114084/frameset.htm]

regards,

Advait

Edited by: Advait Gode on Jun 22, 2009 11:19 PM

3 REPLIES 3
Read only

Former Member
0 Likes
1,128

Hi,

Check the SM58 to see how many calls are there. It might be that the function is called multiple times every time the user exit is triggered. So put a break point in the user exit and check that the function is actually only called once per transaction.

As the SAP help says that the calls are stored in the tables ARFCSSTATE and ARFCSDATA, it might be worth checking the entries of this table for the function calls before the transaction commit work is executed. See [here|http://help.sap.com/saphelp_nw04/helpdata/en/8e/d05f3ce4dd3370e10000000a114084/frameset.htm]

regards,

Advait

Edited by: Advait Gode on Jun 22, 2009 11:19 PM

Read only

Former Member
0 Likes
1,127

Hi Karthick

Was your BDC a call transaction or session method ?

Read only

0 Likes
1,127

hi

I have a requirement same as Karthick C except that instead of VA01 i have QM01 tcocde

Bt notification is not getting created if I use Call FM in background task

Pls help