Application Development 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: 

how to know if implementation with a filter value exist for a BAdI in code?

tongping
Explorer
0 Kudos

Hi all,

Scenario:

I created a BAdI. There will be a button on the UI to call its implementation(s); while if there is no implementation with specified filter value, this button needs to be hidden. Thus I need to know if the implementation exist before calling it.

Question:

In the ABAP code, how to get whether implementation with specified filter value exists for a BAdI?

If it's possible, please help provide code.

Thanks and regards,

Said

4 REPLIES 4

Former Member
0 Kudos

I dont think that it would be possible to hide some buttons of standard TR's.... Is there any specific requirement for this. if yes please explain.. or are you just playing around in SAP

0 Kudos

Hi Harmeet,

Thanks for you reply. To hide a button on UI is another issue; maybe I just disable the button.

What I'm concerned about now is how to know whether an implementation with specified filter value exists or not.

Former Member

tongping
Explorer
0 Kudos

Problem solved:

data: r_badi type ref to YOUR_BADI,
          badi_impl_num type i.

  get badi r_badi
    filters
      flt_name = fit_val.
  badi_impl_num = cl_badi_query=>number_of_implementations( badi = r_badi ).
  if badi_impl_num > 0.
    "there are badi implementation(s)
    "...
  endif.