Show TOC

ETag Handling in Batch ProcessingLocate this document in the navigation structure

Use

A changeset might contain multiple CREATE/UPDATE/DELETE operations. This can be problematic in combination with eTags because one operation can change data that is about to be processed by consecutive operations. In this case eTags of these operations might not be valid any more.

However, the application developer has the possibility to use the defer mode for changesets by redefining method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN in the respective DPC class. A data provider can check the entire changeset operations in IT_OPERATION_INFO and return CV_DEFER_MODE = 'X' to indicate that it does not process the entire changeset operations immediately, but only saves these operations until method CHANGESET_PROCESS is called. A data provider can dynamically decide to process the current changeset in defer mode based on the entire operation info described in table IT_OPERATION_INFO. In defer mode, when CREATE, UPDATE, DELETE or EXECUTE_ACTION is called the data provider has only to save all changeset operations in its internal tables without returning any data or eTag or headers to the framework.

When using defer mode the automatic eTag check will be done for all operations before any operations have been processed.

Prerequisites

We recommend he following when using batch in combination with eTags:

  1. In your DPC class, redefine method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN and set parameter CV_DEFER_MODE to ABAP_TRUE (at least for all relevant operations).

  2. If you have redefined method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_IS_CONDITIONAL_IMPLEMENTED in your DPC class then make sure that parameter RV_CONDITIONAL_ACTIVE is set to ABAP_FALSE (at least for all relevant operations). Else you will have to implement the conditional handling for the eTag yourself.

OData

Example coding for using the operation update entity.

Example coding for /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN

METHOD /iwbep/if_mgw_appl_srv_runtime~changeset_begin.
DATA: ls_operation_info TYPE /iwbep/s_mgw_operation_info.
* Defer Mode only for update entity operations
cv_defer_mode = abap_true.
LOOP AT it_operation_info INTO ls_operation_info.
IF ls_operation_info-operation_type NE /iwbep/if_mgw_appl_types=>gcs_operation_type-update_entity.
cv_defer_mode = abap_false.
EXIT.
ENDIF.
ENDLOOP.
ENDMETHOD. 

Example coding for /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_IS_CONDITIONAL_IMPLEMENTED

METHOD /iwbep/if_mgw_appl_srv_runtime~get_is_conditional_implemented.
IF iv_operation_type EQ /iwbep/if_mgw_appl_types=>gcs_operation_type-update_entity.
rv_conditional_active = abap_false.
ELSE.
rv_conditional_active = abap_true.
ENDIF.
ENDMETHOD.