Entering content frameProcedure documentation Defining Business Add-Ins Locate the document in its SAP Library structure

In order for application developers to include Business Add-Ins in their programs, they must define an interface for the enhancement in the SAP menu under Tools ® ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE18) and call this interface at the appropriate point in their application program. Customers can then select the add-in and implement it according to their needs.

Example:

You want to be able to convert strings in your application program. You also want users to determine how their strings are converted themselves. As the application developer, you define an enhancement consisting of an interface with a method. A changing parameter is used to transfer strings.

To create an add-in like this, proceed as follows:

  1. Choose Tools ® ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE18) from the SAP menu.
  2. This graphic is explained in the accompanying text

  3. Enter a name for your Business Add-In containing a maximum of 20 characters.
  4. Choose Create.
  5. On the subsequent screen, enter a short description for your Business Add-In.
  6. Note

    The option SAP internal is used when a developer at SAP provides a business add-in with implementations. If this flag is set, customers cannot create and use their own implementations for this business add-in. The possible entries help does not display business add-ins carrying this flag.

    If this enhancement is going to be used multiple times or if you want its implementation to depend on a specific filter value, select the appropriate checkbox in the category Type. More information about multiple use and filter dependency can be found in the sections Multiple Use Business Add-Ins and Filter-Dependent Business Add-Ins .
    This example only deals with basic enhancements, therefore neither of these checkboxes should be selected.

  7. Choose the Interface tab.
    The name of the interface, which is generated automatically, now appears. At this time, you can change the name of the interface if you so desire.
  8. This graphic is explained in the accompanying text

    Note

    On the Fcodes tab you can create menu enhancements. For information on this, see Menu Enhancements.

    On the Subscreens tab you can define screen enhancements. For information on this, see Screen Enhancements.

  9. Double-click on the interface's name field. The system branches to the Class Builder.
  10. Confirm that you want to save the entries you have made. Assign your add-in to a package.
  11. Use the Class Builder to assign a method to the interface.
  12. This graphic is explained in the accompanying text

  13. Now define a parameter with the following attributes:
  14. This graphic is explained in the accompanying text

  15. Save and activate your changes. Use the pushbutton Back to navigate back to Business Add-In definition.
  16. Caution

    If you do not activate your attributes in the Class Builder, the system will not allow you to proceed with Business Add-In definition.

    A table control now appears on the definition screen containing the method you have assigned to the interface.

    Note

    Whenever you assign a method to an interface, the corresponding executing class is generated. The code generated cannot be altered in the initial expansion phase.

  17. Save your entries and use the Def.-Docu. pushbutton to create a description for your new Business Add-In. Be aware that this documentation is of great importance in helping end users understand the purpose of your add-in.

Caution

Changes made to the interface and changes made to the Business-Add-In definition are always incompatible!

If implementations already exist for a Business-Add-In definition, they are invalidated if you make changes to the interface. This means that their syntax is no longer correct. No statements can be given on the runtime behavior. Try to absolutely avoid making changes to the interface or the Business-Add-In definition after the transport has taken place.

If changes to the interface are inevitable, clean up the method includes for all implementing classes, that is, all classes for which Business-Add-In implementations are used. To do this, in the Class Builder (using transaction SE19, tab Interface, field Name of implementing class) choose Utilities ® Clean up ® Method includes.

Default and Sample Code

In the BAdI Builder, you can choose the Goto menu entry to create, display, change and delete default or sample code.

The default implementation is only executed if no other active implementation is available. This applies also to filter-dependent Business Add-Ins.

Note

When you create default or sample code, do not forget to save your entries to ensure that the link between the class and the implementation can be established.

 

 

Leaving content frame