Technology Blog Posts by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
PritiDhingra
Product and Topic Expert
Product and Topic Expert
1,530

Intelligent Scenario Lifecycle Management (ISLM) is a key enabler for integrating AI into SAP S/4HANA. With its latest enhancements, ISLM now facilitates  adoption of generative AI (GenAI), providing a centralized framework to manage both SAP-delivered and custom AI use cases. This allows organizations to transform core business processes by integrating large language models (LLMs) seamlessly within their business applications 

Key Capabilities 

  • Centralized AI Management:  ISLM offers an end-to-end framework to manage both pre-delivered and custom AI scenarios in SAP S/4HANA. It enables organizations to integrate and operationalize AI use cases efficiently, ensuring seamless lifecycle management. 
  • Integration with Large Language Models (LLMs): ISLM allows customers and partners to: 
    • Develop custom generative AI based use cases tailored to their business needs. 
    • Integrate business applications with LLMs for enhanced automation and decision-making. 
    • Enable prompt templating capabilities for effective GenAI model usage.
  • Connectivity to GenAI Hub:ISLM enables seamless connectivity to SAP’s Generative AI Hub.
  • ISLM and ABAP AI SDK Integration: ABAP AI SDK and Intelligent Scenario Lifecycle Management serve as integration components between business applications and large language models. Using  ABAP AI SDK powered by Intelligent Scenario Lifecycle Management (ISLM), you can easily embed generative AI capabilities into your custom ABAP based applications. ISLM and  ABAP AI SDK offer a low-code approach within ABAP stack, enabling seamless integration of generative AI models into your business applications. With the combined experience of ISLM and the ABAP AI SDK, customers can develop and deploy generative AI-driven use cases directly within their SAP S/4HANA environment.

    Blogs to Explore:

  • Support for Pre-Delivered GenAI Use Cases: ISLM provides support for SAP-delivered generative AI scenarios, for both RISE and GROW, ensuring customers can leverage pre-delivered AI capabilities with minimal effort. 

Learn more about the latest pre-Delivered AI use cases:

Supported Products

  • SAP BTP ABAP Environment as of release 2502 
  • SAP S/4HANA Cloud Public Edition as of release 2502
  • SAP S/4HANA Cloud Private Edition and On-Prem as of release 2021.  

    Based on SAP's strategy, new SAP-delivered AI use cases will be available only for cloud ERP with RISE with SAP and GROW with SAP. 

Downport to SAP S/4HANA Cloud Private Edition & On-Premise 

Following information is relevant for SAP S/4HANA Cloud Private Edition & On-Premise only

Downporting all the latest enhancements, including support for Generative AI, to  2021 and 2022 releases of SAP S/4HANA Cloud Private Edition and on-premise.

Support is offered from SPs:

  • 2021 FPS07 
  • 2022 FPS05 
  • 2023 FPS03 

ISLM on lower release SPs
Lower releases of SAP S/4HANA Cloud Private Edition and On-Premise are supported via Transport-based Correction Instructions (TCI). This provides customers access to the latest ISLM capabilities without requiring an SP update. 

Implement following SAP Notes:

Note: ISLM TCI must be implemented first, as it is a prerequisite for the ABAP AI SDK TCI.

Learn more about Transport-based correction instructions (TCI).

      Additionally implement following Notes delivering fixes for runtime API’s.  

Initial ISLM configuration Set up

Once TCIs are implemented you need to configure ISLM apps, Follow the steps outlined below to complete  ISLM app configuration:

Building Custom Generative AI Use Cases through ISLM 

Following information is relevant for SAP S/4HANA Cloud Private Edition & On-Premise only

Process_steps.jpg

With ISLM and ABAP AI SDK we offer an approach within ABAP stack to integrate GenAI models into your business application with a low-code approach. In ISLM you need to create an intelligent scenario which is representation of your AI use case. Using ISLM functionality you can perform lifecycle management operation and execute the prompts with a low code approach  with ABAP AI SDK APIs

Following example outlines key steps and flow for using the ISLM framework to create a Generative AI use case. In this example large language model (LLM) is used to generate summary and extract key insights from sales data, enabling ABAP developers to integrate AI-driven capabilities into their applications.

1) Creating Intelligent Scenario   

In this example, we walk through the steps to create a new intelligent scenario that uses a Large Language Model (LLM) to generate summaries and extract key insights from sales data.

Create Prediction Class: Prediction Class for Generative AI | SAP Help Portal  

Code Snippet:  

class ZCL_SOC_EMAIL_CONFIRMATION definition 
  public 
  final 
  create public . 
 public section. 
   interfaces IF_ISLM_INTS . 
  interfaces IF_ISLM_INTS_SBS_SAPGENAI . 
protected section. 
private section. 
ENDCLASS. 
  
CLASS ZCL_SOC_EMAIL_CONFIRMATION IMPLEMENTATION. 
 
 * <SIGNATURE>---------------------------------------------------------------------------------------+ 
* | Instance Public Method ZCL_SOC_EMAIL_CONFIRMATION->IF_ISLM_INTS_SBS_SAPGENAI~GET_SERVEFLOW_ENDPOINT_URI 
* +-------------------------------------------------------------------------------------------------+ 
* | [<-()] RV_URI                         TYPE        STRING 
* +--------------------------------------------------------------------------------------</SIGNATURE> 
  method IF_ISLM_INTS_SBS_SAPGENAI~GET_SERVEFLOW_ENDPOINT_URI. 
        rv_uri = '/chat/completions?api-version=2024-10-21'. 
  endmethod. 
  
