Problem solve Get help with specific problems with your technologies, process and projects.

Further tip on the BREAK macro

When I am doing serious development that requires some break points, I put a parameter in the selection screen:

I have been around for a while, and seeing a recent tip on the 
BREAK macro made me realize that there are a lot of folks who are
still learning this ABAP language.


When I am doing serious development that requires some break points, 
I put a parameter in the selection screen:

parameters:  p_brk as checkbox default 'X'.

Then where I may want to break, I put the code:

if not p_brk is initial.  
  break my_user_name.
endif.

Now, if I hit a break point & have many iterations of a loop process, 
I can set a breakpoint outside that process & then use the debugger to
modify p_brk so I don't have to break any more during that loop processing.
The break point I set outside the loop process will allow me to modify 
p_brk again to activate it.


Remember, though:  It is a good practice to remove all break points
& break macros before transporting to a test or production system. 
That would include removing the parameter definition of this field.
  

Just in case, though, you may need to have this capability in a test
or production environment.  You can make this parameter invisible, 
so no one else would ever see it on the seleciton screen!  
You can then code in some logic to determine when it is active, 
looking at SY-SYSID & SY-MANDT along with the parameter itself...
 
Hope this helps someone a bit!


Peace! 

 Parameters:  P_BRK.
.
.
.
if not P_BRK is initial.
  break USERNAME.
endif.
.
.
.
if     SY-SYSID = 'DEV' and
   not P_BRK    is initial.
  break USERNAME.
endif.
		
This was last published in December 2001

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close