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.
Showing results for 
Search instead for 
Did you mean: 
Product and Topic Expert
Product and Topic Expert
Dear Readers,

This blog post is a step-by-step to use SAP S/4HANA core data services in Cloud Platform Integration for Data Services. Core data services provides views through which you can import master and transaction data into CPI-DS and further integrate it to SAP Integrated Business Planning(IBP).

There are many standard core data service views available in the SAP S/4HANA. Use the View Browser app to view the wide range of core data services analytical and non-analytical views. These views are pre-defined and ready-to-use views. If the View Browser app does not have the view you need, then you can define your own CDS view in SAP S/4HANA through the Custom Analytical Queries app. You can eliminate the need of custom programs by using these CDS views to import data from SAP S/4HANA into IBP through CPI-DS.

One of the possibilities to use CDS views to import data is by using Custom ABAP transform in CPI-DS(Cloud Platform Integration for Data services). Execute the below steps in the CPI-DS, CPI-DS agent and the SAP S/4HANA to realize this.

Step 1: In SAP S/4HANA: Check which view you would like to use. A simple search on the view browser app in the SAP S/HANA will provide a view that you could consume in CPI-DS Custom ABAP transform. Note that in the definition of the view there could be parameters that might be required during the data extract. In the below example CDS view, P_ExchangeRateType and P_DisplayCurrency are the 2 input parameters required by the select query while querying this CDS view from SAP S/4HANA.

Execute the below steps in CPI-DS.

Step 2: Create a CPI-DS task which has the source as the SAP S/4HANA and the target as IBP.

Step 3: Create a CPI-DS data flow as shown in figure 1 and drag and drop the Custom ABAP transform into the data flow. In the example in figure 1, I have used the CDS view: I_SALESORDERITEMCUBE to integrate the sales order transaction data.

Figure 1: Data flow in CPI-DS

Step 4: In the Custom ABAP, create the output parameters. In the example shown in figure 2, I have extracted the Sales order number, Material, Plant and Order quantity from the CDS view: I_SALESORDERITEMCUBE.

Figure 2: Custom ABAP transform properties.

Give the file path and name of the .aba file. Provide the job name. This job name is displayed in SM37 transaction in SAP S/4HANA after the CPI-DS task execution. Provide an ABAP program name. Save the custom ABAP.

Step 5: Create the .aba file and insert the form routine in the .aba file as shown in figure 3. Ensure that this file is saved in the CPI-DS agent abap folder.

Figure 3: Example of ABAP form for the .aba file.

Step 6: Create a Query transform in the data flow as shown in figure 1 and map the output fields of the Custom ABAP to the Query transform input and output fields. Run the Query transform in design mode for testing the Custom ABAP.

Figure 4: Design mode output of the Query transform.

You have now used the CDS view to get the data into CPI-DS.