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

bdc

Former Member
0 Likes
569

how can we debug a bdc which is running in bachground

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

Hi

How do I debug background Processes?

In transaction SM50 (process overview), you can select a background process and choose Program/Mode -> Program -> Debugging from the menu.

An alternative workaround, which allows you to step into a particular piece of code is to place a piece of code in a endless DO-ENDDO, where you can change a variable to step out of the DO at a particular point in your code. This allows you to hold the process at that point and debug it from SM50 as described above. An implementation of this exists in function module C160_HOLD_FOR_DEBUG, which will enter the endless loop if a particular environment variable is set, thereby allowing you to control its behaviour. (Further instructions are found in the comments in subroutine INC14Z_HOLD_FOR_DEBUG of include LC14ZFCB).

How do I debug completed background process?

You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.

Use SM37 to get list of jobs , type 'JDBG' in the command line ( no '/' ), put the cursor on the job and press ENTER

You are in debug mode now. Step through SAP program (press F7 couple of times) until you get to code you need.

How do I debug remote function calls?

You can use the same techniques as described in How do I debug background Processes? above.

How do I debug Updates/System code?

Both options are available from the menu in debugging. Choose Settings -> System/Update Debugging to activate either before proceeding.

Why does it give a dump when I put a break-point in between SELECT and ENDSELECT?

A breakpoint in SELECT loops can cause an exception through loss of the database cursor. The reason for this is that during debugging a database commit is triggered and hence the cursor is lost.

How do I set breakpoints in modal dialogs?

There are two similar approaches to set breakpoints in modal dialogs:

Approach 1:

Click on the Create shortcut icon on the toolbar.

In the popup window choose "System command" and in the command enter "/h"

A shortcut on the desktop would be created

Drag and drop the shortcut to the modal window to set debugging on.

Approach 2:

Create a txt file on the desktop with the following lines:

[FUNCTION]

Command=/H

Title=Debugger

Type=SystemCommandDrag and drop this file to the modal window to set debugging on.

How do I switch between the Classic and New Debugger

From within the ABAP workbench, select the Utilities->Settings Menu

Select the ABAP Editor Tab

Select the Debugging tab within the ABAP Editor Tab

Select the Classic Debugger or New Debugger radio button

Reward points if useful

Regards

Anji

4 REPLIES 4
Read only

Former Member
0 Likes
532

Hi

How do I debug background Processes?

In transaction SM50 (process overview), you can select a background process and choose Program/Mode -> Program -> Debugging from the menu.

An alternative workaround, which allows you to step into a particular piece of code is to place a piece of code in a endless DO-ENDDO, where you can change a variable to step out of the DO at a particular point in your code. This allows you to hold the process at that point and debug it from SM50 as described above. An implementation of this exists in function module C160_HOLD_FOR_DEBUG, which will enter the endless loop if a particular environment variable is set, thereby allowing you to control its behaviour. (Further instructions are found in the comments in subroutine INC14Z_HOLD_FOR_DEBUG of include LC14ZFCB).

How do I debug completed background process?

You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.

Use SM37 to get list of jobs , type 'JDBG' in the command line ( no '/' ), put the cursor on the job and press ENTER

You are in debug mode now. Step through SAP program (press F7 couple of times) until you get to code you need.

How do I debug remote function calls?

You can use the same techniques as described in How do I debug background Processes? above.

How do I debug Updates/System code?

Both options are available from the menu in debugging. Choose Settings -> System/Update Debugging to activate either before proceeding.

Why does it give a dump when I put a break-point in between SELECT and ENDSELECT?

A breakpoint in SELECT loops can cause an exception through loss of the database cursor. The reason for this is that during debugging a database commit is triggered and hence the cursor is lost.

How do I set breakpoints in modal dialogs?

There are two similar approaches to set breakpoints in modal dialogs:

Approach 1:

Click on the Create shortcut icon on the toolbar.

In the popup window choose "System command" and in the command enter "/h"

A shortcut on the desktop would be created

Drag and drop the shortcut to the modal window to set debugging on.

Approach 2:

Create a txt file on the desktop with the following lines:

[FUNCTION]

Command=/H

Title=Debugger

Type=SystemCommandDrag and drop this file to the modal window to set debugging on.

How do I switch between the Classic and New Debugger

From within the ABAP workbench, select the Utilities->Settings Menu

Select the ABAP Editor Tab

Select the Debugging tab within the ABAP Editor Tab

Select the Classic Debugger or New Debugger radio button

Reward points if useful

Regards

Anji

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
531

Hi

It will save the all records in to the corresponding tables.

If any error is there it will stop the execution when u use the calltransaction that is if u provide the mode as 'Error mode'.

In case of session method it will continue the execution and if any error is there it will store it in logmode.

Regards,

Sree

Read only

Former Member
0 Likes
531

there is no debugging concept for any background jobs ..... ...

only foreground will have navigation ..... so it can be debugged ....

if want to seee it ... then after selecting the session in SM35 .... ...selecting the PROCESS in the POP AS backgrond ... there is screen debugging program .. which you have to create one note pad file in you destop ....

after seleting the process as background drag & drop that text fiel from the desktop to this screen .... your process will be strated debugging mode ... then press proocess ok ...

it will take you in debug mode ....

the below code should be in the txt file inyour desktop ....... remember drag & drop this file don't open ... it will take you in debugg mode ....

[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand

Girish

Read only

Former Member
0 Likes
531

s i got my solution,thanks for tghe help