Skip to Content
Author's profile photo Dileep Kumar Reddy Ajjugunti

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.

NOTE

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.

service {

“CDS_VIEW_REPLICATION_WRAPPER_VIEWS::I_Product.I_Product” as “I_Product” key(“Product”) ;

}

Execute in the browser to test the OData service.

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Syam Babu
      Syam Babu

      Hi Dileep,

      Excellent!!

      Quick doubt ..Can we replicate parameter based views as well or anyother challenges we have to face here?

      Thanks,

      Syam

      Author's profile photo Dileep Kumar Reddy Ajjugunti
      Dileep Kumar Reddy Ajjugunti
      Blog Post Author

      Hi Syam,

      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.

      https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.02/en-US/20d5fa9b75191014a33eee92692f1702.html

      Thanks,

      Dileep.

      Author's profile photo Gov Totawar
      Gov Totawar

      Hi Dileep,

      Is this scenario applicable only for SCP Hana database or customers can use it to replicate data to on-prem third party database .

      Thank You

       

      Author's profile photo Dileep Kumar Reddy Ajjugunti
      Dileep Kumar Reddy Ajjugunti
      Blog Post Author

      Hi Gov,

      At the moment the view replication is only available for the SCP Hana database.

      Thanks,

      Dileep.

      Author's profile photo Simon Kemp
      Simon Kemp

      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?

      Author's profile photo Dileep Kumar Reddy Ajjugunti
      Dileep Kumar Reddy Ajjugunti
      Blog Post Author

      Hi Simon Kemp,

      Yes, the replication is only one way from source (S4Hana Cloud) to target (SAP Cloud Platform).

      Thanks,

      Dileep.

      Author's profile photo Guillaume COURREGES
      Guillaume COURREGES

      Hello,

       

      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

       

      Best regards

      Author's profile photo Bharath HM
      Bharath HM

      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).

      Best Regards,
      Bharath

      Author's profile photo Madhavi Vontikommu
      Madhavi Vontikommu

      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.

      Thanks

      Madhavi

       

      Author's profile photo Dileep Kumar Reddy Ajjugunti
      Dileep Kumar Reddy Ajjugunti
      Blog Post Author

      Hi Madhavi,

      Activate the business role SAP_BR_CONF_EXPERT_BUS_NET_INT.

      You don't need SLT replication server configured.

      Thanks,

      Dileep.

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally

      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?

      Author's profile photo Gregor Wolf
      Gregor Wolf

      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.

      Best regards
      Gregor

      Author's profile photo Madhavi Vontikommu
      Madhavi Vontikommu

      Hi Dileep,

      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)?.

      Thanks

      Madhavi

      Author's profile photo Varun Raina
      Varun Raina

      Hi Dileep,

       

      I am trying to set up the connection between S4HC and the SCP HANA Service and I have been following the below help link:-

      https://help.sap.com/viewer/0f69f8fb28ac4bf48d2b57b9637e81fa/1908.500/en-US/6db497dbb2c747d28b89e3759034fc8d.html

      On step 8, I don't see any direction as to what needs to be provided as Connection NameSchema NameDescription and Service ID.

       

      Could you please shed some light on this.

       

      Thanks,

      Varun Raina

      Author's profile photo Gregor Wolf
      Gregor Wolf

      Hello Dileep,

      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?

      Best regards
      Gregor

      Author's profile photo Michael Sanjongco
      Michael Sanjongco

      Hello Gregor,

       

      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.

      Kind Regards,

      Michael

      Author's profile photo Gregor Wolf
      Gregor Wolf

      Thank you Michael for the answer. Interresting to see that the same requirement is solved with 3 different technical solutions:

      • Web Service for BW on HANA or BW/4HANA
      • OData Service for SAP DAta WArehouse Cloud
      • Websockets for Data Intelligence

       

      Author's profile photo Shruti Jain
      Shruti Jain

      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?