This repository provides a set of tools designed to facilitate Artificial Intelligence capabilities within ABAP environments.
-
Multi-Provider LLM API Support: ABAP AI tools support seamless integration with multiple large language model APIs, giving you flexibility in choosing your provider and deployment model. The list of supported APIs will continue to grow as the project evolves. Currently supported APIs include:
-
Conversation Management: Maintain and manage multi-turn conversations, with full access to conversation history for advanced chat scenarios.
-
Tool/Function Calling: Integrate ABAP business logic with LLMs using function/tool calling, allowing AI models to trigger ABAP methods.
-
Retrieval-Augmented Generation (RAG): Enhance LLM outputs by incorporating enterprise data, enabling more accurate and relevant answers through retrieval-augmented generation workflows.
-
AI Agents Development: The ABAP AI tools now have the same features as the ABAP AI tools Cloud version, with a primary focus on AI Agent development. All tooling is specifically designed to support ABAP developers in building and testing AI Agents.
These features empower you to build intelligent, enterprise-ready ABAP applications that leverage the latest advancements in AI.
ABAP AI tools Cockpit Configuring AI agents in ABAP AI tools involves maintaining a bunch of database tables. To make this whole process easier, the ABAP AI tools Cockpit was built. It’s a frontend application designed to streamline the development of AI agents created with ABAP AI tools.
ABAP AI tools User Interface The ABAP AI UI repository provides interfaces to interact with LLMs directly from your SAP system.
ABAP AI Chat
ABAP AI Code Assistant
You can install the ABAP AI tools into your SAP system using abapGit.
Disclaimer: ABAP AI tools is released under the MIT License. It is provided "as is", without warranty of any kind, express or implied. This means you use these tools at your own risk, and the authors are not liable for any damages or issues arising from their use.
- ABAP 7.52+: You need an SAP system running ABAP version 7.52 or higher.
- abapGit: Ensure that
abapGitis installed and configured in your ABAP system. If not, you can find the latest version and installation instructions on the official abapGit website: https://docs.abapgit.org/ - Developer Access: You need appropriate developer authorizations in your ABAP system to import objects.
1 - Open abapGit: In your SAP GUI, execute transaction ZABAPGIT (or the equivalent transaction code you have set up for abapGit).
2 - Add Online Repository:
- Click on the
+button (Add Online Repo) or select "New Online" from the menu.
3 - Enter Repository URL:
- In the "URL" field, paste the URL of this GitHub repository:
https://github.com/christianjianelli/yaai.git - For the Package, we recommend creating a new package called
YAAI. Remember to assign it to a transport request if necessary. - Click "OK" or press Enter.
4 - Clone Repository:
abapGitwill display the repository details. Review the objects that will be imported.- Click the "Clone" button (often represented by a green download icon).
5 - Activate Objects:
- Once the cloning process is complete,
abapGitwill list the imported objects. - Activate any inactive objects if prompted.
6 - Verify Installation:
- After activation, all the
ABAP AI toolsobjects (interfaces, classes, etc.) will be available in your specified package. You can verify this by checking transactionSE80for the package you used.
7 - Basic Setup:
- Open the class
ycl_aai_basic_setupin Eclipse and run it (press F9). This will populate theYAAI_API,YAAI_MODEL, andYAAI_TOOLtables.
You have now successfully installed the ABAP AI tools!
This quickstart demonstrates how to create a simple LLM application. It shows you how to connect to the LLM and perform a basic chat interaction.
Requirements:
-
You have a valid OpenAI API Key.
-
Import OpenAI server certificates into SAP trust manager. The abapGit documentation explains in detail how to do it.
Note: To run the application on SAP NetWeaver AS ABAP Developer Edition, we recommend using NGINX as a reverse proxy to expose a local HTTP endpoint—it’s much simpler than manually configuring SSL on the SAP system.
Steps:
- Create an ABAP AI Connection instance;
- Set the Base URL;
- Set the API Key;
- Create an ABAP AI OpenAI instance;
- Call the CHAT method.
Complete Example:
REPORT yaai_r_simple_llm_app_openai LINE-SIZE 500.
START-OF-SELECTION.
DATA(o_aai_conn) = NEW ycl_aai_conn( ).
" The hardcoded base URL in this example is intended for testing and development only.
o_aai_conn->set_base_url( i_base_url = 'https://api.openai.com' ).
" The hardcoded API key in this example is intended for testing and development only.
" Hardcoding API keys directly into your ABAP code is highly discouraged.
o_aai_conn->set_api_key( i_api_key = 'REPLACE_THIS_TEXT_WITH_YOUR_OPENAI_API_KEY' ).
DATA(o_aai_openai) = NEW ycl_aai_openai( i_model = 'gpt-5' i_o_connection = o_aai_conn ).
o_aai_openai->chat(
EXPORTING
i_message = 'Hi, there!'
IMPORTING
e_t_response = DATA(t_response)
).
" Display the LLM response on the screen
LOOP AT t_response INTO DATA(l_response_line).
WRITE: / l_response_line.
ENDLOOP.Result:
The following screenshot shows the output you can expect after running the example ABAP AI report. The response from the LLM will be displayed line by line in the SAP GUI output window.
The ABAP AI Chat stores all conversation exchanges in memory. At any time, you can retrieve the full conversation history, allowing you to review previous messages or continue the dialogue seamlessly.
REPORT yaai_r_simple_llm_chat_openai.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_model TYPE string DEFAULT 'gpt-5' LOWER CASE VISIBLE LENGTH 20,
p_prompt TYPE string DEFAULT 'What is the capital of France?' LOWER CASE VISIBLE LENGTH 50.
SELECTION-SCREEN: SKIP 1,
BEGIN OF LINE,
PUSHBUTTON 68(10) button USER-COMMAND cli1,
END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
"Set text for the selection screen fields and button
%_p_model_%_app_%-text = 'Model'.
%_p_prompt_%_app_%-text = 'Prompt'.
button = 'Send'.
DATA(o_aai_conn) = NEW ycl_aai_conn( ).
o_aai_conn->set_base_url( i_base_url = 'https://api.openai.com' ).
" The hardcoded API key in this example is intended for testing and development only.
" Hardcoding API keys directly into your ABAP code is highly discouraged.
o_aai_conn->set_api_key( i_api_key = 'REPLACE_THIS_TEXT_WITH_YOUR_OPENAI_API_KEY' ).
DATA(o_aai_openai) = NEW ycl_aai_openai( i_model = p_model i_o_connection = o_aai_conn ).
AT SELECTION-SCREEN.
o_aai_openai->chat(
EXPORTING
i_message = p_prompt
).
DATA(json) = /ui2/cl_json=>serialize(
EXPORTING
data = o_aai_openai->get_conversation( )
compress = abap_true
pretty_name = abap_true
).
IF json IS NOT INITIAL.
cl_demo_output=>display_json( json ).
ENDIF.Result:
The following screenshots show the output you can expect after running the example ABAP AI Chat report.
Now that you've run your first ABAP AI applications, consider exploring additional features. 😊
To get started with your preferred API, check out the dedicated guides:
- OpenAI: Learn how to use ABAP AI with OpenAI models.
- Anthropic: Learn how to use ABAP AI with Anthropic models.
- Google Gemini: Learn how to use ABAP AI with Google Gemini models.
- Mistral: Learn how to use ABAP AI with Mistral models.
- Ollama: Learn how to use ABAP AI with with local or self-hosted Ollama models.





