Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
Showing results for 
Search instead for 
Did you mean: 

SAP introduces the seamless integration of S/4HANA Cloud with SAP Analytics Cloud (SAC) with 1911which can provide more powerful analysis functions for S/4HANA Cloud customers and meet customer's customized needs. The embedded SAP Analytics Cloud is now fully managed by SAP S/4HANA Cloud which exposes the embedded SAP Analytics Cloud functionality through Fiori applications, and customers only need to work with it to design the report they want, which is convenient and easy to operate. Through a successful customer use case, this blog will show readers its powerful functions and key steps to implement eSAC in detail.

What’s customer’s request?

Customers expect personalized access to data and ad-hoc analytical capabilities to get as much value out of their enterprise data as possible. The customer wants to build a detailed Inventory Aging report for Finance and other related departments. This is a basic requirement on Material Management Material Movement (MM-IM) module in Supply Chain Management (SCM). But currently NO such offering like warehouse material stock aging analysis. Especially no App to show stock of all periods on the same page. Therefore, embedded SAC has been introduced to the customer to customize the Material Stock Analysis which provides the prompt of date for user to access the stock of specific date.

The following table illustrates the basic expectation of the final output for inventory aging:



Material Group

Material Desc.



0-30 DAY

31-60 DAY

61-90 DAY

91-120 DAY

121-180 DAY

181-360 DAY

361-730 DAY

Over 730 DAY

Stock Quantity

Stock Value

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.

  • Creating a Custom CDS View

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

    Select I_MaterialStock as Primary Data Source. This CDS view is the basic view for the consumption views Total Actual Stock Quantity (C_MaterialStockActual) and Material Stock at Posting Date (C_MaterialStockByKeyDate) and provides the possibility to build own consumption views on top.

    Add I_Product as an Associated Data Source. The view is for retrieving Material Group.

    Maintain the Join Condition and edit Cardinality to be [0…1].

    Add an input parameter and set default value to be System Date.

    Add 3 measures and add Product Group.

    Set filter Posting Date <= input parameter.

    Finally, save and publish YY1_Inventory_Quantity.

    Another CDS view YY1_Inventory_Amount is also needed to be created. The operation steps are similar to the previous.

    Add Current Stock Quantity and Value (I_StockQuantityCurrentValue) as Primary Data Source. This CDS view provides the prerequisites for answering the following business question: What is the current material stock quantity and what is the current material stock value for a particular stock and where "the stock value is valuated" by the price at period end.

    And add I_Product as an Associated Data Source.

    Edit Join Condition and set default parameter to be CNY for Currency.

    Add the following 2 necessary elements.

    If all the configuration has been completed, save and publish it.

    • Creating Custom Analytical Query

    • Click Custom Analytical Queries under Query Design catalog.

      Create a query and Select YY1_Inventory_Quantity as data source.

      Select necessary fields.

      Assign Row and Column.

      Save and publish as YY1_INVENTORY_QUANTITY_Q.

      Another query YY1_INVENTORY_AMOUNT_Q is created in the same way.

      • 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. 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 the new created YY1_INVEMTORY_QUANTITY_Q.

        Based on the query selection, if there are mandatory parameters and filters, set Variables for the input parameters of the selected data source.

        From the Insert toolbar of SAC, choose either chart or table to vary the visualization and design the layout according to the customer’s need.

        For example, a picture can be set as background. Upload the needed picture and expand the picture (set “Repeat”).

        Add 2 Text widgets and style the Texts.

        Add dynamical text, e.g. Current date, current time, and user.

        Add bar charts and set dimension and measure and style them.

        Edit Rank Info as needed.

        The background color and opacity of charts can be set in the Styling panel. Input control and global filters can also be added for dimensions.

        Then we design a table to show the detailed Inventory Aging. Add a table and Adjust dimensions.

        Create calculations. Firstly, create several Restricted Measures for Received Stock in each aging interval.

        Choose Restricted Measures.

        Select Restricted dimension and based measure: Stock Increase Qty.

        Select time range for the first period: past 0-30 days.

        The rest of measures are created in the same way but pay attention that the offset in time range setting is different. The following picture shows how to acquire the past 31-60 days and past 61-90 days.

        Create several Calculated Measures to compute the stock difference between the previous and next period separately. The following picture shows the 3 formula.

        Then create a series of Calculated Measures for inventory aging. The formulas are shown as below.

        Add the second data source to acquire the stock value.

        Link dimensions for 2 data sources.

        Add a calculation to retrieve Stock Value from the second data source. So far, the creation of the story is completed.

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

        Publish the tile. On successful publish, the tile will be available on the Fiori Launchpad. Click the tile to launch the story in the Fiori Launchpad.

        What’s more

        There could be a special case. E.g. all the periods’ received stock is 0 but initial stock quantity is not 0. In this case, a minor change could be done.

        • Firstly, calculate the received stock for per period:

        • · Received Stock 0-30

          · Received Stock 31-60

          · Received Stock 61-90


          • Secondly, calculate the Difference Stock for per period:

          • · Diff Stock 0-30 = Current Stock - Received Stock 0-30

            · Diff Stock 31-60 = Diff Stock 0-30 - Received Stock 31-60

            · Diff Stock 61-90 = Diff Stock 31-60 - Received Stock 61-90


            • At last, calculate the aging stock:

            • · Stock 0-30 = IF("[ZDIFF30R] Diff Stock 0-30 Days" > 0;

              "[ZRS30R] Received Stock 0-30 Days";

              "[ZDIFF] Diff Stock")

              · Stock 31-60 = IF("[ZDIFF30R] Diff Stock 0-30 Days" > 0 AND "[ZDIFF60R] Diff Stock 31-60 Days" > 0;

              "[ZRS60R] Received Stock 31-60 Days";

              IF("[ZDIFF30R] Diff Stock 0-30 Days" > 0 AND "[ZDIFF60R] Diff Stock 31-60 Days" <= 0;

              "[ZDIFF] Diff Stock" - "[ZS30R] 0-30 Days";


              · Stock 61-90 = IF("[ZDIFF30R] Diff Stock 0-30 Days" > 0 AND "[ZDIFF60R] Diff Stock 31-60 Days" > 0 AND "[ZDIFF90R] Diff Stock 61-90 Days" > 0;

              "[ZRS90R] Received Stock 61-90 Days";

              IF("[ZDIFF30R] Diff Stock 0-30 Days" > 0 AND "[ZDIFF60R] Diff Stock 31-60 Days" > 0 AND "[ZDIFF90R] Diff Stock 61-90 Days" <= 0;

              "[ZDIFF] Diff Stock" - "[ZS30R] 0-30 Days" - "[ZS60R] 31-60 Days";



              Stock Over 730 = "[ZDIFF] Diff Stock" - "[ZS30R] 0-30 Days" - "[ZS60R] 31-60 Days" - "[ZS90R] 61-90 Days" -

              Details of the enhancement will be shared in the next blog.


              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 Inventory Aging Report can provide Inventory Quantity for per Aging Period, such as 0~30 days, 31~60days etc. and current Inventory Quantity and Amount associated with other data sources. which fully meets the customer's 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 Possibilityclick here

              • Customer use case of Embedded SAC on Material Stock Analysis: click here