cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to debug a function module called in background task ?

0 Likes
15,261

I have a custom function module, which is called in during a standard process at Work Order SAVE.
The FM is called by using statement : 'Call Function <FM name> in Background task'.

To analyze the issue, I need to go inside this FM during debugging when the process is executed. I have also tried endless loops as well, the flow is stuck there but it is not visible in transaction SM50. As a result, I am not able to debug the same, and also the Order is not getting opened in Change mode.

Is there any way of doing this ?

View Entire Topic
Former Member

Hi,

Turn on the "tRFC (In Background Task): Block Sending" flag in the debugger settings

Go to SM58, select the tRFC

EDIT -> debug LUW

0 Likes

Hi,

Thanks for the response. I have already tried the same, but it didn't work in my case.
No entry present in SM58.

Process :-
Work order is created in ECC from the CRM Web UI.
And during Update process, our scenario is executed. The custom FM is called in a BADI that is executed in update task. 'Update debugging' and 'tRFC (In Background Task)' setting also didn't help us in getting into the FM.

Sandra_Rossi
Active Contributor

So, you need first to enter Update Debugging (debugger options). When you enter the update task, you need to make sure "tRFC block sending" is activated, then use SM58 and so on.

0 Likes

Hi Sandra,

Thanks for the suggestion. We have already tried both these settings : 'Update debugging' and 'tRFC block sending'.
But we still didn't get any entry in SM58.

Regards,
Tapas

Sandra_Rossi
Active Contributor
0 Likes

Maybe there's an authorization issue or a bug in the kernel? For the first case, use SU53 ou ST01; for the second one, you should check the SAP notes, and if none fits the issue, then contact the SAP support.

Sandra_Rossi
Active Contributor
0 Likes

Addendum: are you sure it's a "local" tRFC call ? Don't tell me that there's a DESTINATION defined in the CALL FUNCTION IN BACKGROUND TASK. In that case, you should check in the target system.