* <SIGNATURE>---------------------------------------------------------------------------------------+ 
* | Instance Public Method ZCL_SOC_EMAIL_CONFIRMATION->IF_ISLM_INTS~GET_INFERENCE_TYPE 
* +-------------------------------------------------------------------------------------------------+ 
* | [<-()] RV_INFERENCE_TYPE              TYPE        ISLM_DE_INFERENCE_TYPE 
* +--------------------------------------------------------------------------------------</SIGNATURE> 
  method IF_ISLM_INTS~GET_INFERENCE_TYPE. 
     rv_inference_type = 'ONLINE_ONLY'. 
  endmethod. 
ENDCLASS. 

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.

001.jpg

 Click the Create button and choose Side-by-Side.

0.png

Provide the required information

Note: Enter the name of the Prediction class that you created in the ABAP system. Only a class that implements the IF_ISLM_INTS_SBS_SAPGENAI interface is allowed.

1.png

In the General Information area, enter a name and description.

2.png

In Prompt Specification enter dynamic parameters in the {ISLM_abc} format, where abc is the parameter name. For example, {ISLM_DynamicParameter}.

3.png

Enter values for the corresponding parameter that you specified in the Prompt field.

4.png

Create Using Generative AI | SAP Help Portal 

2) Setup connectivity to Generative AI Hub

Set up and provision the Generative AI Hub service in SAP BTP and obtain a service key. Use the service key to establish the connection. ISLM automatically generates the RFC destination and Outh configuration. There is also an option to verify the connection.

Perform following steps to make the Generative AI Hub in SAP AI Core service available and establish the connectivity between your ABAP system and SAP AI Core.

  • In the BTP cockpit, subscribe to the SAP AI Core service and add a service plan for generative AI. For more information, see the documentation for SAP AI Core: What is SAP AI Core? and Service Plans.
  • In the BTP cockpit, create a service instance and service key for SAP AI Core (see Creating a Service Instance and Key for SAP AI Core) based on OAuth 2.0-based authentication.
  • The service key provides URLs and credentials for accessing the SAP AI Core instance from the ABAP system. Upload the Service Key for ISLM to generate the connection artifacts. 

Maintain Connection for an Intelligent Scenario | SAP Help Portal 

  1. Enter transaction SPRO. Click SAP Reference IMG.
  2. Navigate to ABAP Platform -> Application Server  Basis Service ->   Intelligent Scenario Lifecycle Management  Service Connections for Machine Learning Infrastructure -> Maintain Connection for an Intelligent Scenario.

1.png

Enter the OAuth 2.0 client profile that you want to use for connecting to ML provider. Enter the service key from ML provider and click Next.

2.png

Test and save the connection.

3.png

4.png

3) Deploy and activate

Once the Intelligent Scenario is created, we can perform operations such as deployment and activation using Intelligent Scenario Management App.

Click Deploy.

2.png

 

3.png

You can now activate the deployment to consume the inference in your business application. You can activate deployment for your user or all users by selecting the For Me and For All options respectively. 

4.png

5.png

 Deploy and Undeploy | SAP Help Portal

Activate and Deactivate | SAP Help Portal

4) Consume inference Generate summary of Sales data using LLM

  • Instantiate the factory via class CL_AIC_ISLM_COMPL_API_FACTORY and method GET. This yields an instance of IF_AIC_ISLM_COMPL_API_FACTORY. 
  • The factory method CREATE_INSTANCE provides you with a new instance of the completion API (IF_AIC_COMPLETION_API). You must provide only the intelligent scenario name as this carries the information about the connection and the model. 
  • You can use the method GET_PARAMETER_SETTER to get an instance of IF_AIC_COMPLETION_PARAMETERS. This interface provides specific methods for selected parameters. The method SET_TEMPERATURE, for example, sets the temperature for LLM calls with the current API instance.  
  • Calling the completion APIs.  

EXECUTE_FOR_STRING: Provide the prompt as a string. 

EXECUTE_FOR_MESSAGES: Provide the prompt as a message list wrapped in a message container instance. Each message is classified as system role, user message, or assistant message. You can get an instance of the message container using the method CREATE_MESSAGE_CONTAINER. 

Sample coding : Calling the Completion API | SAP Help Portal

Execute for String

 FINAL(api) = cl_aic_islm_compl_api_factory=>get( )->create_instance( <your intelligent scenario name> ). 

FINAL(params) = api->get_parameter_setter( ). 

params->set_temperature( '0.5' ). 

FINAL(answer) = api->execute_for_string( 'How are you?' )->get_completion( ). 

Execute for Messages 

FINAL(api) = cl_aic_islm_compl_api_factory=>get( )->create_instance( <your intelligent scenario name> ). 

FINAL(messages) = api->create_message_container( ). 

messages->set_system_role( 'You are an ABAP expert' ). 

messages->add_user_message( 'Does ABAP support OO programming?' ). 

messages->add_assistant_message( 'Yes' ). 

messages->add_user_message( 'Can you build RESTful applications in ABAP?' ). 

FINAL(answer) = api->execute_for_messages( messages )->get_completion( ). 

By following these steps, you can easily start using Intelligent Scenario Lifecycle Management (ISLM) to bring Generative AI into your SAP S/4HANA business applications and unlock its full potential, and drive meaningful business transformation.

ISLM: Recommended Learning Resources

SAP Community Page: ISLM – SAP Community – Topic page

Webinar Replay : Integrate & Operate GenAI into SAP S/4HANA with Intelligent Scenario Lifecycle Mana...

Webinar Replay: Integrating Generative AI in SAP S/4HANA with ISLM

 

 

 

 

1 Comment