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: 

Consumption of CDS in an Odata Service


1. In Hana Studio, ABAP Development Perspective click on add a new ABAP Project. From here you can directly add  your SAP System to your Studio. Login details

    remain the same as your SAP Logon.



2. After the system is added you can see it Righ hand side in you r Project Explorer. Right click on it and select DDL source. You can create these repository artifacts as local  

    objects belonging to the $TMP package.





3. Provide a source table or view and give a SQL view name. Select all the field that you might require on your UI. (TIP: Press Ctrl+Enter to bring the entire list help of fields.)






4. Now, Give some annotation to make the data more readable on UI. Annotations allow to enhance the core meta model with consumer-specific vocabularies. For eg. @EnduserText.label will give the UI label for the partner field.



5. Now to register the Odata service , go to the transaction segw in the same system in the ABAP System and click on create project.

6. Provide the CDS data source and give the CDS name.

  

7. Now click on Generate Runtime Objects.

8. Now click on Register Service to create a service in the system. Here we will select ER9. Provide alias as local and package as $temp.

After successful registration the registration status will show in Green.






9. Now click on SAP Gateway Client Button. There click on Execute.




10. So after this we need a UI for our service. This we can do in WebIDE


https://code-fiori.dispatcher.cert.hana.ondemand.com/




11. Select Smart Template Application



Click Finish.


12.   Finally, it’s time to run our project. Click on the green Play icon on the top.

And, this is the final result.




3 Comments