‎2007 Jun 19 7:28 AM
Hi Experts,
I am calling a function module in my ABAP code in background module using the following syntax:
CALL FUNCTION 'YBBC2_CREATE_SNAPSHOT' IN BACKGROUND TASK
TABLES
itab_std_format_inv = itab_std_format_inv
itab_snapshot_inv = itab_snapshot_inv.
COMMIT WORK.
If I put the breakpoint in the CALL FUNCTION line and execute the program, the debugger does not take me to the valled function module. This may be because I am running the function module as background task.
I cannot comment this "IN BACKGROUND TASK" statement as well since i am debugging in Quality system where I don't have change access.
So how to DEBUG a function module running in background mode? Please help!
Thanks
Gopal
‎2007 Jun 19 7:33 AM
Hi,
You could try to use the following trick:
(1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
DATA:
lx_exit_loop(1) TYPE c.
lx_exit_loop = ' '.
DO.
IF ( lx_exit_loop = 'X' ).
EXIT.
ENDIF.
ENDDO.
(2) Call your function module in background task
(3) Call transaction SM50 and search for the background process.
(3) Choose from menu Program/Mode -> Program -> Debugging
Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
<b>Reward points</b>
Regards
‎2007 Jun 19 7:36 AM
Hi SKK,
I cannot change any code since I am not debuging in development system.
For a particular case I have to use Quality system for debuging.
‎2007 Jun 19 7:35 AM
hi,
BACKGROND PROGRAMS:you can debug the background jobs, use the command BDUG
One way of debuging programs which are already running in background is via transaction SM50. This displays a
list of process running in the server. In order to debug the program go to Menu option:
Program/Mode>Program>Debugging.
Rgds
Anversha
‎2007 Jun 19 7:58 AM
Hi Anversha s
I did not understood your answer.
I am not using a ABP program in background mode but the function module inside the ABAP program in called in background task.
I want to put a breakpoint inside this function module so that I can debug it. But it some does not work. The debugger does not go to the function module.
What shall I do? Kindly help me!
Thanks
Gopal
‎2007 Jun 19 7:41 AM
Hi,
When you debug a program that calls function modules using the IN BACKGROUND TASK addition, they are processed in a background work process (additional internal session). If you set the In background task: Do not process option, the system collects the function calls, but does not start the background work process. The Debugger assigns a transaction ID, which identifies the background work process uniquely. You can now start the Debugger for the background work process using transaction SM58. You can select the function module concerned here, and then execute it via the Edit menu.
Regards
Sudheer
‎2007 Jun 19 8:02 AM
Hi Sudheer,
Where do we set "In background task: Do not process option"?
Can you kindly explain this? I am a novice in this.
Thanks for your aswer
Gopal