What if your SAP Fiori applications could anticipate your needs and provide intelligent suggestions to streamline your workflow? With the rapid advancements in artificial intelligence, integrating generative AI models into enterprise applications is no longer a distant future but a present opportunity to enhance efficiency and decision-making.
In this post, I'll share a practical demonstration of how I integrated a generative AI model into an SAP Fiori application using OpenUI5. This solution enhances the creation of maintenance orders by providing AI-generated suggestions based on the order's title and description, helping users avoid overlooking critical steps.
I developed a frontend application using OpenUI5, hosted on Vercel, that mirrors a maintenance order request interface in SAP Fiori. The key enhancement is the addition of AI-generated suggestions that appear as the user inputs the maintenance order's title and description.
You can test the live application yourself here: https://fiori-app-form.vercel.app/
These suggestions offer important steps for performing the task, effectively serving as a smart checklist to assist users in making informed decisions.
The integration with the generative AI model is achieved through HTTP requests to the local API. When the user enters the maintenance order's title and description, this data is sent to the API, which processes it and returns a list of suggested steps.
.route('/infer', methods=['POST'])
def infer():
"""Endpoint para gerar conteúdo com a API do Google."""
data = request.get_json(force=True)
if not data or 'prompt' not in data:
return jsonify({'error': 'No prompt provided'}), 400
try:
prompt_parts = [data['prompt']]
response = model.generate_content(prompt_parts)
output_text = response.text
except Exception as e:
logging.error(f"Erro na inferência: {e}")
return jsonify({'error': str(e)}), 500
return jsonify({'output_text': output_text})
The user interface is crafted to be intuitive and familiar for SAP Fiori users, which helps to reduce the learning curve. Standard OpenUI5 components are utilized to gather user input and present AI-generated suggestions.
<!-- Botão "Gerar Sugestões" -->
<Button id="generateSuggestionsButton" text="Gerar Sugestões" press="onGenerateSuggestions" class="sapUiSmallMarginTop" />
<!-- Lista de Passos Sugeridos -->
<Label text="Passos Sugeridos" class="sapUiSmallMarginTop" />
<List id="suggestionsList" width="80%" items="{suggestionsModel>/suggestions}">
<StandardListItem title="{suggestionsModel>}" />
</List>
Here's how the application works in practice:
Upon entering this information, the user receives immediate suggestions:
You can test the live application yourself here: https://fiori-app-form.vercel.app/
This practical demonstration highlights the potential of integrating generative AI models into SAP Fiori applications. While this example operates locally without OData communication, it showcases how AI can be leveraged to improve daily tasks and workflows.
I'm excited to hear your thoughts! Share your experiences, ideas, and questions in the comments.
Thank you for reading! If you're interested in more technical details or have any questions, feel free to reach out.
Feel free to connect with me here on the SAP Community or via LinkedIn. Let’s collaborate to make failure analysis smarter and more efficient!
LinkedIn: https://www.linkedin.com/in/bernardo-caldas/
SAP Fiori SAP AI Core SAP AI Launchpad Artificial Intelligence SAP Maintenance Assistant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |