Set a break point in LSMW to use SAP's debugger.

Jimbo's picture

Sometimes problems in source code are too complicated to resolve without stepping through the code while it is executing. Adding a break point to the ABAP code in LSMW is easy and provides an invaluable way to debug complicated problems.

Usually, all ABAP programming occurs in a development system with the expectation that it will first be tested in a quality assurance system and then transported to the production system. Having to add the break point to the source code before exporting, importing and debugging and then having to remove it again takes up valuable time and slows down the development process. A simple way to turn it on and off in the source code as desired is by using a parameter. A parameter is an interactive element that the user fills out (or checks) before the rest of the code runs. When passing LSMW objects to other team members it is best to describe the parameters with comments.

Add a parameter to the Gloable Definitions section. This creates a parameter that can be checked when debugging is desired. It is not checked by default.

parameters: p_Break as checkbox.

Now add a line of code to the field that needs accute attention. This line will cause the debugger to launch when the p_Break checkbox is checked.

if p_break eq 'X'. break-point. endif.

Now all of the features of the debugger are made available. This makes easy work of problems that might take days to resolve.
Add a break point in LSMW object using ABAP.

Programming Language: 
ABAP