Skip to Content
Author's profile photo Vinaya HG

Consuming ODATA service in BODS

Business Scenario :

To extract ECC data which is in form of ODATA and load it to target system i.e to any database.In this we are loading it to Sybase table.

We are using BODS as tool for the data extraction from ODATA service.

 

Pre-requisites  :

  1. ODATA service URL generated from the ECC system.
  2. First and foremost is to have adapter instance enabled for the job server you are using.The Job server status should be as shown below :

To check this, Go to Data Services Server Manager -> Configuration editor ->Job server using->View

If this is enabled ,it means you are able to create a datastore of type ODATA. If not ask basis team to enable it for you.Once it is enabled ,in the Data Services Management Console, you are able to see Adapter Instances in the Administrator.

By clicking on the plus(+) sign next to it ,you can see the job server name ,you will find two tabs

  • Adapter Instance Status
  • Adapter Configuration

We have to create Adapter Instance of type ODATA ,for which go to Adapter Configuration -> add

Select ODATA Adapter instance in installed adapter list , mention Adapter Instance name,Access server host ,Access server port(optional) and maintain all other default settings.

Click on apply.

Once it is created,we can find the status of ODATA_ADAPTER in Adapter Instance Status as below :

To change the status ,click on start

Now we are ready to import ODATA Service into BODS . To do that let’s create Datastore of type ODATA as below :

Right Click on Object Library ->New

DataStore type     : Adapter i.e We are creating an Adapter data store

Job server             : Name of Job server on which you have enabled to create Adapter instance.

Adapter Instance  : Name of Adapter Instance created in Management Console

Once it is done click Apply to check everything is right.Click on edit to add other configurations mainly URL generated for ODATA service in browser  and system credentials.

URL :  http://IP_Address:Port_No/sap/opu/odata/SAP/ZSTUDENT_INFO_CRUD_SRV/

Now we can import the data present in the form of entity set.

Right click on Datastore ->Import by name ->Give Entity Set name as Table name ->Click OK

Through entity set the data is extracted ,we will create one sample dataflow and load it to the target system i.e Sybase.

The dataflow is created as below which includes :

The Row_Generation transform is used to avoid duplicates of records for safer side.

Now we can see our target table reflecting the data of the ODATA service

 

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vijay Vegesana
      Vijay Vegesana

      Nice Blog Vinaya. Need your inputs in below query.

      From BODS, Could you let us know the ways to expose the staging tables data from BODS to outside world via Web service/OData or any other mechanism.

      I hope in the above blog you are consuming data from OData and I hope vice versa is also possible. Can you please share us the links or documents which are relavant to my query.

      Thanks in advance,

      Vijay

      Author's profile photo Vinaya HG
      Vinaya HG
      Blog Post Author

      Hi Vijay ,

      Sorry for replying late.

      Do u mean to convert a batch job as a web service ?

      If yes,the below link would be useful to u

      https://blogs.sap.com/2014/07/30/publishing-a-bods-batch-job-as-a-web-services-using-custom-wsdl-labels/

      Author's profile photo Reddy KUMAR
      Reddy KUMAR

      Hi Vinaya,

      I have a requirement to fetch data from SAP C4C(Cloud for customer) system. I have ODATA api and it's giving Json response in SOAP UI , based on that created WADL file and used in "REST WEB SERVICE" data store but I'm receiving empty body in function. What would be the reason?

      Can we import Jason files from Adapter data store?

      Waiting for your replay... Thanks!

      Author's profile photo Vinaya HG
      Vinaya HG
      Blog Post Author

      Hi Kumar ,

      Yeah we can import JSON files using datastore of type web service. And there is other method to i.e using python libraries  inside base user defined transform.

      I think below links helps u :

      https://blogs.sap.com/2015/07/28/how-to-use-a-baseuserdefined-transform-in-data-services-4x-to-return-json-web-service-data/

      https://blogs.sap.com/2012/07/17/jsonadapter-for-data-services-helps-to-bring-unstructured-text-data-into-sap-ecosystem/

       

      Author's profile photo Reddy KUMAR
      Reddy KUMAR

      Thanks vinaya.

      Can't we import JSON files through Adapter data store?

      C4C is a Odata services and the API which i had, is giving JSON response in browser. That's is the reason i'm asking .

      We can import functions from datastore of type web service.

      Author's profile photo Marc Hirang
      Marc Hirang

      Hi,

      Where do you add the oData filter here? Is it in the data flow?

      Cheers,

      Marc

      Author's profile photo Vijayakumar Mukunthan
      Vijayakumar Mukunthan

      Hi Vinaya

      I have a requirement like triggering the BODS from fiori app based on the parameters entered in the fiori app. All those parameters entered in fiori should be transferred to BODS job.

      My question i want to trigger the BODS using Odata service. Could you give me a pointer on that.

       

      Thanks

      Vijay

       

       

      Author's profile photo Pradeep Sarathe
      Pradeep Sarathe

      HI Vinaya HG  ,It was a relly Godd explanation of O-Data for a person to begin with Thanks A lot

      Author's profile photo Former Member
      Former Member

      Hi Vinaya,

      I have a requirement to consume data from SAP C4C(Cloud for customer) system in BODS on-prem system. What is the best way to achieve the requirement in the current market standards.

      Author's profile photo Niraj Hirachan
      Niraj Hirachan

      Hi Vinaya HG

       

      Thank you for this article, this has been very useful insetting up the odata services in our DS.

      However, I am getting permission deniedL connect(local port 49593 to address 0:0:0:0:0:0:0:, remote port 80 to address *.*.*.*.).

      I think this error is due to the Access server host and port number. Currently I am using the root url for my api (i.e,   dev.api.crm6.dynamic.com)  as a Access servre host.

       

      Could you please advice. Thank you so much.

       

      Regards,

      Niraj