Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
mostafaelbarbar
Employee
Employee
Introduction

I was asked what are the possible ways to distribute BW data to external systems and 3rd party applications? and my answer was:

  • Using open hub destination

  • ODP-Based Data Extraction via OData


But I  recommended ODP-Based Data Extraction via OData because it gives us flexibility to be consumed with wide range of technologies and platforms as it is based on the OData communication protocol and also we could perform scalable delta extraction which is very good approach to distribute only new or changed data records to other applications.

In this blog I will explain step by step how to create OData service based on aDSO and how to extract the data from this aDSO (Full/Delta extraction).

System Prerequisites 

  • SAP BW7.4 or higher release

  • SAP Gateway Foundation is either required locally in the SAP NetWeaver system of the ODP provider or in a separate SAP NetWeaver instance (IW_BEP)

  • Open Hub License


Steps

  • Create New project in SAP Gateway Service Builder using T-Code SEGW and enter the project details





  • Redefine the Data Model and choose ODP Extraction





  • Enter RFC Destination, ODP Context and ODP name and then press Add ODP button



In this step, we can add associated ODP using + button and in this case all entities related to the selected ODP will be addressed ,so in this case we are adding ODP of aDSO /IMO/D_FIGL12 which is fact data then we can associated attributes and texts data too.


GL account and Company code attributes had been added and can be accessed as entity sets, for simplicity we will remove the ODP associations using - button.




  • Press next and enter the description of Model name and service name.





  • Press next, choose to save to local package.

  • Select all generated artifacts and press finish.





  • Generate runtime artifacts and choose to continue and save to local package.



Now we are having our oData service created and we need to activate it.

  • Go to Activate and Maintain services T-Code /IWFND/MAINT_SERVICE.

  • Choose add service.





  • Enter System Alias: Local and Press get service, Select the service and then press Add selected services.





  • Choose local object and continue.


Now the oData is created , active and ready be used by any external system which supports restful API communication.

Testing the OData service for Data extraction

For testing purpose, I delete the data of aDSO /IMO/D_FIGL12

  • Select the OData ZFIGL_12_SRV and choose SAP Gateway Client to test it from T-Code /IWFND/MAINT_SERVICE





  • Press EntitySets Button and Choose FactsOfD_FIGL12





  • Add HTTP header

    1. Header Name: Prefer

    2. Value: odata.track-changes




This will enable delta extraction from the aDSO /IMO/D_FIGL12, and if we ignored it, Full data extraction will be executed.

  • Press Execute button.




  • Check HTTP response



Note that at the end of the response of a request in delta mode contains a relative link to the next delta query. This can be used with the next HTTP request, in order to retrieve data, which has been changed since the delta was created.




  • Run T-Code ODQMON to check the ODP Queue



It shows one request for selected Subscriber and subscriber type, the extraction Mode is Initial Data (Delta Init) and Number of rows is zero as we deleted the data from aDSO /IMO/D_FIGL12.

  • Run relevant DTP to load the data to aDSO IMO/D_FIGL12.

  • Back again to SAP Gateway Client and Press EntitySets and Choose DeltaLinksOfFactsOfD_FIGL12

  • Add the following details after the entity set ('D20200527232940_000030000')/ChangesAfter , the final URL should be like  /sap/opu/odata/sap/ZFIGL_12_SRV/DeltaLinksOfFactsOfD_FIGL12('D20200527232940_000030000')/ChangesAfter, this should extract data that have been changed since a specific delta token provided in the URL.

  • Press Execute button

  • Back again to Monitor delta queue request



The delta changes had been extracted from the aDSO after loading the data to it.

Conclusion

ODP-Based Data Extraction via OData because it gives us flexibility to be consumed with wide range of technologies and platforms as it is based on the OData communication protocol and also we could perform scalable delta extraction which is very good approach to distribute only new or changed data records to other applications.

For more information and options please check ODP-Based Data Extraction via OData
14 Comments