Artificial Intelligence Blogs Posts
cancel
Showing results for 
Search instead for 
Did you mean: 
caldasbernardo
Explorer
1,861

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.

The Solution

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/ 

maintenanceRequest.png

 

MR-sugestions.png

 These suggestions offer important steps for performing the task, effectively serving as a smart checklist to assist users in making informed decisions.

Technical Details

Development Environment

  • Frontend: Built with OpenUI5 and deployed on the Vercel platform.
  • Backend: A locally running API utilizing a generative AI model (LLM) to process user inputs and generate suggestions.

Integration with AI

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})

 

 

 

 

Interface Implementation

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.

 

MR-sugestions.png

 

 

 

 

 

 

 

<!-- 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>

 

 

 

 

Demonstration in Action

Here's how the application works in practice:

  1. Title: "Air Filter Replacement"
  2. Description: "The air filter of the compressor needs to be replaced due to particle buildup."

Upon entering this information, the user receives immediate suggestions:

  • 1. Turn off the compressor and disconnect it from the electrical power.
  • 2. Locate the air filter, which is usually in a plastic or metal case.
  • 3. Loosen the screws or clips securing the air filter box.
  • 4. Remove the old air filter and inspect it for dirt and damage.
  • 5. Insert the new air filter into the housing and secure it with the screws or latches.
  • 6. Replace the air filter box on the compressor.
  • 7. Turn on the compressor and check for air leaks.
     
     

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!

LinkedInhttps://www.linkedin.com/in/bernardo-caldas/

SAP Fiori SAP AI Core SAP AI Launchpad  Artificial Intelligence SAP Maintenance Assistant