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

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

tongping
Explorer
0 Likes
839

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

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
Read only

Former Member
0 Likes
741

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

Read only

0 Likes
741

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.

Read only

Former Member
Read only

tongping
Explorer
0 Likes
741

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.