This is a PoC in customer system for embedded analytics, especially embedded SAC. S/4HANA Cloud Embedded SAP Analytics Cloud can enhance the analysis function of the current system and can better help customers analyze business related data. In this blog, the successful PoC of Embedded SAC on Manufacturing Cost Report will be shared to readers to show its powerful functions and to introduce the key steps to implement it in detail.
What’s customer’s request?
According to the customer's business scenario, the customer require drilling down to more figures of the manufacturing cost, such as direct material cost, direct labor cost and manufacturing expenses for both actual and planned cost. In addition, customer wants to calculate actual cost and planned cost for each set. There is a standard content: SAP S/4HANA Cloud Manufacturing content with SAP Analytics Cloud (28S) which can show the Work Center and Production Operations with Detail breakdown via Order Type, Company Code, Plants etc. and Financial Cost data which contains Actuals and Planned figures. However, the standard content only exists in standalone version. It could not cover customer’s requirements.
Therefore, embedded SAC has been introduced to the customer to customize the Manufacturing Cost Analysis which provides the information that the customer wants.
The following table illustrates the basic expectation of the final output according to the customer’s request:
Production Cost / each piece
Planning Cost / each piece
Difference between actual and planned costs
Sub-Total of single cost
Sub-Total of single cost
How to solve the problem?
There are four main steps to implement Embedded SAC: creating Custom CDS View, creating Custom Analytical Query, creating Story and creating an Application. The specific steps will be described in detail below. To protect customer sensitive data, some of the screenshots come from dummy test system.
In this story, 4 CDS views need to be created, which are YY1_MfgCost, YY1_MfgOrder, YY1_MfgOrderConfirmation and YY1_GoodsRecievedQuantity. Firstly, we create the YY1_MfgCost. Click Custom CDS View in Extensibility catalog.
Create a new CDS view, fill the name of the new custom CDS view and select Analytical Cube for the scenario.
Add Primary Datasource and Associated Datasource. Choose I_MfgOrderActlPlanTgtCost (Manufacturing Order Actual Plan Target Costs) as the Primary Datasource. Select I_ProductValuation(Product Valuation active core entity) and I_ProductText(Product Active Core Entity) as Associated Datasource.
Maintain Join Condition and Edit Cardinality to be [0…1].
Add Calculation for two measures: AcutualCost and PlanCost. The formulas are as follows.
Actual Cost = I_MfgOrderActlPlanTgtCost.DebitActlCostInDspCrcy-I_MfgOrderActlPlanTgtCost.CreditActlCostInDspCrcy
Plan Cost = I_MfgOrderActlPlanTgtCost.DebitPlanCostInDspCrcy-I_MfgOrderActlPlanTgtCost.CreditPlanCostInDspCrcy
Maintain Element Properties, save and publish custom CDS View. So far, YY1_MfgCost has been created.
Then create the YY1_MfgOrder. The steps are similar to the above. Add I_MfgOrderWithStatus (Manufacturing Order With Status) as the Primary DataSource.
Maintain Element Properties for the Measures and save and publish custom CDS View. So far, YY1_MfgOrder has been created.
Then create the YY1_MfgOrderComfirmation. Add I_MfgOrderConfirmation (Manufacturing Order Confirmation) as the Primary DataSource.
Create Calculation for Process confirmation quantity (ZConfirmedQuantity). The formula is as follows:
case I_MfgOrderConfirmation.CancldMfgOrderConfCount when
I_MfgOrderConfirmation.ConfYieldQtyInProductionUnit * -1
Creating Calculation for Fiscal Year Period (ZFiscalYearPeriod). The formula is as follows:
concat(concat( left(I_MfgOrderConfirmation.PostingDate,4), '0' ), substring( I_MfgOrderConfirmation.PostingDate, 5, 2 ) )
Maintain Element Properties for the Measures, save and publish the view.
Then create the YY1_GoodsRecievedQuantity. Add I_GoodsMovementCube (Goods Movement Analysis) as the Primary DataSource.
Add two Parameters to filter data.
Maintain Element Properties for the Measures and then save and publish it. So far, all the custom CDS views have been created.
II. Creating 5 Custom Analytical Queries
5 custom analytical queries are necessary in this report. Choose “Custom Analytical Queries” app from menu Query Design.
Create a query and select Manufacturing Cost (YY1_MFGCOST) as data source. Fill the name (YY1_ACCUMFGCOSTQRY) and label (Manufacturing Cost Query) of the query.
Choose the field.
Create the restricted measures for DirectMaterialAct, DirectMaterialPlan, DirectLaborPlan, MfgCostPlan, for example :
In the Filter, Giving the columns of ChartOfAccounts and ControllingArea the fixed values.
If all settings have been configured, the query can be published. Then create another query YY1_MFGORDERQRY. Select Manufacturing Order (YY1_MFGORDER) as the Data Source and fill the name (YY1_MFGORDERQRY) and label (Manufacturing Order Query) for the query. Then choose the field.
Complete the settings for “Display” and publish the query. Then create the query YY1_ORDERCONFIRMQRY. Select YY1_MFGORDERCONFIRMATION as data source and fill the name (YY1_ORDERCONFIRMQRY) and label (Confirmed Quantity of First Phase) of it. Choose the field.
Set the Display and publish the query.
Then create the query YY1_GOODSRECEIVEDQUANQRY. Select GoodsReceivedQuantity (YY1_GOODSRECEIVEDQUANTITY) as data source and fill the name (YY1_GOODSRECEIVEDQUANQRY) and label (Actual Confirmed Quantity Query) of it. Select the field.
Set the Display and publish the query.
Save and publish the query. So far, all the queries have been created.
III. Creating Story
The Create Story page allows customers to define SAP Analytic Cloud story for a selected data source. Customers can create different visualizations to the data source. Multiple data sources can be added to the story and users can design interactive dashboards, create new pages, and add visualization such as charts, tables, and other graphics to visualize the data. The items on the page such as chart are arranged as tiles that can be moved around, resized, and styled to your liking.
Therefore, we have defined an SAP Analytic Cloud story for the new created data source to visualize the data that the customer wants to show on the page.
Firstly, navigate to KPI Design group in the Fiori Launchpad (FLP).
Choose “Stories” tab from the Manage KPIs and Reports app page and create a custom story.
The Create Story page appears. In the Definition tab, enter the title in the Header section and description in Business Information section.
Go to Configuration tab to define the story. A pre-defined template will be loaded. Select a query from the list to build the story. Here choose YY1_GOODSRECEIVEDQUANQRY As Primary Data Source and other 4 Queries as Associated Data Source.
Link other four queries.
Design layout as you prefer. Remove all the default created title input fields Insert Image or Shape as required.
Create Calculation Measures, for example:
All the Calculation Measures’ formulas are as follows.
· Planned direct labor cost on each piece = cumulative planned direct labor cost / planned quantity
· Panned manufacturing cost on each piece = cumulative manufacturing cost / planned quantity
· planned direct material cost on each piece = cumulative material cost / planned quantity
The above three costs all adopt Cumulative type to sum the amount from the beginning of year to current month and are derived from planned quantity. And the sum of the 3 costs is the Planned Cost.
Ø Planned Cost = cumulative planned direct labor cost / planned quantity + cumulative manufacturing cost / planned quantity + cumulative material cost / planned quantity
· Actual direct material cost on each piece = cumulative material cost (sum the amount from the beginning of year to current month) / confirmed quantity of first operation (As it is known to all, this is a specific calculation based on customer’s business confirmation, the actual quantity for different customer can be different during manufacturing base on real business.)
· Actual direct labor cost on each piece = current month’s actual direct labor cost / received quantity
· Actual manufacturing cost on each piece = current month’s actuals manufacturing cost / received quantity
The Actual direct labor cost and Actual manufacturing cost all sum the amount of current month and are derived from received quantity of current month. And the Actual Cost is the sum of the above 3 costs.
Ø Actual Cost = Actual direct material cost on each piece + Actual direct labor cost on each piece + Actual manufacturing cost on each piece
After adding all the calculation measures, adjust the table styling and create Input Filter.
IV. Creating an Application
To create an application (aka FLP Tile) to launch the story, choose Applications > Add Tile. Choose a Tile Type format from the various options.
Fill out all the details and click on “Save and Publish “.
After successful save of the tile, it will navigate to “Custom Catalog Extension” app to publish a tile in the desired catalog.
In “Custom Catalog Extension” App, add a catalog to publish the tile.
In this blog, we show how to create a custom SAP Analytics Cloud Story or Dashboard via S/4HANA Cloud and embed it in S/4HANA Cloud Fiori Launchpad. The customized Manufacturing Cost Report can provide all the information the customer required, which fully meets their business needs. By using the S/4HANA Cloud embedded SAP Analytics Cloud, it becomes efficient to help customers solve problems with its powerful function. In the future, we will continue to share more successful stories of embedded analytics to readers.
For more information on SAP S/4HANA Cloud embedded analytics with SAP Analytics Cloud, check out the following links:
· Customer use case of Embedded SAC: how to create custom SAC story and the dashboard in S/4HANA Cloud: click here
· A Customer Use Case of Embedded Analytics in S/4HANA Cloud – Extend the Possibility：click here
· Customer use case of Embedded SAC on Material Stock Analysis: click here
· Customer use case of Embedded SAC on Inventory Aging Report: click here