Monday, July 5, 2021

Relationship: OData Operation, HTTP Method and ABAP Statement (General Methods used during OData Service Development)

The table below shows the relationship between an OData operation, the corresponding HTTP method call and the corresponding ABAP statement call. These methods are mostly used by the Developer to implement their own functionality in the corresponding DPC extension class.

OData Operation HTTP Method ABAP Statement Comments Front-end method
Create (CREATE_ENTITY) POST INSERT Call create( )
Read (GET_ENTITY) GET SELECT SINGLE * Call bindElement( )
Read (GET_ENTITYSET) GET SELECT Call bindRows( )
Update (UPDATE_ENTITY) PUT UPDATE Call update( )
Delete (DELETE_ENTITY) DELETE DELETE Call remove( )
Function Import GET, POST SELECT, INSERT Custom Operations Call callfunction( )
Create File (CREATE_STREAM) POST INSERT Upload a file to a database table
Get File (GET_STREAM) GET SELECT Download a file
Update File (UPDATE_STREAM) PUT UPDATE Update the file content in a database table
Delete a File (DELETE_STREAM) DELETE DELETE Delete the file content in a database table
Execute Action (EXECUTE_ACTION) GET / POST SELECT / INSERT
GET_EXPANDED_ENTITY GET SELECT Select a record based on a specific field/ID
GET_EXPANDED_ENTITYSET GET SELECT Select item records based on a specific header record

Note:
The above methods are available in the DPC class.

Tip:
Where to find the DPC / Data Provider Class?
Answer: Go to SEGW transaction, open your Project for which the generation is done, open the Runtime Artifacts to navigate to the Class.

Useful Transaction Codes / Tools in OData ABAP Service / SAP UI5/ SAP Fiori

Tips: 
1) FND stands for 'Front End'
2) GW stands for Gate Way / Gateway

S. No. Transaction Code Description
1 SEGW SAP Service Gateway Builder
2 /IWFND/ERROR_LOG SAP Gateway Error Log
3 /IWFND/APPS_LOG SAP Gateway Application Log Viewer
4 /IWFND/VIEW_LOG SAP Gateway Application Log Viewer
5 /IWFND/CACHE_CLEANUP Cleanup of GW Model Cache - GW stands for Gateway
6 /IWFND/TRACES SAP Gateway Traces
7 /IWFND/SRV_VALIDATE This transaction exists only on SAP Gateway 2.0 (Netweaver 7.31 and below) systems
8 /IWFND/REG_SERVICE Activate Services (Unavailable in latest releases)
9 /IWFND/MAINT_SERVICE Activate and Maintain Services
10 /IWFND/VIRUS_SCAN Configuration of SAP GW Virus Scan
11 SICF Edit HTTP Service Hierarchy
12 RZ20 CCMS Monitoring
13 PFCG Role Maintenance
14 SPRO Customizing - Execute Project
15 ST22 ABAP Dump Analysis
16 LPD_CUST Launchpad customizing
17 /UI5/THEME_TOOL UI Theme Tool
18 /UI5/THEME_DESIGNER UI Theme Designer

OData Supported Data Types

OData ABAP service data types are also knows as 'EDM' data types.

The supported data types are:

  1. EDM.Binary > Fixed or variable length binary data
  2. EDM.Boolean > To represent binary value logic (True/False)
  3. EDM.Byte > Unsigned 8-bit integer value
  4. EDM.DateTime > Date and time values
  5. EDM.Decimal > Numeric values with fixed precision and scale
  6. EDM.Double > Floating point number with 15 digit precision
  7. EDM.Float> Floating point number with 7 digit precision
  8. EDM.Sbyte > Signed 8-bit integer value
  9. EDM.Int16 > Signed 16-bit integer value
  10. EDM.Int32 > Signed 32-bit integer value
  11. EDM.Int64 > Signed 64-bit integer value
  12. EDM.Single > Floating point number with 7-digit precision
  13. EDM.String > Fixed or variable length character data
  14. EDM.Time > Time of the day with values ranging from 00:00:00 to 23:59:59
The above are not ABAP Data Types. They are OData service data types used at OData level, and are called EDM data types.

EDM stands for Entity Data Model.