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

kiran_k8
Active Contributor
0 Likes
1,536

Hi Folks,

Here I have a BDC program to which I need to make some changes.Even the changes are mentioned in the spec.

Can any one here please let me know how to use Debugging to come to an comfortable level of understanding what exactly a program does?

K.Kiran.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,502

Hi,

In the SE 38 Code screen first select a line where you wants to check the values using debugging . Then on the menu there is a Button for debugging. Press that. You will see that the line get Yellowish.

Then execute the program.

The cursor will stop at that line.

Then you can use F5 (single Line) or F6 or F8.

Regards,

Anji

12 REPLIES 12
Read only

Former Member
0 Likes
1,503

Hi,

In the SE 38 Code screen first select a line where you wants to check the values using debugging . Then on the menu there is a Button for debugging. Press that. You will see that the line get Yellowish.

Then execute the program.

The cursor will stop at that line.

Then you can use F5 (single Line) or F6 or F8.

Regards,

Anji

Read only

0 Likes
1,502

Folks,

I do know the basics of debugging.But I want more tips so that I can understand the difference prior and after modications.

K.Kiran

Read only

0 Likes
1,502

Hi kiran,

In debuggin mode you can use four funcation keys. F5, F6, F7, F8.

If ou have set any break-point in program then after executing the program will stop at that particular code. In case you want to go for step by step you can go for F5.

Debugging

Basic form

BREAK-POINT.

Additions:

1. ... f

2. ... AT NEXT APPLICATION STATEMENT

Effect

The BREAK-POINT is a debugging aid. When you run a program normally, it is interrupted at the statement, and the system automatically starts the debugger, allowing you to display the contents of any fields in the program and check how the program continues.

If the program is running in the background or in an update task, the system generates a Syslog message.

Note

• If a COMMIT WORK statement occurs in a SELECT loop, the database cursor is lost. This causes a runtime error in the next loop pass when the system tries to read the next line of the table.

Since debugging sometimes generates automatic COMMIT WORKs (non-production client or not debugging in debugging mode), it can be difficult to debug SELECT loops because BREAK-POINT statements within the loop can so easily lead to runtime errors.

• You can set dynamic breakpoints in the Debugger without having to change the ABAP program. Such breakpoints are only valid for the user that set them, and are deleted when the user logs off.

Addition 1

... f

Effect

If the program is not running in dialog mode (background, update task), the contents of field f are output along with the system log message.

Addition 2

... AT NEXT APPLICATION STATEMENT

Note

This addition is for internal use only.

Changes and further developments, which may be incompatible, are possible at any time, and without notice or warning.

Effect

This statement is only relevant to system programs (program attributes, status "S"), or system modules, subroutines, or function modules (names begin with "%_")

If system debugging is not switched on, the program is not interrupted until it reaches a statement that is not in a system program (or module, subroutine, or function module).

If system debugging is switched on, the program is interrupted at the statement itself.

Note

When system debugging is switched off, BREAK-POINT statements in system programs are ignored at runtime unless you use the AT NEXT APPLICATION STATEMENT addition.

Asvhender

Read only

0 Likes
1,502

HI Kiran,

There are many ways you can debug the program.

1. You can execute the program directly(Without viewing the code) by step by step in SE38 using the Debuggin Button in the tool bar.

2. If you want to check the value of the field at a particular line or view the table data you need to put a break point at the particular line in the program using the STOP button(Red button with tool tip Set/Delete break point) and execute the program.

3. You can write a statement BREAK-POINT in the code to stop the program at any particular line.

4. You can type /h at the command line to start the debug mode in SE38 after getting the selection screen.

5. After going into the debug mode, if you want to check the field value use the Field tab to view the data.

6. If you want to check the structure data or table data you can use the Structure or Table tab in the debug mode.

7. If you want to change the value of a field and check the code, type the field name in the fields list and change the value and press the button(with Pen symbol, Second one) adjacent to the field value.

8. You can use function keys for desired processing of debug mode.

Use Function Key F5 - Step by Step process

F6 - To execute Subroutines

F7 - To execute the Loops

F8 - To execute entire program

9 . You can debug the program using the user id also by putting the statement BREAK-POINT userId.

10. If you are using the above statement if will stop at that particular when you execute the program using the same user id in the BREAK-POINT statement.

You can create, view and delete all break points using the Utilities-> Break points option in the Main Menu.

Regards,

Jayaram...

Read only

Former Member
0 Likes
1,502

Hi Kiran,

Before executing the program write /h in command box then execute the program. It will take you to the debuggin mode.

Ashvender

Read only

Former Member
0 Likes
1,502
Read only

Former Member
0 Likes
1,502

Hi,

Just open your BDC transaction, then type <b>/H</b> on the command field up ( where u had entered the transaction code) then press F8 it will take you in debug mode.... then u can analyse your program.

Read only

Former Member
0 Likes
1,502

HI,

What I would suggest is, try to run the BDC in foreground and know which are all the fields that are populated and how the control is flowing from one screen to teh other.

But since you have the BDC program already developed, you cannot set the mode 'A' for foreground. So, go to your profile settings, SU3, in default parameters, enter BDC for field and value X. [ we are going to assume if BDC parameter is X it means foreground or else background. ]

Now in the line before you call, CALL TRANSACTION...., we will check for this field.

Data: ws_bdc(1) type c,

umode(1) type c.

get parameter id 'BDC' field ws_bdc.

if ws_bdc = 'X'.

umode = 'A'.

else.

umode = 'N'.

endif.

call transaction XX99 mode umode messages messtab.

This way you can execute your program in foreground and know the sequence of your program.

Regards

Subramanian

Read only

0 Likes
1,502

Subramanian,

Thanks for letting me know about SU3.SU3 in the development server has the same tab strips as you have mentioned namely default-parameters.But I didn't find the field where I have to mention BDC and value 'X'.

Kindly throw some light on the same.Did I get you correctly or am I missing something which you would have thought not worth mentioning.If so,kinldy let me know in detail.

K.Kiran.

Read only

0 Likes
1,502

Hi,

Before using this you will have to modify your existing code to capture whether it is foreground or background.

You can test it in your development server itself.

In the parameters tab, under Parameter ID press F4 and select BDC from the list and in the parameter value you can specify any value you want.

Hope this helps.

Regards

Subramanian

Read only

kiran_k8
Active Contributor
0 Likes
1,502

Got enough info,thnks