August 8, 2015

Find User-Exits and BAdIs in ABAP. Part 2

In the first post I gave a brief introduction of what are user-exits and BAdIs and what are for. This time I'm going to dive a little deeper on this issue.

As I wrote before when SAP is implemented in a company, it is often customized according to the business rules and procedures. This customizations consist in modifying the behaviour of transactions, change calculations, change screens and also adding or hiding data. SAP provides areas where the implementers can make this adjustments and prepare the system to work as the business requires.

I can tell only on my experience but as far as I'm concerned, SAP provides the best practices for the business, so, it is a great opportunity for the company to follow this work methodolgy. That is why SAP is very specialized tool and needs experienced functional users to manage this situations.

There are other configurations that can be made that are not necessarily user-exits or BAdIs, for example, it is possible to re-arrange screens and create code specifically address to a field or procedure. This configurations can be made through transaction 'OMT3B' in the case of material master data screen in the Retail version. This kind of configurations are beyond the scope of this post, however if you need more information you can go to SAP for more information.

One thing before I continue; in the big picture, every standard modification is known as user-exit, so to say, a screen-exit, BTE, VFOM and a BAdI all are considered as it.

Ok, once it is identified the transactions and programs to be enhanced it is necessary to look for those user-exits and/or BAdIs. So, how do we find them?

Well, there are some transactions and techniques that can help, I personally use three ways and it depends what I'm trying to do:

For the first option is necessary to identify the package of the programs using transaction 'SE93' or in the menu System / Status.

Transaction 'SE93' is used to create/modify/display transactions in SAP and provides among other information the name of the program and package it belongs, the same for the menu option.

1. Execute transaction 'SE93', type in transaction code the value 'MM01' and then click the button 'Display'.

2. Copy the package name.


3. Execute transaction 'SMOD'.

4. Click on text box 'Enhancement' and press key 'F4'.

5. Click button 'Information System' and then paste the package name in the text box 'Package'.


6. Finally press 'Enter' and it will appear the list of user-exits of that package.

To find BAdIs is a little more tricky because you need to debug the program or transaction. Follow the following instructions:

1. Execute transaction 'SE24'.

2. Type in the text box 'Object type' the class name 'CL_EXITHANDLER' and then click button 'Display'.


3. Double click the method 'GET_INSTANCE'.


4. Set a break point after 'get_class_name_by_interface'. The 'class_name' parameter is the value we are interested in.


5. Now, open another session and execute the transaction you want to be analyzed. If there's a BAdI then a debugging window will rise up in the breakpoint you set in the latter step.

6. Check the 'class name'. Then press F8 and when pauses in the same breakpoint then there it is another BAdI and then successively.

Fortunately you don't have to set the breakpoint in the 'CL_EXITHANDLER' at the beginning of a transaction, you can make it at any moment, for example, when clicking to save in a transaction.

Both techniques are good and practical however, there's an another even more practical way and is quicker than the other ones. There are several free abap code in the internet that you can use to find both user-exits and BAdIs.

You can find a very good one here. http://wiki.scn.sap.com/wiki/display/Snippets/Find+User-exits,+BADIs,+BTEs,+Etc+by+TCode+or+Program

As a side note, I know is faster to use the ABAP program however, it is necessary to learn to find these enhancements using the first two options because sometimes these programs can't see all these exits, so make your homework to be sure.

On the next post I'll show how to implement a user-exit.

Hope it helps.
Please Share it! :)

No comments :

Post a Comment