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

Debugging the Functional Module in Background.

Former Member
0 Likes
1,022

I am calling a Custom Functional module in Background mode using the syntax CALL FUNCTION ZFM in background task.

Can anyone tell how to debug the code using this..

Thanks ,

Yatish

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
781

Hello Yatish

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 <b>SM50</b> and search for the background process.

(3) Choose from menu <i>Program/Mode -> Program -> Debugging</i>

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).

Regards

Uwe

Read only

Former Member
0 Likes
781

hi yathish.

try this... it works...

1. put the break point in the Function Module Where u want to debug.

2. run u r program. at initial stage.. press /H in then run in the debugging screen will be opened.... then in the menu bar->GOTO>CONTROL DEBUGGING-->SETTING... HERE if u click on this one nwe screen will be displayed..ther u will fing a check box called UPDATE DEBUGGING. TICK ON THIS THEN press SAVE.

2. then press F8.... when the controle reaches the breakpoin in the FM... it opens another session... where u can debugg.

<b>at last wht i mean to say is... Swith on the UPDATE DEBUGGING. put the breakpoint... then run u r code...</b>

Please Close this thread.. when u r problem is solved

Reward if Helpful

Regards

Naresh Reddy K

Read only

mudit_kapoor
Product and Topic Expert
Product and Topic Expert
0 Likes
781

Hi,

Place a breakpoint at the call of the function module. In the debugger under Settings Check the option Background Task Do not process. Now press F8 to continue the debugging. The option 'Background Task Do not process' instructs the system to collect the calls to function modules in background task but not to execute them.

In a new session, execute transaction SM58 and start debugging by selecting Edit->Debug LUW.

I hope that the above description helps you.

Regards,

Mudit