Summary of Differences Between OData V2 and V4 - SAP Help Portal
Summary of Differences Between OData V2 and V4 - SAP Help Portal
Help Portal
Browse by Product SAP Learning Journeys What's New Explore SAP
(Documentation)
Home SAP SuccessFactors Platform SAP SuccessFactors API Reference Guide (OData V4) Summary of Differences Between OData V2 and V4
Metadata Supports XML format only Supports both XML and JSON formats
XML: /odatav4/Sample.svc/v1/$metadata
XML: /odatav4/Sample.svc/v1/$metadata?$format=JSON
Metadata Supports single, full, and comma-delimited metadata Supports metadata query on service level only.
Scope queries, examples:
Single: /odata/v2/User/$metadata
Full: /odata/v2/User/$metadata
Comma-delimited: /odata/v2/User,
Picklist/$metadata
Data Type Supports the following data types: Supports the following data types:
DateTime Date
Time TimeofDay
Float Single
Enum
Merge OData v2 uses HTTP method POST and HTTP header X- In OData v4, you can use the PATCH HTTP method to merge records.
Operation HTTP-METHOD: MERGE to merge records.
Function Uses HTTP method GET for read operations. Uses HTTP method GET for function imports (read operations).
import and
Uses HTTP method POST for write operations. Uses HTTP method POST for function imports (write operations).
action
import No action imports. OData v4 also supports resource-bound functions and actions.
Entity Supports entity referencing operations with $link $ref isn't supported yet.
reference
Query System query options are supported only at root entity level, Supports system query options on aggregated entities:
resources for example, $filter, $select, and $orderby.
/odata/v4/User('admin')/reports?$filter=username eq 'abc'
https://help.sap.com/docs/SAP_SUCCESSFACTORS_PLATFORM/9f5f060351034d98990213d077dab38a/eb5d246dc27046eba4d14b7b73e74a… 1/3
2/7/24, 7:06 PM Summary of Differences Between OData V2 and V4 | SAP Help Portal
In this example, the filter condition applies to all users whose manager i
'admin'.
System Applies to root entities only, for example: Can be used to query both root and expanded entities:
query
/odata/v2/User?$filter=username eq 'abc' /odatav4/User?
option
$select=username&$expand=reports($select=username)
$select Nested filters can be used in a one-to-many relationship:
/odata/v2/User?$filter=reports/username eq
'abc'
System Applies to root entities only. Can be used to query both root and expanded entities:
query Nested filters can be applied to navigation properties /odatav4
option with a one-to-many relationship:
$filter Nested filters can be applied to entities of one-to-many relationship
/odata/v2/User?$filter=reports/username eq lambda expressions such as any and all:
'abc'
$filter=user=reports/any(m:m/username eq 'abc'
Supports customized operators such as like and in
Customized operators aren’t supported.
datetimeoffset must be specified in expression before
a DateTimeOffset field type: DateTimeOffset field type can be filtered without datetimeoffset:
$filter=lastModifed gt '2020-05-20T00:00:00Z'
$filter=lastModifed gt datetimeoffset'2020-05-
20T00:00:00Z' Supports method expression contains (v4 only):
System Supports deep expand: Supports deep expand and query options in expanded entities:
query
/odata/v2/User?$expand=reports,reports/reports /odatav4/User?$expand=reports($expand=reports)
option
$expand /odatav4/User?$expand=reports($filter=username eq 'abc';
$select=username)
Instance Not supported Annotations are supported as an extended feature in OData v4. Annotat
annotations start with $:
in response
{
"@context": "$metadata#Customers",
"@com.example.customer.setkind": "VIPs",
"value": [
{
"@com.example.display.highlight": true,
"ID": "ALFKI",
"[email protected]":
{
"title": true,
"order": 1
},
"CompanyName": "Alfreds Futterkiste",
"[email protected]#simple":
{
"order": 2
}
}
https://help.sap.com/docs/SAP_SUCCESSFACTORS_PLATFORM/9f5f060351034d98990213d077dab38a/eb5d246dc27046eba4d14b7b73e74a… 2/3
2/7/24, 7:06 PM Summary of Differences Between OData V2 and V4 | SAP Help Portal
]
}
Yes No
Copyright Disclaimer Privacy Statement Legal Disclosure Trademark System Status Ask a question about the SAP Help Portal
Find us on Share
https://help.sap.com/docs/SAP_SUCCESSFACTORS_PLATFORM/9f5f060351034d98990213d077dab38a/eb5d246dc27046eba4d14b7b73e74a… 3/3