Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAdI implementation execution

Former Member
0 Likes
735

Hi all!

I need to know weather any code of an active BAdI implementation is executed.

Does SAP system handle such an information?

Example:

I have 2 user exits in the code and only one of them should be used at runtime.

If the first one has an active implementation AND its methods are NOT FILLED IN with executable code, the second one should be called.

I do not want to use additional parameter as a flag in the first BAdI's methods, because this may lead to errors if the user forget to set it when creating new implementation.

Thanks!

Peter

1 ACCEPTED SOLUTION
Read only

Peter_Inotai
Active Contributor
0 Likes
636

Hi Petar,

Check this great weblog about how to trace the activate badis:

/people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it

Best regards,

Peter

4 REPLIES 4
Read only

Peter_Inotai
Active Contributor
0 Likes
637

Hi Petar,

Check this great weblog about how to trace the activate badis:

/people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it

Best regards,

Peter

Read only

0 Likes
636

Thanks, Peter!

This is very useful blog, but it unfortunately does not resolve my problem.

I need to implement the check in the code. I found a table - "SXC_ATTR", that contains a list of all implementations of all the BAdIs. There is a flag weather the implementations are active or not.

But I need to know also weather any code is executed inside the method (excluding the statements METHOD.. and ENDMETHOD.).

Unfortunately I am not sure that it is possible

Best regards,

Peter

Read only

0 Likes
636

I think the best is to put a break-point inside the method and check if it's executed or not.

If you have a long list of Badis, it's quite time-consuming....also you have to make sure you have the combination of all the cases, where the method might be executed.

I'm not aware of any other way....might be that the Coverage Analyzer help you, but I'm not sure about this.

Peter

Read only

0 Likes
636

I am sorry, but this is not the solution I search for, although the information about Coverage Analyzer is interesting!

May be I was not clear enough.

I develop a program that has two user exits that should not be executed in the same time.

So I should check anyway two things:

1. weather the BAdI I defined has an active implementation.

2. weather its methods have executable code that is different from the statements METHOD and ENDMETHOD.

The easiest way is to define an output parameter that will be filled in the body of the implementation when it is executed and to check this parameter before calling the next BAdI method in the program.

BUT if the user that implements the BAdI forget to set this parameter the right way, both of the alternative methods will be executed (and I want to avoid this).

BR

Peter