Show TOC

Interface /IWBEP/IF_V4_DP_BATCHLocate this document in the navigation structure

This interface provides methods to process batch requests. The SAP Gateway Foundation framework offers generic implementations for all methods. They delegate to methods of interface /IWBEP/IF_V4_DP_ADVANCED depending on the individual operation in the batch request. Re-define these methods in your data provider class if your application requires specific handling of change sets or batch requests.

/IWBEP/IF_V4_DP_BATCH~PROCESS_CHANGE_SET needs to be re-defined, for example, if the data of several operations in a change set has to be provided to a single API call at once. Or, if internal numbering needs to be executed to consistently determine identifiers for objects created during change set processing.

Methods
Method /IWBEP/IF_V4_DP_BATCH~PROCESS_BATCH
This method processes the individual operations and change sets of a batch request. It returns the response to a batch request with the list of responses to the individual operations attached. And it handles change sets within the batch request.
Table 1:

Parameter

Description

IO_REQUEST

Import parameter for the batch request object with its child request objects.

IO_RESPONSE

This import parameter must be used by your data provider to return the data for the individual operations and/or additional information/error information to the framework.

Precondition

The OData batch request has been parsed completely and has been translated into a request object. This request object contains the individual operations as child request objects including an assignment to change sets.

Result

A response object carrying the result of the individual operations or change sets as child responses. Such a child response needs to either provide the data as requested by the client or error information if the individual operation could not be processed.

Exceptions

An exception may be raised if a fatal error occurred that cancels the complete batch processing. Errors during processing of individual operations in the batch request must be handled and need to be attached to the response object of the individual operation using method /IWBEP/IF_V4_RESP_BTC_OPER~SET_GATEWAY_EXCEPTION.

The implementation of the method needs to consider the preference header odata.continue-on-error.

Method /IWBEP/IF_V4_DP_BATCH~PROCESS_CHANGE_SET
This method processes the individual operations of a change set. It returns the response to a change set with the list of responses to the individual operations attached. This method is called by the generic implementation of /IWBEP/IF_V4_DP_BATCH~PROCESS_BATCH to process a change set.
Table 2:

Parameter

Description

IO_REQUEST

Import parameter for a request object representing the change set with child request objects for the individual operations in the change set.

IO_RESPONSE

This import parameter must be used by your data provider to return the data for the individual operations and/or additional information/error information to the framework.

Precondition

The batch processing has collected the individual operations of a change set and assigned the corresponding request objects to a change set request object provided in importing parameter IO_REQUEST.

Result

A response object carrying the result of the individual operations as child responses. Such a child response needs to contain the data as requested by the client. The set of changes applied during change set processing needs to be committed after successful execution of the complete change set. See also /IWBEP/IF_V4_PROCESS_STEPS~COMMIT.

Exceptions

If an error occurs during processing of any of the individual operations in the change set the method needs to terminate with an exception. Any changes that have already been applied during the change set processing must be rolled back. See also /IWBEP/IF_V4_PROCESS_STEPS~ROLLBACK.

The batch processing in /IWBEP/IF_V4_DP_BATCH~PROCESS_BATCH needs to handle the exception and assign it to the response object of the first individual operation in the change set using /IWBEP/IF_V4_RESP_BTC_OPER~SET_GATEWAY_EXCEPTION.