Embedded (Real Time) Planning in S/4 HANA
Embedded (Real Time) Planning in S/4 HANA
Embedded Analytics
Objective:
The objective of this document to provide an overview on the Real Time Planning in S/4 HANA – Embedded Analytics using CDS Views.
Requirement Summary:
Perform HR Annual Salary planning for each employee using automatic & manual planning options. The below activities need to perform by the user.
- Actual Data copy to selected Plan Year.
- Manual planning of annual salary for individual employee.
System Details:
- S/4 HANA (Version 1610)
- SAP HANA (BW & ABAP Modelling Tools)
- Analysis for Microsoft Excel
Data Flow Architecture:
Step 1:
Create CDS view(s) for an actual data.
Considered below HR tables to provide Actual Data.
- PA0001 (HR Master Record: Info type 0001 (Org. Assignment))
- PA0002 (HR Master Record: Info type 0002 (Personal Data)
- PA0008 (HR Master Record: Info type 0008 (Basic Pay)) tables to provide the Employee related Data.
The below are the CDS views (ZHR_I_PA0003 & ZHR_I_SALARY) which are used to extract the data from the above HR Tables.
CDS View (ZHR_I_PA003) for Employee Data from PA0001 & PA0002 Tables.
CDS View ZHR_I_SALARY is an association view with ZHR_I_PA0003 and PA0008 Table.
Step 2:
Create a Calculation View to consume the CDS SQL view.
Calculation View (ZHR_PAYROLL) created to consume the CDS SQL View (ZHR_SALARY) along with Time Dimension to populate Month, Year from the Start Date of an Employee.
Output fields from the Calculation View (ZHR_PAYROLL).
Step 3:
Create a virtual Cube in Data Warehouse Work bench (RSA1) with an option Based On a SAP HANA Model.
Virtual Info cube HR Salary (ZHR_PA03) created by using the Calculation view (ZHR_PAYROLL) as a source. This cube supplies the Actual Data.
Assign the Info Cube Info objects to the HANA Information Model fields.
Virtual Info Cube HR Salary (ZHR_PA03) output.
Step 4:
Create Real Time Info cube to store Plan Data.
Payroll Planning (ZHR_PL02) is a Real time info cube with the same Info objects of Virtual Info Cube (HR Salary (ZHR_PA03). It will store the Plan related data by using Planning Functions or from Input ready query.
Step 5:
Create a Composite Provider with Virtual and Real Time Info cubes.
The Composite Provider HR Payroll (ZHR_PAYROLL) created with the Union join of Virtual Info cube HR Salary (ZHR_PA03) and Real Time Info cube (Payroll Planning (ZHR_PL02)).
Step 6:
Create an Aggregation level on top of Composite Provider HR Payroll (ZHR_PAYROLL) to perform planning activities.
An Aggregation Level Payroll Aggregation (ZHR_AGLPY) created on top of Composite Provider HR Payroll (ZHR_PAYROLL) with the required fields.
Step 7:
Create Copy Planning Function to copy Actual data for a particular Year to Target Year.
Planning Function Yearly Salary Copy Planning Function (ZHR_PFPY_VAR) created on top of an aggregation level (ZHR_AGLPY) and the parameter restriction are as follows.
- Variables Source Year (ZSOURCE_VAR_PF) & Target Year (ZTARGET_VAR_PF) are used to define the years at run time
- Source Info cube ZHR_PA03 for actual data & Target Info cube ZHR_PL02 used for Copied Plan Data.
Step 8:
Create an Input ready query to perform Manual Planning.
An Input Ready Query Employee Annual Salary Manual Planning (ZHR_ZHR_PAYROLL_Q0002) created on top of Aggregation Level Payroll Aggregation (ZHR_AGLPY) to perform the manual planning for selected year.
Step 9:
Create a Bex Query on Composite Provider to view Actual & Plan Values.
HR Actual & Planned Year Salary Data (ZHR_ZHR_PAYROLL_Q0003) query created on top of Composite Provider HR Payroll (ZHR_PAYROLL) to analyze Actual and Planned data for selected years.
Step 10:
Create an Analysis for Microsoft Excel report to analyze & to perform Planning activities.
- HR Annual Salary Planning Report created with HR Actual & Planned Year Salary Data (ZHR_ZHR_PAYROLL_Q0003) as DS_1.
- Used Employee Annual Salary Manual Planning (ZHR_ZHR_PAYROLL_Q0002) Input ready query as DS_2.
- Used Yearly Salary Copy Planning Function (ZHR_PFPY_VAR) with an alias (PF_1) to perform copy data from Actual to Plan years.
- Created Button groups for each report to perform the Report activities.
Report Execution Steps:
- Open the report from SAP Net Weaver Platform (Since the report was saved in Net Weaver Platform).
- Enter the Variable selections for Source Year / Target year for Copy Function and for manual Planning.
- Currently No Data under Plan Year (2017) and can be generated upon clicking on Copy Annual Salary Button which in turn executes the Copy Planning Function (ZHR_PFPY_VAR).
- After execution of Copy Annual Salary Button
- Save the Data by clicking Save Button under HR Annual Salary Planning
- Perform Manual Planning by adjusting Annual salary for each employee under Employee Annual Salary area.
- Employee (16 & 24) annual salary adjusted and the total now 100,331 which was updated immediately in the HR Annual Planning Query under 2017 Year.
- Prompt for Planning button can also be used to perform Manual planning for the selected year.
Hi Phani,
Any particular reason for using CDS and not using a HANA view straight away?
Thank you,
Lucas
Hi Lucas,
Thanks for your post.
It's possible to use HANA View directly to BW or direct CDS views are also can be used in BW. Since this scenario is simple but the motive of using CDS View is to provide an example for some cases where the Complex CDS views are already built and the requirement states that to re use those CDS views along with existing HANA View or (generated HANA view from BW).
The above stated document example may help as an example in joining both CDS - SQL View and HANA view.
Thanks & Regards,
Phani Kumar
Hi Phani,
its a Very good document. Could you please provide a email id to communcate with you.
Thanks
Narasimha
Hi Phani,
This is a very good document. Thanks for sharing!
One short question, does this solution work also in S/4HANA cloud ?
Thank you!
Best regards,
Jian
Hi Phani ,
I tried to consume CDS view with having lot of association with masterdata ,but it is not showing any field there in projection . Can you please let me know if we have any restriction wile consuming CDS view to calculation view.
Thank you,
Manish