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

Filter Dependent BAdI

Former Member
0 Likes
1,120

Assume I have implemented the following BAdI:

BBP_DOC_SAVE_BADI

Furthermore, assume I have defined a single filter value: BUS2200

Does this mean that my BAdI implementation will be called ONLY

when the filter value is BUS2200.

Is it possible that the implementation will be called for other

filters like BUS2121 and BUS2201?

The reason I ask is this:

Do I have to check the filter value in my implementation to make sure

it is being called for BUS2200? If so, what's the purpose of defining

the filter value in the BAdI implementation?

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
916

Do I have to check the filter value in my implementation to make sure

it is being called for BUS2200? If so, what's the purpose of defining

the filter value in the BAdI implementation?

In the filter you need to specify the variable which contains the desired value.

Like:


W_BO_TYPE = 'BUS2201'.
GET BADI badi_inst 
              FILTERS bo_type = W_BO_TYPE.

This code will not get any instance of the BADI as you don't have the implementation for this BUS2201. If your variable W_BO_TYPE contains the value BUS2200 than you would get the BADI instance which contains your implementation.

Regards,

Naimesh Patel

Assume I have implemented the following BAdI:

BBP_DOC_SAVE_BADI

Furthermore, assume I have defined a single filter value: BUS2200

Does this mean that my BAdI implementation will be called ONLY

when the filter value is BUS2200.

Is it possible that the implementation will be called for other

filters like BUS2121 and BUS2201?

The reason I ask is this:

Do I have to check the filter value in my implementation to make sure

it is being called for BUS2200? If so, what's the purpose of defining

the filter value in the BAdI implementation?

4 REPLIES 4
Read only

Former Member
0 Likes
916

Hi,

all the Badi implementations are stored in table SXC_ATTR with active = 'X".

and if the badi has filters are not you can check in table SXC_EXIT where IMP_NAME = 'BADi implemationname"

and EXIT_NAME = BADI name

and FLT_VAL = filter value assgined for the field

Prabhudas

Read only

naimesh_patel
Active Contributor
0 Likes
917

Do I have to check the filter value in my implementation to make sure

it is being called for BUS2200? If so, what's the purpose of defining

the filter value in the BAdI implementation?

In the filter you need to specify the variable which contains the desired value.

Like:


W_BO_TYPE = 'BUS2201'.
GET BADI badi_inst 
              FILTERS bo_type = W_BO_TYPE.

This code will not get any instance of the BADI as you don't have the implementation for this BUS2201. If your variable W_BO_TYPE contains the value BUS2200 than you would get the BADI instance which contains your implementation.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
916

Gregory

There is no need to check for the Filter Value at the method level. Since you are implementing BADI based on Filter Value, each unique implementation will be called by the Runtime based on the Filter Value.

Refer [Filter Dependent BADI|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm]

Read only

andrea_olivieri
Contributor
916

Hi,

Business Add-Ins may be implemented depending on a specific filter value. Thus Distinct implementations can then be created and activated according to the specified filter value.

In general, if each filter value corresponds to a separate implementation, within the single methods is not necessary to test the values of the filter.

If the definition BADI also has the characteristic of Multiple Use, then it is also possible to create a single implementation valid for multiple filter values. So, in this case in the method implementation may be necessary to test the filter values.

Kind Regards.

Andrea