Procedure documentation Creating a BAdI 

Procedure

  1.  Start the Object Navigator (SE80).

  2.  Open an enhancement spot. For more information, see Creating, Editing, and Deleting Enhancement Spots.

  3.  Select the Enh. Spot Element Definitions tab page.

  4.  Choose Create BAdI.

A dialog box appears.

  5.  Enter a name and a short text for the BAdI.

Note

BAdIs are in the same namespace as global data types from the ABAP Dictionary, global classes, or interfaces. For BAdIs, we recommend using the prefix “BADI_” (or “ZBADI_”, and so on, in the customer namespace).

The new BAdI appears as a node in the tree display of the tab page.

  6.  On the right-hand side of the page, do the following:

  a.  Enter the attribute for multiple use.

  b.  Enter the instance creation mode.

  c.  Enter the attribute for internal SAP BAdIs (only SAP internal use).

  d.  Optional: Enter a Fallback Class.

  e.  In the tree, expand the BAdI and choose the Interface node. Enter the name of an existing BAdI.

  7.  Optional: Choose the function Create Filter to create a filter.

Here you can:

  a.  Enter the filter name, filter type, and description.

  b.  Optional: If you choose Constant Filter Value During Call, you may only specify a constant value at the respective filter when using GET BADI. This is provided for future performance improvements of the statement.

  c.  Optional: Enter either a data element or a domain with fixed values, or a search help. Alternatively, enter a check or input help class, and a length (together with decimal places). In this way, the filter values specified at GET BADIcan be checked during the BAdI implementation.

  8.  Optional: Choose the function Create Screen Enhancement in order to create the BAdI as a screen enhancement.

The BAdI must not be of a multiple use type.

...

  a.  Enter Calling Program, Screen Number, Subscreen Area, and Description.

  b.  Optional: Select Default Value to specify a screen of a program that is used if no active implementation is found at runtime.

  9.  Optional: Choose Create Function Code Enhancement to create the BAdI as a function code enhancement.

The BAdI must not have any filters and must not be of the type for multiple use.

  a.  Enter Program, Function Code, and Description.

  b.  Optional: Select Default Value to specify an icon, a menu text, a pushbutton text, and a quick info, all of which are used when no active implementation is found at runtime.

  10.  Optional: Create an example implementation.

  a.  Select the BAdI, and choose Create Example Class from the context menu.

  b.  Enter the name of a BAdI implementation class and a description.

 

See also:

Definition of BAdIs

Displaying, Changing, or Deleting a BAdI