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:

Plant

Material

Material Group

Material Desc.

Supplier

Batch

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.

1.png

Create a new CDS view, fill the name of the new custom CDS view and select Analytical Cube for the scenario.

2.png

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.

 

3.png

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

4.png

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

5.png

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

6.png

Add 3 measures and add Product Group.

7.png

Set filter Posting Date <= input parameter.

8.png

Finally, save and publish YY1_Inventory_Quantity.

9.png

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.

10.png

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

11.png
Add the following 2 necessary elements.

12.png

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

13.png

  •  Creating Custom Analytical Query

Click Custom Analytical Queries under Query Design catalog.

1.png

Create a query and Select YY1_Inventory_Quantity as data source.

2.png

Select necessary fields.

3.png

Assign Row and Column.

4.png

Save and publish as YY1_INVENTORY_QUANTITY_Q.

5.png

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

1.png

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.

2.png

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.

3.png

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

4.png

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

5.png

Add 2 Text widgets and style the Texts.

6.png

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

7.png

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

8.png

Edit Rank Info as needed.

9.png

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.

 

10.png

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

11.png

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

12.png

Choose Restricted Measures.

13.png

Select Restricted dimension and based measure: Stock Increase Qty.

14.png

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

15.png

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.

16.png

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

17.png

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

 

18.1.png

18.2.png

18.3.png

18.png

Add the second data source to acquire the stock value.

19.pngLink dimensions for 2 data sources.

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

21.png

·         Creating an Application

To create an application (aka FLP Tile) to launch the story, choose Applications > Add Tile.

1.png

Choose a Tile Type format from the various options.

2.png

Fill out all the details and click on “Save and Publish “.

3.png

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.

4.png

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.

 

5.png

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";

                                  0))

·         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";

                                  0))

·        

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.

Conclusion

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