Skip to Content
Author's profile photo Sunil Kumar Maurya

New Feature : OData service extension with extension fields in SDK

Hi All,

With current 1705 release now cloud application studio user can extends PSM released OData services with extension fields.

Use case : As a business requirement you have extended standard BO with fields, and now other party/system who is consuming OData service of that standard BO wants extended fields in OData Service.

Below is the step by step guide to extend Odata service in cloud studio.

  1. Extend standard BO, for example I have extended SericeRequest BO with fields shown in image

 

2. New content OData Extension can be created from ‘Add New Item’, click on Add New Item -> a new icon with name “OData Extension” will be available under SAP.

give a name to Odata extension and click on ‘OK’

 

3. A new dialog will appear to select available Odata service, Only PSM enable Odata services will be shown in drop-down, select relevant service which is based on enhanced standard BO and click on ‘OK’

 

4. It will navigate you to the browser and opening “Odata Editor” key user tool. If you are not already logged on to the SAP cloud solution, you will be prompted to log on (Use your SDK user for log-in)

5.OData Editor has two part, on the right side it has OData Service here all the nodes are listed of that services, Whatever node you have extended in BO, select it here (it should show mark as selected), on Left side it shows all element of that node.

 

6. From the right side under the Business Object, you can see PDI extension field as editable field, you can select and deselect it.

After selecting this field click on button Save and then Activate.

 

 

7. After successful activation status get changed to Active and Service URL will be generated.

8. Come back to PDI and On Refresh of solution, you will see a new content with. xodata extension in solution explorer

Other Way for Activation is from PDI, if you left inactivate from the browser then it will appear in SDK with inactivate flag, Right click on  .xodata content and Activate

 

9. To verify that extended field in BO is added or not you can check service metadata, Open Service URL in a browser and search the field recently added ( you can find metadata link in Odata editor)

 

 

 

Now Odata service is ready to use with extension fields.

Note: It does not support custom node extension and its fields to extends OData services.

 

For further usage how to consume C4C Odata you can follow this blog 

 

Regards

Sunil

 

 

 

Assigned Tags

      15 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Praveen Srivastava
      Praveen Srivastava

      Hi Sunil,

      Thanks alot for the nice feature.

      Best regards,

      Praveen

       

      Author's profile photo C4C Admin
      C4C Admin

      Hello Sunil,

       

      Thanks for the post. Can we add additional fields in Odata service 'pcmportal' using SDK? This is because pcmportal odata service does not have all SAP standard fields and SAP provided apps using this odata service.

      Odata service 'c4codata' have all fields but then we need to change the SAP provided apps which just missing 2/3 fields.

       

      Regards,

      Harshad Patel

       

      Author's profile photo Johannes Schneider
      Johannes Schneider

      Hi Sunil,

       

      i added an oData extension to a patch solution and added an element from a customer.xbo into the c4codata (BusinessPartner).

       

      Everything looks fine and the metadata from the odata shows, that the field is implemented into the odata. But now I want to assemble and download the patch solution, but i get an error to check-in all files and activate them. When I try to activate my oData extension, this error / warning pops up.

      When i go to the session administrator and delete my current session, log off and log in again and retry to activate the oData extension the same error shows again. The status of the oData extension in the WebUI is active and so is the status of the xodata object (no red dot on it).

       

      Is there a way to check in the xodata object and activate it?

       

       

      Kind Regards,

      Johannes

      Author's profile photo Fabian Egner
      Fabian Egner

      Hi Johannes,

       

      i have the same problem. How did you solve this problem?

       

      Thanks & regards,

      Fabian Egner

       

      Author's profile photo Johannes Schneider
      Johannes Schneider

      Hi Fabian,

       

      it is still not solved. Ticket is still at SAP.

       

      Kind Regards,

      Johannes

      Author's profile photo Fabian Egner
      Fabian Egner

      Hi Johannes,

       

      this is the answer from the SAP Support. Now i am able to assemble and donwload the solution:

       

      It seems that this is a language mismatch issue. The XODATA entry created in XREP has its language set to 'German' where as Cloud Studio / SDK only supports 'English' as its language.

      Hence during Assembly and download for a particular solution, the XREP content for XODATA component is continually in the staging process due to the language mismatch.

      A way to resolve this is to delete the XODAATA component again and create it once more by logging into the OData editor or UI (backend also if required) in English. This will set the XODATA content XREP file language as EN.

       

      Regards,

      Fabian

       

      Author's profile photo Johannes Schneider
      Johannes Schneider

      Hi Fabian,

       

      thanks for the update, I'm going to see if this approach works. To my incident sap answered that they're going to release a solution for this error. They also wrote, they're going to give more information about it until tomorrow.

      If i get any new information about it I'm going to share it here.

       

      Kind Regards,

      Johannes

      Author's profile photo Johannes Schneider
      Johannes Schneider

      Hello Fabian,

       

      It did actually work. Thanks for the hint and have a nice day.

       

      Kind Regards,

      Johannes

       

      Author's profile photo Dedeepya Reddy
      Dedeepya Reddy

      Can we also extend Standard DWB Services (Import/Update/Export) using OData Extensions for PDI Extension fields?

      I tried doing this, but in OData Editor I cannot see my Extension field.

      Author's profile photo Dedeepya Reddy
      Dedeepya Reddy

      After logging into the UI Odata editor wth SDK login it worked!

      Thanks !.

      Author's profile photo Former Member
      Former Member

      Hello Team,

       

      I am using data workbench for uploading products to the Sales quote where i need some of my custom extension fields in the sales quote item sheet. For that I tried extending the odata with the custom extension fields thru pdi following the proceedure mentioned as above.

      I am able to add successfully but couldnt see any .xodata extension in my solution and now i wanted to edit in the sense want to remove few extension fields from the service. But when i try doing the same opening the odata editor in browser its not displaying any of my extension fields whereas the odata service url and the excel imported from data workbench as the extension fields.

       

      Pls help.

       

      Thanks,

      Swadini S

      Author's profile photo Sunil Kumar Maurya
      Sunil Kumar Maurya
      Blog Post Author

      Hi,

      When you say you could not see .xodata file in your solution, then how did you open xodata for edit?

      would like to suggest few points:  Once you added extension field in XODATA, and Save n Activate then refresh your solution you would find a new file created.

      Always use PDI user to login for XODATA.

       

      Regards

      Sunil

       

      Author's profile photo Former Member
      Former Member

      Hi Sunil,

       

      There seems to be some refresh issue.

      First time it opened in browser and able to add fields. Later the newly created .xodata extension doesnt get reflected in my solution. After 5 days it got displayed in my solution and able to perform my task.

       

      Thanks,

      Swadini S

      Author's profile photo Sunil Kumar Maurya
      Sunil Kumar Maurya
      Blog Post Author

      Hi,

      I guess there was some other issue, I have never encounter such issue, .xodata comes in solution immediately on refresh. I hope you have logged in on browser with SDK user, otherwise you won't see your extension field.

      If such case happen in future you can raise a ticket so team can figure out happened wrong in your case.

       

      Regards

      Sunil

      Author's profile photo Dhruvin Mehta
      Dhruvin Mehta

      This was so helpful! Keep up the good work! 🙂