Show TOC

Interface /IWBEP/IF_V4_DP_BASICLocate this document in the navigation structure

This interface contains methods with basic functionality. If you overwrite these methods you will have a working OData service for most requests. In almost all cases you need to implement these methods as the default implementations of class /IWBEP/CL_V4_ABS_DATA_PROVIDER always throw a “not implemented” exception.

Methods
Method CREATE_ENTITY
This method creates an entity. This method is called by the SAP Gateway Foundation framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a POST request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~CREATE_ENTITY.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_CREATE
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_CREATE
    raising
      /IWBEP/CX_GATEWAY .
Table 1:

Parameter

Description

io_request

Basic request info create.

io_response

Basic response info create.

Sample Code Example
 POST “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS” 

   Request Body: { "Team_Id": "1603", "Name": "Jonathan", [...]} 
Method CREATE_REFERENCE
This method creates a reference for a bind operation. When creating or updating an entity, relationships of navigation properties can be created or updated using a bind operation (odata.bind). This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request.
  • It can be called for a POST request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~CREATE_ENTITY.

  • It can be called for a PUT request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~UPDATE_ENTITY.
  • It can be called for a PATCH request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~UPDATE_ENTITY.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_REF_C
    exporting
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_REF_C
    raising
      /IWBEP/CX_GATEWAY .
Table 2:

Parameter

Description

io_request

Request basic reference create.

io_response

Response basic reference create .

Sample Code Example
 POST “…/iwbep/tea/default/iwbep/tea_busi/0001/EMPLOYEES” 

   Request Body: 

   { "ID": "0042", "Name": "Employee X" [...]}, 

   "EMPLOYEE_2_TEAM@odata.bind": "TEAMS('TEAM_03')" } 
Method DELETE_ENTITY
This method deletes an entity. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a DELETE request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~DELETE_ENTITY.
Code Syntax
  importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_DELETE
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_DELETE
    raising
      /IWBEP/CX_GATEWAY .
Table 3:

Parameter

Description

io_request

Basic request entity delete.

io_response

Basic response entity delete.

Sample Code Example
  DELETE “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS('TEAM_03')” 
Method EXECUTE_ACTION
This method executes an action. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a POST request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~EXECUTE_ACTION.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_ACTION
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_ACTION
    raising
      /IWBEP/CX_GATEWAY .
Table 4:

Parameter

Description

io_request

V4 request - basic function.

io_response

V4 response - basic function.

The class-based exception is /iwbep/cx_gateway.

Method EXECUTE_FUNCTION
This method executes a function. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a GET request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~EXECUTE_FUNCTION.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_FUNC
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_FUNC
    raising
      /IWBEP/CX_GATEWAY .
Table 5:

Parameter

Description

io_request

V4 request - basic function.

io_response

V4 response - basic function.

Sample Code Example
   GET “…/iwbep/tea/default/iwbep/tea_busi/0001/GetEmployeeByID(EmployeeID='0001')” 

The class-based exception is /iwbep/cx_gateway.

Method READ_ENTITY
This method reads a single entity. The entity is identified by the import parameter IO_REQUEST. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method can be called for different kinds of requests.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_READ
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_READ
    raising
      /IWBEP/CX_GATEWAY .
Table 6:

Parameter

Description

io_request

Basic request info read.

io_response

Basic response info read.

Example 1

The method can be called for a GET request for a single entity if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY.

Example 2

GET “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS('TEAM_01')”

The method is called once to retrieve the team with the ID 'TEAM_01'. It is called for a GET request with $expand if your data provider does not handle this request itself.

It is called for a GET request with $expand if your data provider does not handle this request itself in either of these methods:
  • /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY

  • /IWBEP/IF_V4_DP_INTERMEDIATE~READ_ENTITY_TREE

  • /IWBEP/IF_V4_DP_INTERMEDIATE~READ_ENTITY_TREE_LIST

Example 3

GET “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS('TEAM_01')?$expand=TEAM_2_MANAGER”

