Technical Articles
Operational Data Provisioning API deep dive – CDS Extraction
Operational Data Provisioning provides a technical infrastructure that you can use to support two different application scenarios. The first of these is Operational Analytics for decision-making in operative business processes. The other is data extraction and replication.
-
Operational Analytics
You can use Operational Analytics to perform OLAP analyses on the application data locally in the application system. For Operational Analytics, you only need to perform minimal configuration of the BW in your application system and do not need to set up a Data Warehouse. Replication of the data to a BW system is not necessary. The application data can be accessed directly. The analysis performance can be improved by using SAP HANA or SAP Business Warehouse Accelerator.
-
Data Extraction and Replication
As well as indexing data in SAP HANA or SAP Business Warehouse Accelerator, operational data provisioning can be used to provide data for other external consumers such as SAP BusinessObjects Data Services. Delta mechanisms are also supported here.
- For further information on ODP
Web Service/SOAP API – OPERATIONALDATAPROVISIONINGOUT
ODP API
The following methods are part of the ODP API:
Use Cases
- Discover ODPs and their properties:
- GetContextList
- GetList
- GetDetails
- Full data replication from a given ODP:
- OpenCursor (extraction mode = full)
- FetchCursorPackage
- CloseCursor
- Continuous delta replication from a given ODP:
- OpenCursor(extraction mode = delta)
- FetchCursorPackage
- CloseCursor
- Reset delta replication: Complete reload of ODP data from source system; next delta request will fetch again all data from scratch.
- CloseSubscription
- Direct access to ODP Data:
- FetchDataDirect
In this blog we will deep dive into the Full & Delta replication use case:
There are a few common elements in the API:
Subscriber Type ID:
Subscribers
|
Description
|
---|---|
SAP_BW | SAP NetWeaver Business Warehouse |
BOBJ_DS | SAP Business Objects Data Services |
TREX_ES | SAP NetWeaver Embedded Analytics. Query is defined on transient provider, which is derived from the ODP |
RODPS_REPL_TEST | Created by executing report RODPS_REPL_TEST (in transaction SE38) |
RSODP_ODATA | Open Data Protocol (OData) |
HANA_SDI | SAP HANA smart data integration |
The ABAP report RODPS_REPL_TEST is used to rule out and troubleshoot ODP problems in the ODP source side (extraction and fetch of data) by creating a new subscriber to a provider in ODQMON. Whereas transaction RSA3 is the classic extractor checker, used only for pure DataSources data issues (Full mode and independent from ODP), the report RODPS_REPL_TEST acts as a separate additional subscriber. Therefore, the execution of this report is not a simulation. This mechanism enables the report to be used not only for checking ODP as context from the perspective of BW Subscriber but also from another consumer’s perspective.
Context ID :
Technical Name
|
Description
|
---|---|
SAPI | SAP Service Application Programming Interface (S-API) for SAP DataSources / Extractors without Enterprise Search (ESH) |
HANA | SAP HANA Information View |
BW | SAP NetWeaver Business Warehouse |
SLT~ | SAP Landscape Transformation Replication Server |
ABAP_CDS | ABAP Core Data Services |
ESH | Search and operational analytics (Enables reporting locally without replication of data to the data warehouse system. Based on ESH) |
BYD | SAP Business ByDesign. Data from MDAV (Multidimensional analytical views) can be extracted via ODP. Implemented via SOAP Web Service. |
OperationalDataProviderID:
In the case of CDS extraction OperationalDataProviderID is the name of the SQL view and data category.
ReplicationModeCode:
F – Full data replication
D – Delta data replication
R – Recovery of extracted data
Full data replication from CSDSLSDOCITMDX$F
(Sales Document Item Standard CDS Extractor – Delta Enabled)
Open Cursor (Sample Payload for ABAP Proxy)
<n0:OperationalDataProvisioningOpenCursorRequest xmlns:n0="http://sap.com/bw">
<SubscriberTypeID>RODPS_REPL_TEST</SubscriberTypeID>
<ContextID>ABAP_CDS</ContextID>
<OperationalDataProviderID>CSDSLSDOCITMDX$F</OperationalDataProviderID>
<ReplicationModeCode>F</ReplicationModeCode>
<ExplicitCloseIndicator>true</ExplicitCloseIndicator>
<DeltaExtensionNoDataIndicator>true</DeltaExtensionNoDataIndicator>
</n0:OperationalDataProvisioningOpenCursorRequest>
Wait for ODQ to generate the extraction (Wait time depends on the amount of data getting extracted)
Note: If you call fetch Cursor Package during the extraction in the source system the response will be an error “Package &1 has not been extracted yet and therefore cannot be read again“
Fetch Cursor Package
<n0:OperationalDataProvisioningFetchCursorPackageRequest xmlns:n0="http://sap.com/bw">
<PointerNumeric>Output from Open Cursor</PointerNumeric>
<SupportXMLFormatCode>ABAP_XML</SupportXMLFormatCode>
</n0:OperationalDataProvisioningFetchCursorPackageRequest>
Close Cursor
<n0:OperationalDataProvisioningCloseCursorRequest xmlns:n0="http://sap.com/bw">
<PointerNumeric> Output from Open Cursor </PointerNumeric>
</n0:OperationalDataProvisioningCloseCursorRequest>
Delta data replication from CSDSLSDOCITMDX$F
(Sales Document Item Standard CDS Extractor – Delta Enabled)
Open Cursor (Sample Payload for ABAP Proxy)
<n0:OperationalDataProvisioningOpenCursorRequest xmlns:n0="http://sap.com/bw">
<SubscriberTypeID>RODPS_REPL_TEST</SubscriberTypeID>
<ContextID>ABAP_CDS</ContextID>
<OperationalDataProviderID>CSDSLSDOCITMDX$F</OperationalDataProviderID>
<ReplicationModeCode>D</ReplicationModeCode>
<ExplicitCloseIndicator>true</ExplicitCloseIndicator>
<DeltaExtensionNoDataIndicator>true</DeltaExtensionNoDataIndicator>
</n0:OperationalDataProvisioningOpenCursorRequest>
Wait for ODQ to generate the extraction (Wait time depends on the amount of data getting extracted)
Note: If you call fetch Cursor Package during the extraction in the source system the response will be an error “Package &1 has not been extracted yet and therefore cannot be read again“
Fetch Cursor Package
<n0:OperationalDataProvisioningFetchCursorPackageRequest xmlns:n0="http://sap.com/bw">
<PointerNumeric>Output from Open Cursor</PointerNumeric>
<SupportXMLFormatCode>ABAP_XML</SupportXMLFormatCode>
</n0:OperationalDataProvisioningFetchCursorPackageRequest>
Close Cursor
<n0:OperationalDataProvisioningCloseCursorRequest xmlns:n0="http://sap.com/bw">
<PointerNumeric> Output from Open Cursor </PointerNumeric>
</n0:OperationalDataProvisioningCloseCursorRequest>
This concludes the article so we have learned to call the ODP extractor API. Please let me know in case you have queries regarding ODP API.
Further Information on CDS Extraction
https://blogs.sap.com/2019/12/13/cds-based-data-extraction-part-i-overview/
https://blogs.sap.com/2019/12/16/cds-based-data-extraction-part-ii-delta-handling/
https://blogs.sap.com/2019/12/20/cds-based-data-extraction-part-iii-miscellaneous/