cancel
Showing results for 
Search instead for 
Did you mean: 

Badis

Former Member
0 Kudos

Hi guru's.

can any one explain what is

Filter dependent badi

multiple reuse(means how we reuse the badi multiple times).

plzz any body can explain this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Satish,

If a BADI says it can be multiple reused, it means they can be many implementations of the same BADI multiple number of times.

Say you implement a BADI with ZBADI. We can also implement that BADI another time say ZZBADI with an altogether different code in it and both the BADI's will be executed when you are running that transaction.

Thanks

Aneesh.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Filter dependence for BADI definitions means that each interface method automatically has an importing parameter FLT_VAL assigned ot it. This parameter must be filled with a filter value as current parameter when it is called.

A BADI definition should be marked as filter-dependent whenever the characteristic of the BADI implementation should match the characteristics of the filter type - that is, whenever the implementation of different filter values should be different or should only exist at all for certain filter values.

Typical filter types are line of industry or country.

Steps to be followed for setting a filter to BADI:

just go to se18 and give ur BADI name..

then Select 'Attributes' Tab ,there u will find option Filter-Dependent in window named "type"..

check tht filter dependent checkbox and give ur data element/field in the Filter type field say u can give 'MOLGA' ..save and come back..

now go to se19 and implement this BADi and there u can give filter values for filed MOLGA..

i hope this will help..

Reward points if found helpful.....

Cheers,

Chandra Sekhar.

Former Member
0 Kudos

Hiii

Implementing a Classic BAdI

A list of the classic Business Add-Ins available in your system can be found either in the SAP Reference Implementation Guide (IMG) or in the component hierarchy. BAdI definitions are included in the IMG so that the customer/partner can create suitable, company-specific implementations.

In the SAP Reference IMG, BAdI implementations - in addition to BAdI definitions - can be provided. This would be suitable in cases where you can see in advance which functions are required by the customer. Using a BAdI implementation, the customer/partner can simply switch the delivered implementations on or off, as required. In the SAP Reference IMG, choose Execute in front of the name of the BAdI implementation. The icon serves as a switch for activating and deactivating the implementation.

Starting from the name and the documentation of the enhancement, you can create an implementation. During the implementation, the system creates a class that implements the enhancement’s interface. The implementation is a separate transport object and lies within the namespace of the person or organization implementing it.

For the example given here, you are to create an implementation for the string conversion. You need to program the interface method in such a way that, when the add-in is called from the application program, the string is actually converted in the way the add-in user wants it.

To create an implementation, proceed as follows:

...

1. In the SAP menu, choose ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE19) or double-click the corresponding activity in the Implementation Guide (IMG).

2. Enter a name for the implementation and then click the Create pushbutton.

3. Enter the name of the add-in you want to create an implementation for in the dialog box that appears.

4. Enter a short text describing your implementation on the following screen.

5. Choose the Interface tab.

6. Choose ABAP Code as the implementation type.

Besides ABAP Code, there is also the Formula option. If you choose Formula, the content of a method is determined using the Formula Builder. For more information on this, refer to the section Implementing Methods Using the Formula Builder.

7. Navigate to the Class Builder by double-clicking the method. You must first enter a package before the Class Builder is displayed.

8. Insert the desired source code for the implementation between the method if_ex_businessaddin~method. and endmethod.statements that already exist.

Relating to our example, you could enter the statement translate parameter to upper case.

9. Save your entries and return to the Change Implementation screen.

10. Choose Activate. You may now use this implementation when the application program is executed.

Several implementations may exist for a Business Add-In that is not used on a multiple basis. However, only one implementation can be active at any one time.

What is also important is that you must declare the instance generation of the implementing class (Attributes tab) as public and not as private, protected, or even abstract. If you do this, the system will return short dumps at runtime.

Definition of a Filter-Dependent Classic BAdI

To define a filter-dependent Business Add-In, first create the definition of the Business Add-In and select the Filter-dependent checkbox.

Enter the data element you want as a filter type or select a filter type using the input help.

A filter type can be a data element or a structure. A data element must fulfill the following criteria:

• The data element's domain may contain a maximum of 30 characters and must be of the type Character.

• Either the data element has a search help with a search help parameter of the same type as the data element, and this parameter must serve as both the import and export parameter, or the domain has fixed domain values or a value table containing a column with the same type as the data element.

If necessary, you can create such a data element yourself.

If you want to call the implementation of a Business Add-In to depend not only on a filter value but on various values, you can enter the name of a structure in the FilterType field. The structure can consist of several data elements that fulfill the above conditions for data elements. The structure must not be longer than 80 characters.

You can use different elements as filter types, for example: a country, a material, an object type, an internal parameter, and so on. This also applies to structures.

Now create an interface with methods Remember that for each method you create in the interface of a filter-dependent enhancement, the filter value must be defined as the importing parameter so that the application program can provide the filter value to the enhancement method. The method then selects the active implementation for that value.

The filter value is always declared using the parameter flt_val and is predefined in the list of parameters.

reward points

if useful

regards

Jaipal