Tuesday, September 26, 2006

SAP R/3 : Debugging and using Breakpoint button...

When we do development, we put a lot of breakpoints to test our programs. Sometimes, our breakpoints is spread far from each other. Thus, its can be difficult to keep track of our breakpoints especially when you are tracing Standard Programs that might go in very deep to other include programs and function modules. However, there is one way to keep track of all your breakpoints easily; as well as putting out some breakpoints that you no longer want to use.

Here are the steps:

Step 1 : Open up one of your programs and put some breakpoints onto your desired lines to trace (shown as below).

Step 2 : Execute your program. The debugger will trace to the first breakpoint like below:

Step 3 : Click the "Breakpoints" button on top of breakpoint display:

Step 4 : A summary of all the breakpoints will be display like below:

Step 5 : To see a specific breakpoint, double click breakpoint item 1 (not on the icon stop but double click the line) and you will see your breakpoint's location:

Step 6 : You can double click the stop icon to turn off the breakpoints then click save. The next time you run again it won't stop there.

There you are i hope this will help you in your debugging work.

is sky the limit... debug... debug... debug...

Wednesday, September 06, 2006

SAP R/3 : BADI HRPAD00INFO for PA40 - Extended

note: Long entry. Please advice if there are mistakes or incorrect methods explained below. There is always room for improvement for us.

Recently, an ex-colleague asked me this question below,

"How do you find out which BADI is for which standard program? And, how do I know if that BADI is suitable to use?"
Before i moved on, in one of this portion of my answers will need to give credit to Padmini too as she improvise some of the method in searching for suitable BADI. Ok let us move on. BADI and User exits are readily provided by SAP's own respective standard module. In each of its own standard module those BADIs and User Exits are their own features and usage. Depending on how you want to use them is totally depending on your customer requirement. No point using one enhancement method when you can find it right? Probably you might need to look for alternatives. Alright, let say you have a requirement to concatenate a personal area and cost centre so it becomes the organizational key.

The first thing you should do as a technical consultant is to understand how the process flow and when will the organizational key is form. Some questions like, "Is it after i click update?", "Is it after i click create new employee", or "Is it only for display?" Some of this question may seem too trivia but it will help you along the way to implement enhancement. And another reason, a good one is, BADI and User exit normal have a PBO and PAI nature which meant event occur before or after user processes. Therefore, it is good to understand the nature of the implementation.

The second thing, assumingly you understood the nature of requirement, you need to see your options. There are a few ways, you might look up around all of the user exits. Unfortunately, it will be too long to scan. My advise here will be to get a searching program that can search for all user exits pertaining to one specific standard program. Here is one
sample. (REF #1). This should make your searching more easily. Now that you have found some candidates of user exit for your enhancement.

Go over the available user exit. There are two and one things after that to take note. The first two things is to check the export and import parameters. By checking these two important parameters you will be able to know if the user exit is capturing your data for modification and able to display it out again. Then the other will be if the user exit is callable by the event of client's requirement. If this three conditions are satisfied then you can go ahead with it.

Sometimes, one need to have a bit of creativity in using user exit. This is because an enhancement might lead to using a few user exits under one user exit project to fulfill the enhancement. Sometimes, you may use other user exit or BADI to implement a scenario

Enough about user exit, for BADI, though i have still yet to find a program that could trace for available BADI with a transaction code but all its not in vain. There are two ways to do so. One is using SQL Trace Analysis or transaction code ST05 (REF #2). The latter will be looking at the standard program and look for the BADI.

In the first way, BADI are always buffered when executed. Therefore by selecting buffer trace, it will capture all available BADIS pertaining to one transaction code. Thus, the result is shown in the analytic result pane. After that go to SE18 to see the definitions. When you are it, try to look at the types of methods available and the parameters that is passing into the BADI for enhancement as well as any available parameters that allow you to display your results.

In the latter way, i could say its more brute force, the reason i am saying that is because you look at the standard coding and try to pinch out what are the available BADI. BADI called in standard program are normally called, "CALL CUSTOMER PROGRAM". In some cases, it is more easily to note as it will be bundled in one include file along with the user exits. This no doubt make your life easy.

Now when you are ready to implement it, you can implement it in SE19.

1. SAP Professionals, Program to Find User Exit for a Transaction
2. Using SQL Buffer Trace (ST05), by Padmini Narayanan and her credible source.

Additional information : 10/12/2006 - I just found out the source which how Padmini found out the usage of ST05 - buffer analysis to find BADIs. Her source could be found in Alwin Van De Put. He had an entry of a step by step guide how to trace or search for BADIs. So this is where she learnt it from. A very good way to look for BADI.

is sky the limit... i hope this will help you guys and gals out there in the battlefield...