Skip to Content
Technical Articles
Author's profile photo Xiao-fei Song

Importing external edmx files to your CAP project using the CDS Graphical Modeler

In this blog post, we will demonstrate how to import external edmx files into CDS model and expose the entities defined in the edmx file as projections.

Importing EDMX Files into the CDS Model

Suppose you have downloaded API_BUSINESS_PARTNER.edmx file from https://api.sap.com/api/API_BUSINESS_PARTNER/overview, and you would like to use it as  an external file in your CAP project. First open your cds service model srv/cat-service.cds using the CDS Graphcal Modeler:

Now drag the edmx file from the file explorer into the CDS Graphical Modeler, and you will see below import dialog:

Click OK button to dismiss the dialog. Now you will be able to see the imported namespace from the edmx file in the graphical modeler:

We can now create a projection for the entities defined in the edmx file:

References

https://blogs.sap.com/2020/05/26/cap-consume-external-service-part-1/

Summary

In this blog post, we demonstrate how to import an external edmx file downloaded from https://api.sap.com and import it to the CDS model in your CAP project through the CDS Graphical Modeler, and we also demonstrate how to create a projection for a entity defined in the external edmx file after the file is imported.

Assigned tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Harikishore Sreenivasalu
      Harikishore Sreenivasalu

      HI Xiao-fei,  I tried importing the EDMX file but it doesn't work. do we need an extension for this ?

      Author's profile photo Xiao-fei Song
      Xiao-fei Song
      Blog Post Author

      Hi Harikishore,

       

      What kind of error did you see? Where did you download the EDMX file?

       

      Regards,

      Xiao-fei