Skip to Content
Technical Articles
Author's profile photo Orla Cullen

PAi Series Blog 3: Training and Activating the out of the box predictive content shipped by S/4HANA

Welcome to the third installment in the PAi and S/4HANA Blog series. Since S/4HANA Cloud version 1705, and S/4HANA On Premise version 1709, we have been embedding predictive content in to various S/4HANA processes including Sales, Finance, Procurement, Logistics and Project Management.

These Predictive Scenarios are delivered as standard content and I have listed some of them below:

CE = SAP S/4HANA Cloud Edition
OP = SAP S/4HANA On Premise
Fig 8: Predictive Scenarios by S/4HANA Release

 

OK – for S/4HANA Cloud customers we can dive right in, but for the S/4HANA On Premise customers, please ensure you have completed the installation and configuration steps outlined in previous week’s blogs 1 & 2.

Roles and Authorizations:

The first thing you need to do is check that you have the correct role to access the Predictive Models Fiori tile. The role required is SAP_BR_ANALYTICS_SPECIALIST – Analytics Specialist. Once the role is assigned, you can go ahead and add the specific tile from the APP Finder in Fiori Launch Pad.

Go to App Finder and look for “Predictive Models” and “Predictive Scenarios” Apps. Add these to the Predictive Models group.

 

Fig 1. S/4HANA App Finder

 

You’ll now see the Predictive Models Group with the Predictive Models and Predictive Scenario tiles on your Fiori Launch Pad.

Fig 2. Predictive Models Fiori Tiles

Predictive Scenario Overview:

Depending on the version of S/4HANA you are on, you’ll see several Predictive Scenarios. These Predictive Scenarios have been preconfigured by SAP S/4HANA to be used within your business processes. A Predictive Scenario is a template for a predictive use case which contains information about the algorithm, the training data set, and the target variable to be used to train the model. The Predictive Scenarios are linked to the appropriate business process application, so that the predictive results are consumed by the end user in their own environment.

These templates are robustly tested internally by a data scientist within SAP, using sample data from customers who are participating in our co-innovation programs. As you can see, we don’t ship trained models, but rather the ability for a customer to train models using their own data, based on these preconfigured details.

When you first open the Predictive Scenario Fiori Tile you will see a list of all of the Predictive Scenarios S/4HANA has shipped out of the box:

Fig 3. List Predictive Scenarios in Predictive Scenarios Tile

You will find information about the Predictive Scenario such as:

  • Predictive Scenario Settings including Training Dataset and Scenario Type:
Fig 4. Predictive Scenario settings
  • Input Variables to train the model:
Fig 5. Predictive Scenario Inputs
  • Output Variables returned when model applied:
Fig 6. Predictive Scenario outputs
  • Information about the Model such as algorithm used in this case Auto Regression:
Fig 7. Predictive Scenario outputs

 

For this Blog, I am going to focus on our first 2 Predictive Scenarios, namely in the areas of Procurement and Inventory Management. Details below:

Contract Consumption: Enables a buyer to predict contract consumption by analyzing contracts. The purchaser can analyze important information, such as expiring contracts, and proactively trigger sourcing activities, and negotiate better deals.

Fiori Tile: Purchasing Analytics -> Quantity Contract Consumption

Role: SAP_BR_BUYER

Stock in Transit: The “Materials Overdue – Stock in Transit” app gives an overview of the open shipments allowing business users to take action. With embedded predictive analytics, the app is enhanced with ‘Predicted Shipment Dates’ for each Goods Movement, to allow users to take action in managing delivery delays. Here historical data based on the earlier stock transit scenarios, and various other factors, are fed to the regression algorithm techniques, to arrive at a probable delay in the number of days.

Fiori Tile: Materials Management -> Stock Monitoring -> Overdue Materials (Stock in Transit)

Role: SAP_BR_INVENTORY_MANAGER

You can find further details on both Predictive Scenarios here.

Training and Activating your Model:

Once you open your Predictive Models Fiori App you’ll see a list of Predictive Scenarios.

