Programming Methods for Sub-Objects 

Use

If a business object type consists of sub-objects, you can implement the following standardized BAPIs to add or remove sub-objects:

This method adds a sub-object to an object type.

This method removes a sub-object from an object.

For example, to add or remove the sub-object purchase order item to the business object type purchase order, the BAPIs AddItem() and RemoveItem() could be implemented for the object type, purchase order.

The BAPIs Add<Name of sub-object>() and Remove<Name of sub-object>() are instance methods.

Features

BAPI Interface

Import Parameters

You should keep the following points in mind when defining the import parameters:

For further information see Test Run Parameters.

Export Parameters

You should keep the following points in mind when defining the export parameters of a Remove<name of sub-object>() BAPI:

You should keep the following points in mind:

If the complete key exceeds the maximum capacity of MESSAGE_V2 (that is, 50 characters), it is divided up between the fields MESSAGE_V2 and MESSAGE_V3. The first 50 characters are stored in MESSAGE_V2 and the remaining characters in MESSAGE_V3.

The meaning of the various fields is the same as for successful execution.

For more information about this parameter, see Return Parameters (Error Handling).

You should keep the following points in mind when defining the export parameters of an Add<name of sub-object>() BAPI:

The meaning of the various fields is the same as described in the programming model for the Remove< name of sub-object>() BAPI.

The meaning of the various fields is the same as for successful execution.

For more information about this parameter, see Return Parameters (Error Handling).

See also:

Example of an Add<Name of Sub-Object> BAPI