Maintaining the BAPI-ALE Interface


To allow the asynchronous BAPI call in ALE business processes, you have to create a BAPI-ALE interface for the BAPI.

In the process, the following objects are generated for a BAPI:

  • A message type
  • An IDoc type, including its segments
  • A function module that is called on the outbound side
    (it uses the BAPI data to generate the IDoc and dispatches it)
  • A function module that fills the BAPI with the IDoc data on the inbound side.

In contrast to manually maintained message types, the function module that evaluates the change pointers does not create an IDoc; instead, it fills the appropriate BAPI structures, determines the receivers, and calls the generated ALE function module.

The generated message types, IDoc types, and function modules can also be used for distributing master data with the SMD tool.


The following two prerequisites must be met:

  1. The BAPI must exist. The following alternatives are possible:
    • A new BAPI has been developed. The appropriate customer namespace has been used for customer developments.
    • A customer wants to generate a BAPI-ALE interface for a BAPI in the standard shipment, or change a BAPI-ALE interface supplied by SAP after modifying the corresponding BAPI. To do this, proceed as follows:
      • Copy and modify the function module for the original BAPI.
      • In the BOR, create a sub-object type in the customer namespace for the business object type that belongs to the BAPI (transaction SW01). When you create a sub-object type, the subtype inherits the methods of the business object.
      • Set the status of the object type to Implemented (Edit ® Change release status ® Object type).
      • All methods of the subtype can then be changed, deleted, or supplemented with your own methods. You then generate the BAPI-ALE interface for the subtype and an assigned method in the customer namespace.

After an upgrade, the customer-generated interface will continue to work like it did in the old release, even if SAP issues a new version of a BAPI-ALE interface with the new release. If SAP has not issued a new interface in the new release, the customer can re-generate the old interface to adjust for any new parameters.

If SAP issues a BAPI-ALE interface for a BAPI for which the customer has already generated an interface, then the customer should use the new interface and delete the one he has generated. The old interface can still be used, but only in the old release. If you re-generate the old interface, some of the generated objects – like segments of SAP objects, for example – may be overwritten if the interface in the customer BAPI function module refers to BAPI structures that belong to SAP.

  1. If you need to take hierarchical dependencies between BAPI table parameters into account, you will have to define them before you generate the BAPI-ALE interface for the BAPI (see Defining Hierarchies Between BAPI Parameters). The defined hierarchy is evaluated during generation and is integrated in the interface coding. As a result, any subsequent change to the hierarchy will require re-generation of the BAPI-ALE interface.
    Once the generated IDoc type has been released, the defined hierarchy of the asynchronous BAPIs can no longer be changed (for compatibility reasons).

Be sure to read the Notes on related ALE topics. They contain information on data filtering, serializing messages, and other subjects.


Choose path BAPI ® Maintain ALE interface under ALE development.

Please note that all object names in customer systems must start with Y, Z, or your own prefix.

Then proceed as follows:

  1. In the initial screen, enter the basic business object (object type) for your interface and the method.
  1. Then select one of the options in the Interface menu to maintain, display, check, or delete an interface:
    • Creating an interface
      Prerequisite: No interface has been generated for this BAPI yet, or any existing interface has already been deleted with the Delete option.
      The system proposes names for the objects to generate. You can change these names if necessary.
      Creating an interface involves the following process flow:
  1. Enter a name for the message type in the first dialog box.
    The proposed names are selected according to the following naming conventions:
    Message type: Business term
    Example: MYTEST
    Confirm your entry.
  1. You can enter the following information in the following dialog box:
  • IDoc type: <message_type>01
    Example: MYTEST01
  • Outbound function module: ALE_<OBJECT>_<METHOD>
  • Inbound function module: IDOC_INPUT_<message_type>

The system proposes the development class and function group to which the BAPI function module belongs. When you generate your own interfaces, use your own development classes and function groups.
The following options are also available:

  • Data filtering allowed
    If you want to perform data filtering for the BAPI, you will have to choose option Data filtering allowed in the dialog box for creating or changing the interface. This option is generally active for BAPI-ALE interfaces generated by SAP. For more information, see the
  • Call in update task
    You have to set this flag if you want to perform database changes using methods of the update task.
  • Package processing allowed
    You have to select this option if you want to allow package processing of IDocs. The corresponding BAPI must support package processing. Use ALE customizing to configure the package size.

To generate only the message type (required field) and IDoc type (required field), or only one of the function modules (optional fields), simply leave the corresponding field blank.

  1. Confirm your entries.
    The Enter Segment Name dialog box is displayed.
  1. Enter a segment name:
    The proposed segment type is derived from the message type or BAPI structures:



For individual fields as a header segment
Example: E1MYTEST, or




For parameters of structure BAPI_XX…
Example: E1BP_HUGO for BAPI_HUGO


If you define a segment as containing more than 1000 bytes of data, child segments are generated automatically. The names of the child segments are then appended to the original segment name with digits 1, 2, and so on, as long as the original segment name is shorter than 27 places.

    • Changing an interface

Prerequisite: Objects have already been created for this BAPI.

Choose Change to re-generate the objects of an existing ALE interface after changes to the BAPI. The IDoc type and IDoc segments are re-generated when the interface structures and object methods have changed. The function modules are only re-generated when the IDoc type or one of the segments has changed.
A dialog box (similar for the creation case above) is displayed. This dialog box displays the objects that already exist in the system. These fields are not ready for input.
If a field is blank, you can generate the corresponding object.

    • Displaying an interface

Prerequisite: Objects already exist for this BAPI.
All the existing objects for this BAPI are displayed. This gives you an overview of the relationship between the BAPI method and the IDoc message type.

    • Deleting an interface

Prerequisite: Objects have already been created for this BAPI.
Any function modules that exist in the system are deleted.
The IDoc structure is deleted if it has not been released yet.
The IDoc segments are only deleted if they have not been released yet and are not used in any other IDocs.
Finally, the message type is deleted if it no longer has an assignment to an IDoc type.

    • Checking the interface

Prerequisite: Objects have already been created for this BAPI.
All objects of the BAPI are checked to see whether they already exist in the system. The system also checks whether objects (IDoc type and segments) have already been released.
You can change the release status of the objects (see Set release and Cancel release under the

  1. You can release the interface.
    Developers can change the release status of IDoc types and segments (under Edit ® Set release or Cancel release).

To do this, you need authorizations S_IDCDFT_AL+ and S_IDCDFT_ALL of authorization object S_IDOCDEFT.

To release an object, the corresponding BAPI must already be released. When you release an object, the system first checks whether the generated interface under the BAPI method has the current status. If not, it prompts you to re-generate the interface. The system determines which segments and which IDoc types are relevant for release. A new status is then set for objects that have not been released yet.
The release can be cancelled at any time. This action is integrated with the transport system.
The generated function modules are not released.


The processed objects and their status are displayed in the output screen. All changes are recorded in transport requests.

See also: