How To Debug The FM Which Is Called in Background Task - SAP Blogs
How To Debug The FM Which Is Called in Background Task - SAP Blogs
Follow
RSS Feed
sap
3 1 24,784
Similar Blog Posts
How to debug the FM which is called in background task Debugging Conditions upload from CRM
to ECC
James Zeng Date: 2012-06-28
By
Athreya Ramakrishna Hegde Dec 07, 2015
The real FM-AAA is ZVXX_IDOC_ASNPP, the caller program is IDOCS_OUTPUT_TO_OWN_FUNCTION for my real How to Debug a Background SAP
case. Workflow Method?
By
arghadip kar Dec 23, 2020
Related Questions
How to see the status of a FM IN
BACKGROUND TASK?
By
Former Member Feb 23, 2010
Like
RSS Feed
Solution
1. Set external breakpoint in the FM-AAA (ZVXX_IDOC_ASNPP)
2. Start program-BBB (IDOCS_OUTPUT_TO_OWN_FUNCTION) in debug.
3. When you reach the breakpoint, select menu Settings, Display/Change debugger settings, select the flag
“tRFC (In Background Task): Block Sending”. This flag means that, when the commit work occurs, the
background task (FMs + parameters) is stored into database but not executed.
4. Run the t-code SM58
5. Select the background task you just created, and choose menu edit + debug LUW, the “background task”
will start interactively and the debugger will stop at predefined points by in FM AAA automatically.
My demo example:
We use one shipment to trigger one output type ZASN to call FM-IDOC_OUTPUT_SHPMNT to create the
shipment IDoc, then based on this shipment IDoc to create the customer ASN IDOC( which will call FM-
ZVXX_IDOC_ASNPP )
Follow
Like
RSS Feed
After the ‘commit work’ statement called, the background task created in the database
Like
Then the logic will stop at the breakpoint we set in the FM- ZVXX_IDOC_ASNPP.
RSS Feed
Alert Moderator
3 Comments
Follow
June 28, 2012 at 5:59 am
Dear James,
Like
Nice Blog,it's very needful for developers.
RSS Feed
Thanks,
Syam.
Like 0 | Share
Christian Drumm
June 29, 2012 at 8:56 am
Hello James,
nice blog. This was a feature of the debugger I didn't kow so far.
However, I'm wondering why you are not simply using an external breakpoint in the FM that you want to debug. Even if the FM is called in a background task
the external breakpoint works.
Best,
Christian
Like 0 | Share
Vitor Carlessi
May 17, 2019 at 6:52 pm
Thanks
Like 0 | Share
Find us on
Privacy Terms of Use
Follow
Legal Disclosure Copyright
Like
Newsletter Support
RSS Feed