Replicate ABAP CDS Views from SAP S/4HANA Cloud to SAP Cloud Platform
With the release of S/4 HANA, 1711 customers can use ‘replicate CDS views’ app from SAP S/4HANA Cloud systems to replicate released CDS views from an SAP S/4HANA Cloud source system to an SAP Cloud Platform (SCP) target system.
This includes the underlying tables, data and to achieve seamless data replication to target SAP Cloud Platform systems. It also provides replication logs to effectively analyze the replications.
When data is replicated from SAP S/4HANA Cloud to SAP Cloud Platform, personal data is not protected by SAP Cloud Platform automatically. Customers are responsible for the SAP S/4HANA data made available on the HANA database of SAP Cloud Platform.
The app displays the list of available CDS views for replication.
You can choose to add or delete CDS views. In addition, you must publish to finalize changes in the target SCP system.
Choose to Add to replicate CDS views to the SAP Cloud Platform target system.
The status of the selected views is set to, To be Replicated.
To finalize the changes in the target system, choose Publish.
The status of the views changes to the following:
- Added views – Replicating.
- Deleted views – Deleting
To update the status of the views in process, choose (Refresh)
After successfully published to the target system, the status of added views changes to Replicated.
After the view is replicated to the target system, the SAP SLT framework keeps polling the tables to check for the latest data updates. This column displays the time when a table was last synced.
The replicated views can be seen in the target SCP system for the given schema.
Step-by-step guide to build an OData Service based on replicated CDS views from S/4 Hana
Once the replicated views are available in the target SCP system.
Create a schema for the wrapper view.
Right-click on the Catalog to save the schema>choose New>Schema in the context popup menu.
In the dialog enter the schema name.
Create a synonym for the router view in the wrapper schema as mentioned below.
CREATE SYNONYM “CDS_VIEW_REPLICATION_WRAPPER_VIEWS”.”I_PRODUCT” FOR “SCN_DEMO_TABLE_REPL_PUBLIC_VIEWS_CLIENT_100″.”I_PRODUCT”;
Create a package in the editor for creating the wrapper views and OData service to access in the Fiori application.
Right-click on the Content to save the package>choose New>Package in the context popup menu.
Right-click on the PACKAGE CREATED ‘CDS_VIEW_REPLICATION_WRAPPER_VIEWS’ to create the CDS.
Choose New>File in the context popup menu and create file name as I_Product.hdbdd.
Create the wrapper CDS as mentioned below.
Save and execute to access the data model.
Right-click on the PACKAGE ‘CDS_VIEW_REPLICATION_WRAPPER_VIEWS’ to create the xsodata.
Choose New>File in the context popup menu and create file name as I_Product.xsodata.
“CDS_VIEW_REPLICATION_WRAPPER_VIEWS::I_Product.I_Product” as “I_Product” key(“Product”) ;
Execute in the browser to test the OData service.
Quick doubt ..Can we replicate parameter based views as well or anyother challenges we have to face here?
Yes, we can replicate CDS view with parameters but the target Hana database should have 2.0 SP2.
We can create parameterized view clause only with Hana 2.0 SP2.
For more information please find the below link.
Is this scenario applicable only for SCP Hana database or customers can use it to replicate data to on-prem third party database .
At the moment the view replication is only available for the SCP Hana database.
Thanks for sharing this Dileep Kumar Reddy Ajjugunti
Can I confirm that this replication is only one way from S4HC to SCP, not the other way too right?
Hi Simon Kemp,
Yes, the replication is only one way from source (S4Hana Cloud) to target (SAP Cloud Platform).
Very interesting post.
How can i have access to this "replicate CDS views" tile ? (which roles etc).
I do not find the "View replication" business catalogs
Hi Guillaume COURREGES,
Activate the business role SAP_BR_CONF_EXPERT_BUS_NET_INT then you will be able to find the "Replicate CDS Views" tile(CDS View Replication group).
Hi Guillaume COURREGES/Dilip,
I don't see "Replicate CDS views” tile on my system even. Could you please let me know if you find the solution?. Do we need SLT replication server configured to see this tile. In order to replicate CDS view in SCP do we need SLT server?. If so is it extra license?.
This question is specific to S/4 HANA cloud and SCP.
Activate the business role SAP_BR_CONF_EXPERT_BUS_NET_INT.
You don't need SLT replication server configured.
Hi Dileep, it has been a while since this blog is created, so I thought of checking with you, is there update on this scenario being applicable on S/4 HANA on-premise CDS views -- > HANA On-Premise instance?
Hi Sreekanth, Hi Dileep Kumar Reddy Ajjugunti,
I also would be interested if this replication option exists for S/4HANA on premise. I'm aware of the SLT based table replication. But replicating on the level of CDS views seems to me to be the better option because I don't have to recreate all the joins of the underlaying tables.
Thanks for the reply. Now I am seeing "Replication CDS view replication" tile in S/4 HANA cloud. For replication of CDS view, Is Cloud Foundry is must?. Can we replicate CDS views to HANA SCP(Neo)?.
I am trying to set up the connection between S4HC and the SCP HANA Service and I have been following the below help link:-
On step 8, I don't see any direction as to what needs to be provided as Connection Name, Schema Name, Description and Service ID.
Could you please shed some light on this.
can you let me know why the Replicate CDS Views app isn't available for S/4HANA 2020 anymore? What would be the replication technology of choice now?
The CDS View Replication is now deprecated.
Depending on your target system, you can take a look at the following:
CDS View Extraction to BW on HANA, BW/4HANA
CDS View Extraction to SAP Data Warehouse Cloud
CDS View Extraction using Data Intelligence
Hope this helps.
Thank you Michael for the answer. Interresting to see that the same requirement is solved with 3 different technical solutions:
Hello Michael Sanjongco
Does that mean that we cannot replicate data into SAP BTP HANA DB using CDS Views?
If I am not planning to provision BW, DI or Data Warehouse, and would want to get some data periodically into my HANA DB in BTP for some custom development, how can we do that using CDS views?
APIs, Business Events and DRF are definitely an option but wanted to check if we can use CDS views for the same or not?
I sincerely apologize for the very late reply.
You can extract data via ABAP CDS Views from SAP S/4HANA Cloud to:
APIs are not recommended for mass data extraction.
Hope this helps.