Skip to content

Latest commit

 

History

History
 
 

develop-application

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Develop Risk Management Application Using SAP Business Application Studio Visual Tools

Introduction

In this section you will first create your development environment in SAP Business Application Studio. Then you will use the created environment to develop the sample application:

  • Create data models
  • Define relationships between the entities
  • Upload test data
  • Build a user interface to display the data
  • Add role concept to define different authorizations

Develop Risk Management Application

Open Low-Code Development Tools and Create Development Project

  1. Go back to your subaccount in SAP BTP Cockpit and navigate to Instances and Subscriptions in the menu on the left side of the screen.

  2. Find SAP Business Application Studio in the application section and choose the browser icon to open the app.

  3. In home page of SAP Business Application Studio choose button Create Dev Space to start

    A dev space in SAP Business Application Studio is a development environment with the tools, capabilities, and resources needed for developing your application.

  4. Enter a name for your Dev Space for example, Riskmanagement and select Low-Code-Based Full-Stack Cloud Application in menu.

  5. Choose Create Dev Space

  6. Your Dev Space is now being created and as soon as status change to Running you can open your Dev Space by clicking on the name

  1. In the pop-up enter a unique Project Name, for example, Riskmanagement_sap (replace sap with unique identifier) and provide a Short Description.

  2. Finish by choosing Create.

Loading SAP Business Application Studio for low-code development can take some time, especially if it’s the first time you use it.

Start Development of Application and Create Data Model

Now you can start the development of your application. First you will model your application and define the database table and the relationship between the entities.

  1. In this application two Data Models 'Risks' and 'Mitigations', to hold the data are needed. To create a Data Model open SAP Business Application Studio under tab Home, look for the tile Data Models and choose the + icon to add a new entity.

  2. Enter the Entity Name Risks. Retain the property ID and choose the + icon in the table to add the following properties:

    Property Name Property Type Max Length
    title string 100
    prio string 5
    descr string 100
    impact integer
    criticality integer
  3. Choose Create.

  4. Back in the Data Model Editor, choose the Add Entity button in the menu on the top to add another entity. Enter the Entity name Mitigations. Retain the property ID and choose the + icon in the table to add following properties:

    Property Name Property Type Max Length
    description string 100
    owner string 100
    timeline string 100
  5. Choose Create to finish.

  6. Now, you can see two entities in the Data Model Editor. In a next step you will describe the interconnection between those entities by defining a relationship, so each risk has a mitigation associated to it. Find the entry of Risks and click on the header of the table. Choose Add relationship Icon in the menu appearing on the right. Connect the appeared line to Mitigations entity, by clicking on table and configure the relationship in pop-up.

  7. In the pop-up screen enter all the required details:

    • Select Relationship: Association

    • Select Relationship Type: To-one

    • Enter Property name: miti

  8. Choose Create.

  9. Repeat the previous step for Mitigations. Click on the header of the table to add relationship. Connect the appeared line to Risks entity, by clicking on table and configure the relationship in pop-up.

  10. In the pop-up screen select all the required details:

  • Relationship: Association

  • Relationship type: To-many

  • Property Name: risks

  • Backlink Property: miti

  1. Choose Create.

  2. Back in the Data Model Editor, choose Import at the top bar.

  3. In the dropdown, select Common Types from the list.

sap.common provides predefined easy-to-use Types, Aspects and Code Lists that can be used in the application to foster interoperability.

  1. In the pop-up, select sap.common from the list and choose Select to finish.

  2. Go Back in the Data Model Editor on clicking home icon

  3. Click on the header of the Risks entry and then choose the Include Aspects icon in the appeared menu. This allows to flexible extend definitions by new elements as well as overriding properties and annotations.

  4. In the pop-up, choose global.managed from the list

  5. Choose Select. The global.managed aspect allows to track changes made in the data.

  6. Repeat the steps for Mitigations. Click on the header of the Mitigations entry and choose the Include Aspects icon in the appeared menu.

  7. In the pop-up, choose global.managed from the list and choose Select.

Create Services

Now you will create service entities for Risks and Mitigations to define which parts of the data models you just have created should be exposed to the application.

  1. Go back to the home page of the application. Find the Services tile and choose the + icon to add a new service entity.

  2. On the next screen, enter the following and choose Create to finish:

    • Enter Name: risks
    • Select Namespace: "riskmanagement_< UniqueName >Service"
    • Select Type: "riskmanagement_< UniqueName >.Risks"
  3. In the screen Service Editor, find the risks entity and choose header of entry. A menu will appear on the right side of the screen. in section Property Sheet check the checkbox for draft editing.

    Draft Editing allows to create new data for Risks in the draft mode with pre-defined handlers.

  4. Back in Service Editor choose Add Entity. Repeat the previous steps and configure the new entity and choose Create to finish:

    • Enter Name: mitigation

    • Select Namespace: "riskmanagement_Service"

    • Select Type: "riskmanagement_.Mitigation"

  5. Find the Mitigations entity and choose header of entry. A menu will appear on the right side of the screen. In section Property Sheet, check the checkbox for draft editing.

Add Sample Data

Once the structure of your application is finished, you can add sample data to the application. You either can use the visual data editor or insert data using a CSV file.

  1. Download the archive containing the sample data in CSV format and extract the files.

  2. Go back to the home page of the application. Find the Sample Data tile and choose + icon to add a new data entity.

  3. In the pop-up choose Import and select Risks in the Import for Entity field. Then choose Import.

  4. Import Riskmanagement-Risks.csv CSV file with the required data for risks.

  5. Similarly, import Riskmanagement-Mitigations.csv CSV file with the required data for mitigations.

Add User Interface

After defining the foundation of your application, we will add an SAP Fiori elements based User Interface to the application.

  1. Go back to the home page and find the User Interface tile and choose the + icon to add a new user interface.

  2. A screen will show up where you can add the Application Name: Risks and enter a description. Choose Next.

  3. Select UI Application type as Template-Based, Responsive Application to create a SAP Fiori elements based UI. Choose Next.

  4. Choose UI application template as list report object page. Choose Next.

  5. Select main entity risks in as main entity in Data Objects, to show risks entity in UI. Choose Finish.

  6. Repeat the steps 1–4 for Mitigations.

  7. Select main entity mitigation in as main entity in Data Objects, to show mitigations entity in the UI and choose risks as navigation entity. Choose Finish.

Create User Roles

Now, you can create roles to define different authorization for your application. For example you might want to ensure that some people can view data, but are not able to edit them.

  1. Go back to the home page of the application. Find the User Roles tile and choose the + icon to add a new role.

  2. Enter a role name, for example, RiskViewer. Enter a description and choose Read as Privilege Defaults. Choose Save.

  3. Choose your created role and select your created service in the Service Assignments field. Choose Add Service Entities.

  4. In the pop-up, switch on the assign toggle button for risks and mitigations. Check if slider for privileges is selected as read. Choose Save.

  5. Go back to User Roles and choose the + icon to add a new role. Enter a role name, for example, RiskManager'. Enter a description and choose Full as Privilege Defaults. Choose Save.

  6. Choose your created role and select your created service in the Service Assignments field. Choose Add Service Entities.

  7. In the pop-up, switch on the assign toggle button for risks and mitigations. Check if slider for privileges is selected as full. Choose Save.

Summary

You now have developed your first application with SAP Business Application Studio visual tools. In the next section you will test the application.

Need help? Look at the Troubleshooting Guide or use mission support to connect with mission experts.