Fig 9: List of Predictive Scenarios

In the “Models” tab you’ll then see the default model, and in the “Settings” tab you’ll see details of the Predictive Scenario Template.

Fig 10: Models Tab

Fig 11: Settings Tab

In the Models tab, select the default model, and select Train. You’ll then be asked to give a model description, and apply filters to the training data set if required:

Fig 13: Train a model

Fig 14: Model version created

The model is now in training, and you can select the arrow to check on the progress. The model can have a different status, at different times – Training, Error, Ready, or Active. An Error status can often be caused by lack of training data, or missing configuration steps, as outlined in Blogs 1 & 2.

Fig 15: Model Version Status

Once the status changes from Training to Ready, you can review the debriefing information for your model version. Debriefing information gives you information about the Quality of the model, including the Predictive Power, Predictive Confidence, and information on the variables that have the most impact on the model version.

Fig 16: Model Quality Overview

Once you are happy with the quality of your model, you can set it to Active. The model can be retrained, deactivated, or deleted at any time within in the Predictive Models Fiori tile.

Now you have an active model version, and you can start to see predictive results in the corresponding S/4HANA Application*

Fig. 17 Quantity Contract Consumption*

*Note for Contract Consumption scheduling of a batch job to generate scores is required. Details here

Fig. 18 Overdue Materials App – Stock in Transit

 

Now you know how to train and activate Predictive Scenarios shipped out of the box with S/4HANA. Stay tuned in the coming weeks we will start to go through how to approach predictive modeling, create your own models and publish them as NEW Predictive Scenarios in S/4HANA.

 