The method is called twice, once to retrieve the team with the ID ‘TEAM_01’ and once to retrieve the manager of that team. It is called for a PATCH request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~UPDATE_ENTITY or /IWBEP/IF_V4_DP_INTERMEDIATE~PATCH_ENTITY.

Example 4

PATCH “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS('TEAM_01')”

The method is called once to retrieve the team with the ID 'TEAM_01'. It is called for a modifying request with condition (for example eTag) if your data provider does not handle this request itself in the corresponding modifying method of interface /IWBEP/IF_V4_DP_ADVANCED or in method /IWBEP/IF_V4_DP_INTERMEDIATE~CHECK_MODIFICATION_CONDITIONS.

Exception

The class-based exception is /iwbep/cx_gateway.

Method READ_ENTITY_LIST
This method reads a list of entities. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. This method can be called for different kinds of requests.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_LIST
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_LIST
    raising
      /IWBEP/CX_GATEWAY .
Table 7:

Parameter

Description

io_request

Basic request info read list.

io_response

Basic response info read list.

It can be called for a GET request for a list of entities if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY_LIST.

Example 1

GET “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS”

The method is called once to retrieve the list of teams.

It is called for a GET request with $expand if your data provider does not handle this request itself in method:
  • /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY_LIST or

  • /IWBEP/IF_V4_DP_INTERMEDIATE~READ_ENTITY_TREE_LIST

Example 3

GET “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS?$expand=TEAM_2_MANAGER”

The method is called twice, once to retrieve the list of teams and once to retrieve the corresponding managers.

Exception

The class-based exception is /iwbep/cx_gateway.

Method READ_REF_TARGET_KEY_DATA
This method reads the key data of the target of a reference. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a GET request for a single entity if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY or /IWBEP/IF_V4_DP_ADVANCED~EXECUTE_ACTION.
Code Syntax
    importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_REF_R
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_REF_R
    raising
      /IWBEP/CX_GATEWAY .
Table 8:

Parameter

Description

io_request

Basic request info read reference.

io_response

Basic response info read reference.

Sample Code Example
 GET “…/iwbep/tea/default/iwbep/tea_busi/0001/EMPLOYEES('0002')/EMPLOYEE_2_TEAM” 

The class-based exception is /iwbep/cx_gateway.

Method READ_REF_TARGET_KEY_DATA_LIST
This method reads the key data of the list of targets of a reference. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a GET request for an entity list if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~READ_ENTITY_LIST or /IWBEP/IF_V4_DP_ADVANCED~EXECUTE_ACTION.
Code Syntax
   importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_REF_L
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_REF_L
    raising
      /IWBEP/CX_GATEWAY .
Table 9:

Parameter

Description

io_request

Basic request info read reference.

io_response

Basic response info read reference.

Sample Code Example
GET “…/iwbep/tea/default/iwbep/tea_busi/0001/EMPLOYEES('1')/EMPLOYEE_2_EQUIPMENTS” 

The class-based exception is /iwbep/cx_gateway.

Method UPDATE_ENTITY
This method updates an entity. This method is called by the framework using class /IWBEP/CL_V4_ABS_DATA_PROVIDER to process an OData request. It can be called for a PUT request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~UPDATE_ENTITY It can be called for a PATCH request if your data provider does not handle this request itself in method /IWBEP/IF_V4_DP_ADVANCED~UPDATE_ENTITY or in method /IWBEP/IF_V4_DP_INTERMEDIATE~PATCH_ENTITY.
Code Syntax
   importing
      IO_REQUEST type ref to /IWBEP/IF_V4_REQU_BASIC_UPDATE
      IO_RESPONSE type ref to /IWBEP/IF_V4_RESP_BASIC_UPDATE
    raising
      /IWBEP/CX_GATEWAY .
Table 10:

Parameter

Description

io_request

Basic request info update.

io_response

Basic response info update.

Sample Code Example
PUT “…/iwbep/tea/default/iwbep/tea_busi/0001/TEAMS('TEAM_01')” 

   Request Body: { "Team_Id" : "xxx", "Name": "Jonathan", [... ]} 

The class-based exception is /iwbep/cx_gateway.