PAi Blog Series 9: Creating models in SAP Analytics Cloud Smart Predict and Publishing to SAP S/4HANA On Premise
Welcome to the nineth installment of the PAi and S/4HANA Blog series. In our last blog, we took you through how to connect your S/4HANA Cloud system to SAP Analytics Cloud, create a model, and publish it back to S/4HANA.
As promised this week I will cover S/4HANA on-premise. The connection steps for Cloud and on-premise are different, so we are separating the steps avoids any confusion.
Note: For this week we will be focusing on S/4HANA On Premise (1709 EHP1 onward). I covered S/4HANA Cloud in my last blog. The connection steps for Cloud and on-premise are different, so separating the steps avoids any confusion.
Let’s get started with the initial steps required to do the following:
- Connect your S/4HANA On Premise system to SAP Analytics Cloud to import Datasets
- Connect SAP Analytics Cloud to your S/4HANA On Premise system so we can send new predictive scenarios back to S/4HANA.
|SAP Cloud Connector Administrator||ADMINISTRATOR||To manage system connections|
|S/4HANA Key User||SAP_BR_ANALYTICS_SPECIALIST||To manage Predictive Scenarios and Predictive Models|
· BI Admin
· Predictive Admin
|To configure connection settings|
|SAC Business User||Predictive Content Creator||Create Predictive Models|
1) Add S/4HANA On Premise as a datasource (import):
- In order to connect your S/4HANA On Premise system with SAP Analytics Cloud you will need to install the Cloud Connector. You can find details on how to do that in the Cloud Connector Installation Guide.
- Next you will need to add your SAP Analytics Cloud instance to your Cloud connector. On the Connector screen, select Add Subaccount.
- Enter Subaccount details and select save. For further details see the configuration guide
- Once complete it is time to add your S/4HANA On Premise system to the cloud connector as follows. Select the Subaccount you have just created.
- Select Cloud to On Premise tab and, select the Add button.
- Select backend type Other SAP System and, select Next
- Select Protocol type HTTP and, select Next
- Enter Internal host and port and, select Next
- Select principal type None and, select Next
- Add a description (optional) and, select Next
- Review Summary and, select Finish
- Check your S/4HANA system is reachable
- Configure which resources should be accessible
- You can limit which ever Resources (service URLs) are accessible as appropriate. You can learn more here. Or Select Path and all sub-paths and select save
- Next you logon in to you SAP Analytics Cloud system and, ensure you have the BI Admin role in order to configure datasource connections. Select Connections.
- Select Acquire data and datasource type SAP S/4HANA
- Enter your Connection name and details of your S/4HANA On Premise system, ensuring you tick the “Connect to an on premise S/4HANA” box and, select ok
2) Configure PAi Connection:
- While still in SAP Analytics Cloud connections page select the PAi Connection tab. Ensure you have the Predictive Admin role in your profile.
- Select Add new Connection and, complete details as follows and, select Test Connection
Name: Connection name
Description: Connection description
PAi Application URL: This is the ANA_PAI_PF_SRV you configured in Blog 2
Select “Use SAP Cloud Connector”
Client: Client of your S/4HANA application
Username & Password: Your username and password must have the Analytics Specialist Role assigned.
- Once the test connection is successful, select Save
The first thing you will need to do is acquire data from S/4HANA On Premise into SAP Analytics Cloud as a Dataset.
- From the main menu navigate to Create -> Dataset
- Select Data acquired from a datasource.
- Select SAP S/4HANA as the datasource type.
- Select your previously configured S/4HANA Data Connection, and select Next.
- Browse folders or search for your CDS view. Note your CDS view must be OData enabled.
- Once you have found your CDS view, select it.
- Select the fields, and apply filters to your dataset.
- Give the dataset a name, and save it to the required folder.
- You now have your new dataset, and can begin modeling.
Now you have data, and are ready to create a new predictive scenario in SAP Analytics Cloud Smart Predict. The dataset we have extracted from S/4HANA contains data about historical License Sales deals, and we are going to use this information to build a Regression model to forecast future License sales.
- From the main menu navigate to Create and Predictive Scenario.
- We can chose from Classification, Regression and Time Series, as Sam described in our previous Blog. In this example, we are going to do a Regression use case.
- Enter a name and description, and select Save.
- Select the button to create a Predictive Model.
- On the right-hand panel select the drop down for the Input Dataset, and navigate to the Dataset we acquired above.
- Select the target variable, and exclude variables as necessary.Select Save and Train.
- Depending on the volume of data in your dataset, training could take some time.
- We now have a trained model, and can review the relevant debriefing information.
- Once we are happy with our model,we can send it back to PAi in S/4HANA by selecting the Publish button.
- Select the relevant PAi Connection, and drop down to name the predictive scenario.
- Select the default package.
- Select New predictive scenario. Enter a name and description, and select OK and Publish.Note: A Predictive Scenario name length must not exceed 20 characters and can only contain uppercase alphabetic (A-Z), numeric (0-9) and underscore (_)
- Review your settings and select Publish
- You can monitor the progress of the publishing on the Predictive Models Tab.
You now have a new Predictive Scenario in S/4HANA On Premise in draft mode.
- In S/4HANA, navigate to the Predictive Models Tab, and Predictive Scenarios Tile. Details of how to do this can be found in Blog 3. You will see your new predictive scenario in “Draft” status.
- Select the new predictive scenario, and add your Training, and Apply CDS views.Once complete, select Publish.
- Your predictive scenario has now been published. You will find the API details of how you integrate your predictive scores in to your application here:
- Your predictive scenario is now ready to train and activate. You can find details on how to do this in our previous blog
Congratulations! You have now successfully created connections to and from SAP Analytics Cloud – Smart Predict and SAP S/4HANA On Premise, imported data, built a model, and exported it to S/4HANA.
In the coming weeks, we will be going through how you can integrate the API details above in to your S/4HANA system as a new Fiori tile…..so stay tuned!