Skip to Content

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

 

 

 

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Harshad Patel

    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

     

    (0) 
  2. 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

    (0) 
        1. 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

           

          (0) 
          1. 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

            (0) 
  3. 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.

    (0) 
  4. 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

    (0) 
    1. Sunil Kumar Maurya
      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

       

      (0) 
  5. 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

    (0) 
    1. Sunil Kumar Maurya
      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

      (0) 

Leave a Reply