How To Debug Sap Abap Program

How To Debug Sap Abap Program Average ratng: 9,5/10 4143votes
How To Debug Sap Abap Program

Classic ABAP Debugger. You are in debug mode now. Step through SAP program. ABAP Editor Debugging. Exit program and start it again.

[Step By Step with Screenshots] Debugger is a wonderful tool used by ABAP programmers to track down an issue in a given piece of code and also to understand the logic used by other programmer in writing that program. With this tool you can display data objects and check the flow logic by executing a Program by line or by section.

Sap Abap Code

We will take you through the step by step process of how to debug a sample program in ABAP. To start, open debugger by setting break points in the ABAP editor. There are two types of break points: Session Break Point and External Break Point. Line by Line Debug. Step 1: Below I have created a sample program in the name of Zdebug. Step 2: Place the cursor on the line and Set Session Breakpoints.

Step 3: Now execute the program. Step 4: Execute Again. Step 5: Check the values in output table T_KNA1. Step 6: There are 4 different options in the debugger to execute the program. They are: F5: By using this button F5, executes our program step by step. F6: By using this button F6, executes a subroutine or function module without entering into it. F7: By using this button F7, comes out of a subroutine or function module.

F8: By using this button F8, directly executes the program, if there is more than one breakpoint then it can move one breakpoint to another.

• • • • • • • • • • • • • • • I would like to share with you my debugging tip in my daily life, which makes my life much easier. In case you found your own tip are not listed here, please kindly comment it so that it could benefit more people here 🙂 I will use a simple example to demonstrate. Input an invalid name in SE38 and click display button.

An message is displayed in the bottom. I will show you how to find the exact line of code which raises this information. Note: some of the approaches listed here might not be efficient for this very case, I just list all of my tips here for completeness.

I do believe each tip could be useful in certain case. Approach1 – Use “Where Used List” function in ABAP workbench click on the green icon and we can find message class ID: DS, number 017 SE91, use where use list: OOPS, so many hits Then I have to manually filter them one by one to find the correct one. Double click one by one. I ignore all entries with type MESSAGE E since in my case the message type is not E, but S. After one minute I confirm the following one is the one I try to find. Yes it is confirmed by debugging: Summary: the drawback of A1 is that as you see, if there are many where used list results say a hundred, it still takes you some time to manually find the correct one. Approach2 – Use Watch-point to observe sy-msgid in ABAP debugger type /h in command area, and click display button to trigger debugger.

Create a watch point with below two conditions. After that click F8, the debugger will stop automatically at the correct line you want. This approach just took me 20 seconds to finish the job. For detailed screenshot about how to create a watch point in Debugger, see picture provided by Jim Tasker: How to switch into debugging mode for a modal( pop up ) window Since the command line is not available if there is a modal( pop up window) involved, in this case please refer to SAP Note 118184 about how to switch into debugging mode or refer to this. Approach3 – Leverage the breakpoint type “ABAP Commands” to debug more efficiently Launch the debugger just the same as A2, create a dynamic breakpoint with ABAP command = MESSAGE. The debugger will again stops at the correct line. With this approach again I only spent 20 seconds.

Ubisoft Game Launcher Installer on this page. Or you can use menu via Breakpoints->Breakpoint at->Breakpoint at messages to achieve the same result. Summary: if the scenario you want to debug is quite complex, for example deep callstack with several components involved, the debugger might stops at the ABAP code with MESSAGE keyword frequently. You must still manually check whether the code is just the one you are looking for at each stop. However it is still much more efficient than you debug manually one by one.