Show TOC

Interface /IWBEP/IF_V4_DP_ADVANCEDLocate this document in the navigation structure

The advanced interface /IWBEP/IF_V4_DP_ADVANCED contains methods for all OData operations supported by SAP Gateway Foundation. The framework offers generic implementations for all methods that delegate to corresponding methods of the other three interfaces. Overwrite these methods to obtain comprehensive information for complex use cases.

There are exceptions for the generic implementations in regards to create, update and delete requests. The application itself needs to take care of the navigation within create, update and delete requests by implementing the advanced methods, otherwise the SAP Gateway Foundation framework will raise an exception.

Methods
Method /IWBEP/IF_V4_DP_ADVANCED~CREATE_ENTITY
This method creates a single entity. This method delegates directly to the basic create method for an entity. Depending on the create request additional references are created via the basic method for creating a reference.
Table 1:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to create the requested entity. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested entity and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method can only be called while creating an entity.

Example: POST “…/iwbep/tea_busi/0001/TEAMS('TEAM_31')”

Result

If your data provider is able to successfully create the requested entity it must return it by calling method SET_BUSI_DATA of the import parameter IO_RESPONSE. If your data provider has not created the requested entity it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Exceptions

If your data provider is not able to create the requested entity or encounters any other problem that prevents it from a successful execution it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Method /IWBEP/IF_V4_DP_ADVANCED~DELETE_ENTITY
This method deletes a single entity. This method delegates to the intermediate method for modification condition checks if needed. Afterwards the basic delete method gets called which then executes the actual deletion request.
Table 2:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to create the requested entity. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested entity and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method can only be called while deleting an entity.

Example: DELETE “…/iwbep/tea_busi/0001/TEAMS('TEAM_01')”

Result

A successful delete request will end with an HTTP return code 204 and an empty response body. Hence the only response handling needed from a data provider perspective is setting the done flag. If your data provider has not deleted the requested entity it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Exceptions

If your data provider is not able to delete the requested entity or encounters any other problem that prevents it from a successful execution it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Method /IWBEP/IF_V4_DP_ADVANCED~EXECUTE_ACTION
This method executes either a bound action or an action import. The generic implementation either delegates to the equivalent basic method for action import or it tries to resolve the navigation prior executing the bound action.
Table 3:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to create the requested action. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested action and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method is called for bound actions and also for action imports.
  • Example of bound action:

    POST “…/iwbep/tea_busi/0001/Departments(Sector='Consulting',ID='1')/com.sap.gateway.default.iwbep.tea_busi.v0001.AcChangeManagerOfDepartment"

  • Example of action import:

    POST “…/iwbep/tea_busi/0001/ChangeTeamBudgetByID"

Result

In some cases, depending on the definition of the action, a result needs to be provided to the import parameter IO_RESPONSE via method SET_BUSI_DATA. If your data provider does not find the requested action it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Exceptions

If your data provider is not able to successfully execute the requested operation it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Method /IWBEP/IF_V4_DP_ADVANCED~EXECUTE_FUNCTION
This method executes a function import. The generic implementation delegates to the equivalent basic method for functions.
Table 4:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to create the requested function. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested function and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method is called only for function imports.

Example of function import: GET “…/iwbep/tea_busi/0001/GetEmployeeByID(EmployeeID='0001')”

Result

The data provider must return the business data to the import parameter IO_RESPONSE by calling method SET_BUSI_DATA. If your data provider does not find the requested function it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Method /IWBEP/IF_V4_DP_ADVANCED~UPDATE_ENTITY
This method updates a single entity. This method delegates to the intermediate method for modification condition checks if needed. Afterwards the basic update method gets called.
Table 5:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to create the requested entity. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested entity and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method is called for patch and put HTTP methods.

  • Example of PUT update:

    PUT “…/iwbep/tea_busi/0001/TEAMS('TEAM_01')”

    The method is called once to update the team with the ID ‘TEAM_01’.

  • Example of PATCH related update:

    PATCH ”…/iwbep/tea_busi/0001/EMPLOYEES('1')”

    The method is called once to update the employee with the ID ‘1’.

Result

If your data provider successfully updates the requested entity it must return the business data by calling method SET_BUSI_DATA of the import parameter IO_RESPONSE. If your data provider does not find the requested entity or has other issues while processing the update it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Method /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY
This method reads a single entity. This method tries to resolve the navigation before delegating to the basic read or the intermediate entity tree.
Table 6:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to create the requested entity. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested entity and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method is called for return a single entity.

Example: GET “…/iwbep/tea_busi/0001/TEAMS('TEAM_01')”

The method is called once to retrieve the team with the ID ‘TEAM_01’.

Result

If your data provider finds the requested entity it must return it by calling method SET_BUSI_DATA of the import parameter IO_RESPONSE. If for a conditional GET request (for example. a request with “if modified since”) the entity has not changed, it is sufficient if your data provider simply calls method SET_NOT_MODIFIED of the import parameter IO_RESPONSE. Otherwise it depends on your eTag handling.

If your data provider does not find the requested entity it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.

Method /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY_LIST
This method reads a list of entities. This method tries to resolve the navigation before delegating to the basic read list or the intermediate entity tree list.
Table 7:

Parameter

Description

IO_REQUEST

This import parameter contains the information that is needed to determine the requested entities such as filter, expand or select tree. This information is identical to the information in the original OData request. It is not yet manipulated.

IO_RESPONSE

This parameter must be used by your data provider to return the data of the requested entities and/or additional information to the framework.

Precondition

This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method is called to return a collection of entities.

Example: GET “…/iwbep/tea_busi/0001/TEAMS"

The method is called once to retrieve all teams provided by the application.

Result

If your data provider finds the requested entities it must return the data by calling method SET_BUSI_DATA of the import parameter IO_RESPONSE. In addition the count of the entity collection needs to be set if requested.

If your data provider does not find the requested entity it must throw an exception inheriting from exception /IWBEP/CX_GATEWAY.