Assigned Tags

      28 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Hitesh Kapadia
      Hitesh Kapadia

      Hello Orla,

      Thank you very much for the brief but precise walk-through of the process.

      Just wanted to know, if is it feasible to leverage the standard Scenarios provided in S/4 HANA (Onpremise) in a customized (Z*) functionality?

      For example:

      1. If for a client the standard transactions for Inventory Management (related to Stock-in transit) are not suitable, hence customized transaction with required Z* tables have been developed.
      2. In the case if the client wants to leverage the Process Scenario, is it feasible to call the scenario through an Enhancement?

      Your input would help to further showcase adaptability of the out of box ML functionality in S/4 HANA - OP

      Thanks !!

      Hitesh Kapadia

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Hitesh,

      Good question and one we have not been asked before. When a Predictive Scenario is published it generates an ABAP class which can be used to call predictions in another application. You will find this in the top right hand corder of the Predictive Scenario over screen called “API Details” see beow picture:

      In fact in later releases if you add an Apply Dataset within the Predictive Scenario when publishing it will also generate an apply CDS view from 1809 onwards.

      Thanks,

      Orla

      Author's profile photo Hitesh Kapadia
      Hitesh Kapadia

      Hello Orla,

      Thank you very much for the answer.

      We would anlayze the suitability of the solution on the business cases we are considering and reach out to you here if we have any further question.

      Thanks,

      Hitesh

       

       

      Author's profile photo Hitesh Kapadia
      Hitesh Kapadia

      Hello Orla,

      Background:

      1. We are evaluating feasibility of how the out-of-box Predictive Scenarios in S/4 HANA - OP can be adopted for a Greenfield implementation
      2. In the case of Greenfield implementation the S/4 HANA - OP will not have "relevant" data in with the required 'size'. It will have only migrated balances and open line items.

      Question:

      Is it feasible to train a pre-delivered model for an out-of-box Predictive Scenario (for S/4 HANA - OP) outside SAP S/4 HANA (e.g. may be on SAP HANA) and import to SAP S/4 HANA?

      Thanks for your guidence,

      Regards,

      Hitesh Kapadia

       

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi HItesh,

      Unfortunately it is currently not possible to train a model to use in PAi outside the application. It is something we are looking in to in particular for where we want to combine S/4HANA and non S/4HANA data.

      However we have no committed delivery date as yet.

      Thanks,

      Orla

      Author's profile photo Hitesh Kapadia
      Hitesh Kapadia

      Hi Orla,

      Thank you very much for the input.

      Hitesh

       

      Author's profile photo Hitesh Kapadia
      Hitesh Kapadia

      Hi Orla,

      We understand that following sequence steps are feasible

      1. Train an out-of-box model on one instance of S/4 HANA (e.g. Quality Assurance instance)
      2. Transport the trained model from the QA instance to another instance of S/4 HANA (in the same pipeline as in which the QA instance is)
      3. Start using the model in the Production instance (without further training on the production instance)

      Request you to confirm if our understanding is correct.

      Thank you very much,

      Hitesh

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Hitesh,

      The model needs to be trained on the productive environment. We do not have the ability to transport model versions.

      Also it is recommended to train the model version on the latest data which is generally in a productive environment and subsequent retrains can be done there.

      Thanks,

      Orla

       

       

      Author's profile photo Sameer Raikar
      Sameer Raikar

      Hi Orla,

      When can we expect the Blog 4 in the series on custom predictive use case development? Want to understand the licensing part of PAi when using out of the box shipped content by SAP vis-a-vis custom use case development using PAi?

       

      Thanks

      Sameer

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Sameer,

       

      Blog 4 dropped last week and is an approach to modeling by one of our data scientists.

       

      Blog 5 dropped just now and should cover what you are looking for and you can find it here:

      https://blogs.sap.com/2019/02/21/pai-blog-series-5-create-new-predictive-scenarios-with-sap-predictive-analytics/

       

      Thanks,

      Orla

      Author's profile photo Pavan Kumar Parepalli
      Pavan Kumar Parepalli

      Hello Orla,

      Thanks for the brief walk-through.

       

      Can you please give me a precise information on how to consume a SAP Leonardo Restful API from S/4 Hana PAI.

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Unfortunately consumption of an SAP Leonardo Restful API in PAi is not possible.

       

      Thanks,

       

      Orla

      Author's profile photo Chris Bethune
      Chris Bethune

      I was able to get this deployed and can train models.  However, when I attempt to activate, it runs as "Activating" and then returns to "Ready" rather than "Active."  I am not seeing the additional data available in the app.  I am working with Overdue Materials - Stock In Transit currently.   Any direction on where to start looking for a cause or what might be missing, incorrect, etc.?

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Chris,

       

      One cause could be a known issue with HANA Rev40. If you are on that version you will need a minimum of PAi 1.12 to resolve this issue.

      If that is not the case can you raise a ticket and the team will take a look.

       

      Thanks,

      Orla

      Author's profile photo Ramesh Yuvashree
      Ramesh Yuvashree

      Hello Orla!

      This series has been really helpful in understanding all about Predictive Analytics. I am trying to work on the financial predictive models available - FIN_STATEMENT_INSIGHT_APP_1 and FCLM_ALI, but I am unable to find documentation around its functioning and  usage. Are they part of PAi or are they an added service?

       

      Thanks,

      Yuvashree

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Yuvashree,

       

      Financial Statement Insights is an add-on to S/4HANA. You can find some good information in this blog:

       

      https://blogs.sap.com/2019/01/07/gain-smart-guidance-for-financial-statements-with-machine-learning/

       

      Or on the official page:

      https://www.sap.com/uk/products/statement-insights.html

       

      Thanks,

       

      Orla

      Author's profile photo Tian Lin
      Tian Lin

      Hi Orla, very informative sharing, thank you very much.

      Just want to clarify more:

      1. How is the Training Data Set defined, what and where are these data set?
      2. For the case of the out-of-the-box predictive scenario, we do not need an Apply Data Set is it? Once the model is activated, the corresponding application(which is prebuilt in S/4) will also start to incorporate information of the predicted results, and is it real-time?
      3. When do we need to use Apply Data Set?

      Thank you!

      Lin Tian

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Lin,

       

      The training and apply data set are defined as CDS views in the Predictive Scenarios Friori tile. Within the tile you can see details of all of the fields used to both train and apply the model.

      The apply data set is already connected to a business scenario in the out of the box use cases. For new use cases you can see the API details of the Predictive Scenario (i.e. ABAP Class and CDS view)  in the Predictive Scenarios Fiori tile.

      Thanks,

      Orla

      Author's profile photo Hitesh Kapadia
      Hitesh Kapadia

      Hi Orla,

      How can we look at the data in the Training Data set e.g. P_MATERIALOVERDUESITPREDICTION?

      Thanks

      Hitesh Kapadia

      Author's profile photo vrushali akre
      vrushali akre

      Hi Orla,

      We have created & Published customised new predictive Scenario in S4HANA 1809 system.

      In the API details we could able to see the "abap.applyclass" details, But unable to see "abap.applyview" details.

      The background is to use predicted output for further analytics

      Can you please guide how to get the view details / predicted output for reporting

      Thanks

      Regards,
      Vrushali Akre

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Vrushali,

      You need to ensure you have entered an Apply View when finalising the Predictive Scenario. Also if you did do this it can take a few minutes to appear.

      Thanks,

      Orla

       

      Author's profile photo Rauf Shaikh
      Rauf Shaikh

      Hello Orla,

      First of all thank you for the detailed blog series.

      My query is regarding Predictive Models and Prediction Scenario Tiles.

      I have assigned Front End Role SAP_BR_ANALYTICS_SPECIALIST to user but We are getting only Predictive Models tile under Predictive Models group on fiori launchpad and Predictive Scenario tile is missing.

      I followed below link as well and system says catalog SAP_CA_BC_ANA_UMM_PSC is missing in our system. We are on S/4 HANA 1709.

      https://help.sap.com/viewer/6b356c79dea443c4bbeeaf0865e04207/1909.000/en-US/59f9938c9db442938081efb9a0b856cf.html

      Can you please help?

      -Regards

      Rauf Shaikh

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Rauf,

      The Predictive Scenario tile was only added with S/4HANA 1709 EHP1.

      Thanks,

      Orla

       

      Author's profile photo Hemant Thopte
      Hemant Thopte

      Hi Orla,

      We are on S/4 HANA 1709 SP 02, still Predictive Scenario tile is missing.

      In fact the Fiori Catalog contained by role SAP_BR_ANALYTICS_SPECIALIST is having only Predictive Models tile. Please help.

      -Regards,

      Rauf

      Author's profile photo Sudarshan Survepalli
      Sudarshan Survepalli

      Hi Orla,

       

      We are on SAP S/4HANA CLOUD 1911 Client Role: Test. Am not able to see the Predictive Scenario's tile appearing in my system. 

      Also, while trying to retrain any scenario, I keep getting this error. have assigned all available authorizations to the user. Please can you guide.

      Missing authorization: activity(&01&) entity(&MVERSION&) scenario(&SLSQTANPREDICTION&)
      Missing authorization: activity(&01&) entity(&MVERSION&) scenario(&SALESVOLUME001&)

       

      Thanks

      Sudarshan

      Author's profile photo Orla Cullen
      Orla Cullen
      Blog Post Author

      Hi Sudarshan,

       

      Can you check you have the ANALYTICS SPECIALISTS role?

       

      If so you can search for the Predictive Scenario tile and add it to the Predictive Models Tab.

       

      If you still can't train a model can you raise a ticket and the team will take a look.

       

      Thanks,

       

      Orla

       

      Author's profile photo M Depa
      M Depa

      Hi Orla,

      Thanks for sharing blog well explained and very formative to start working S/4 HANA machine learning..Is Predictive Scenario tile will be available only in S/4 HANA 1709 SP 02.

      If I have S/4 HANA 1809 still this tile is applicable all relevant roles are added,  if not what should I do. I did not get the system yet probably next week I need to start working...

       

      Thanks,

      Author's profile photo Bradly Ali
      Bradly Ali

      Trying to train model Project Forecast at S/4 HANA 1809 On Premise, seems its not working . Is this PAI availaible On Permise ?

      And which App can we used to view the train model.