Create Intelligent Scenario
The Intelligent Scenarios app is used to create intelligent scenarios, review, and publish them, and to make them available in the Intelligent Scenario Management app. In this step, you’ll create a new intelligent scenario to generate the order confirmation email for Sales Order using LLM model.
- Open SAP Logon and logon to S4H system.
- Create a Prediction Class which defines the behavior of the scenario. Prediction class has methods to specify Inference type and metadata like end point URI for LLM Model.
Open transaction/nse24and search for the classZCL_SOC_EMAIL_CONFIRMATION
-
Click the Copy button.

-
Provide the unique name in the Copy to field. Enter a unique name starting with
ZCL, such asZCL_SLS_ORD_CONF_###, where ### is your attendee id mentioned in the cheat sheet. And click the tick icon.
- Click the Local Object button.

- The class is created in Inactive status. Click the Display button.

- View the following methods of the prediction class.
- IF_ISLM_INTS~GET_INFERENCE_TYPE: Using this method, specify the inference type that supports this intelligent scenario.
-
IF_ISLM_INTS_SBS_DAR~GET_SERVEFLOW_ENDPOINT_URI: Using this method, specify the end point URI of the LLM Model.
-
Click the Activate icon.

- Click the tick icon.

- Open the Fiori Launchpad by clicking here.
Click on Intelligent Scenario Management section and choose the Intelligent Scenarios app.
- Click the Create button and choose Side-by Side.

-
Provide the required information in the screen:
- Intelligent Scenario Name: Enter a unique name starting with Z, such as
Z_SLS_ORD_CONF_###, where ### is your attendee id mentioned in the cheat sheet. - Intelligent Scenario Description:
Generate sales order confirmation email - Intelligent Scenario Type:
Generative AI
- Intelligent Scenario Name: Enter a unique name starting with Z, such as
-
Select Prediction Class from value help.

-
Select the prediction class created by you in the previous section.

-
Click the Add Model button.

-
The Add Generative AI Model screen will pop up. Enter the below details:
- Name:
Z_SLS_ORD_CONF_MDL - Description:
LLM Model for generating SO email - Executable ID:
azure-openai - Large Language Model Name:
gpt-4o-mini
- Name:
-
Click the Add button.

-
Click the Add prompt templates button.

-
In the Add Prompt Template dialog, enter the below details:
- Name:
SYSTEM_PROMPT - Description:
Provide context to gpt-4o-mini model
- Name:
-
Enter the Prompt text:
You are a sales executive who is responsible for reaching out to customers for confirming or declining their orders via email. For the given sales order, evaluate the following: 1. Size of the delivery vehicle based on the number of items. 2. The distance between the source and destination location of delivery in kilometers. 3. The category of items which are ordered. Write an email in the following format: - The subject of email should be of format <Confirmation on order number: {order_number} placed on {booking_date}> - The body of email should be of format: "Sales order contains <Category> to be delivered to <Location>. The order will be delivered via a <size> vehicle. IF <distance between source address and delivery address> > 100 kms THEN include a message about potential delivery delays ELSE congratulate on being eligible for one day delivery
-
Click the Save button.

-
Click the Add prompt templates button.

-
In the Add Prompt Template dialog, enter the below details:
- Name:
USER_PROMPT - Description:
Provide sales order item data for generating the order confirmation email
- Name:
-
Enter the Prompt text:
Build a confirmation mail for a sales order containing {ISLM_Items}. The source address is {ISLM_Source} and the delivery address is {ISLM_Destination}.
-
Click the Save button.

-
The added prompt should be visible in the Prompt Templates table. Click the Save Draft button.

-
Navigate back to Intelligent Scenario by clicking the back button.

-
Scenario is now ready to be published. Click on Publish button. You will receive a message that Intelligent Scenario is published.

-
Search the Intelligent Scenario created by you by entering the Intelligent Scenario name and Status = Published.

Well done, you just created your first Side-by-side Intelligent Scenario.