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: 
JinheeJeong
Advisor
Advisor
Attention: The content of this blog was not created by SAP. It was written by a non-SAP consultant, Ashwin Shrimanwar (HANA Consultant, Pythian) to help your migration journey to the cloud. Therefore, please keep in mind that it might take some more time to get answer for your question in case you leave any to this blog.




 

Core Data Services (CDS) is an infrastructure for defining and consuming semantically rich data models in SAP HANA. It is used to define artifacts in database module using .cds file. SAP HANA Cloud supports HDB artifacts.

This blog describes the steps to follow when migrating SAP HANA CDS to SAP HANA Cloud on SAP Business Technology Platform (BTP).

1. Prerequisites


In SAP Business Application Studio (BAS), a project having a database module and application module (NODEJS) is prepared.


2. Add package.json file in srv folder


Add the package.json file to the root folder of the project (in BAS), as shown in the below screenshot.This package.json instructs the system to prepare the design time HANA artifacts in the form of hdbtable and hdbview for tables and views respectively.




3. Add cdsrc.json file


The files need to be added at the same level as mta.yaml, as shown in the below screenshot.This defines the target path where the cds artifacts will be deployed.




4. Import CDS files to the project


Import CDS files at the same level as src folder, as shown below.Highlighted are the existing .cds files and their definition provided below.




5. Add/change package.json file in db folder


Add/change the package.json file under the db folder, as shown below.




6. Add build.js


Add the build.js file under the src folder, as shown below.




7. Execute CDS build


Execute CDS build by opening a terminal in the project as shown below and execute the cds build command.




8. Objects generated


Once the CDS build is successful, the corresponding objects (hdbtables and hdbviews) will be generated under the gen folder.




9. Objects deployment to the database


After generating the file under the gen folder, deploy them into the database using the deployment option in the SAP HANA projects as shown below.


 

The HANA CDS artifacts are now migrated to SAP HANA Cloud design time artifacts and deployed!

 

Please feel free to leave any comments/questions. It might take some time as this content is not from SAP, but we will do our best to get back to you with accurate and reliable information.
1 Comment