Previewing Your Application

Objective

After completing this lesson, you will be able to preview your application

Preview Your Application

Business Scenario

We are in the process of developing a cloud application based on various SAP Technologies. The used technologies start with database services, we use user interfaces, including the SAP Cloud Application Programming Model (CAP), SAP Fiori, SAP Mobile Development (MDK), and others. The more complex the system becomes, the more urgent demand is there to preview and test it. To conduct an entire deployment might be a choice, but it can be time-consuming and prerequisites-demanding. Therefore, a fast, efficient, and convincing approach is required to carry out previewing.

In this exercise, you will perform the following tasks:

  • To preview your application, get familiar with the central entry and available choices.
  • Choose to preview with the default configuration to verify the behavior of your app during runtime with sample data for external services.
  • Create a new configuration, which enables live data for external services, and choose to preview this new configuration to experience the hybrid data sources of your app, without deploying your app onto the cloud.

Prerequisites

You have successfully completed the exercise: Create a responsive application user interface.

The exercise Add sample data is optional but recommended to be accomplished, since it's a prerequisite if you want to observe the differences between sample data source and real data source.

Note

Note that some of the services that this learning journey links to can incur costs.

Task 1: Check the Run and Debug Button

Steps

  1. Check the Run and Debug button.

    1. Select the Run and Debug button from the right top corner of the Storyboard tab. Here you find a group of buttons, including the Run and Debug button.

      System screenshot
    2. In the preview menu, choose the Run RiskManagement-1 choice, which was created along the project.

      In this configuration, by default, all the data sources will be locally mocked with sample data. System screenshot

    3. A terminal at the bottom will appear, with a dynamic output, which indicates the task execution details.

      System screenshot
    4. Later on, the debug console will be focused with the progressive running status, meanwhile, a menu with several buttons including a button to stop the preview will appear in the middle of the upper part of SAP Business Application Studio.

      System screenshot
    5. Once the background process finishes, the console will display the target link to preview the app, as shown in the green rectangle.

    6. By moving your mouse cursor above the link, you will see the suggestion to open the link by Ctrl + Click or Cmd + Click, depending on your operating system.

      System screenshot

      The same page will also be opened automatically, if not blocked by your browser. If the page does not open, check the pop-up blocker of your browser.

Task 2: Perform a First Preview

Steps

  1. Check the buttons of the service entities.

    1. In the newly opened preview page, choose the buttons of the service entities on the right side.

      • For example, by choosing the syntax icon in the orange rectangle right to the risks service entity, you can preview the data for risks in the form of a raw data content. System screenshot
      • The result will be populated with the sample data you've created in previous exercises.
      • For the A_BusinessPartner entity, it is the same.
  2. Check the tile of Web Application.

    1. In this preview page, choose the tile of Web Application on the left side. (As shown in orange rectangles)

      System screenshot
    2. The result will be populated with the sample data you created in previous exercises.

    3. Once complete, you can stop the current round of preview, by choosing the Stop button.

      System screenshot

      Note that after choosing the Stop Preview button, it is restored into its former Preview menu button status.

Task 3: Check with the Live Data Choice

Steps

  1. Create a Run configuration.

    Use the following data:

    FieldValue
    Databaselocal
    AuthenticationDummy
    OData Data TypeLive Data
    SAPUI5Default

    1. In the menu on the left side of SAP Business Application Studio, select Run Configurations

      System screenshot
    2. Select the + icon in the upper right part of the Run Configurations menu to create a new configuration.

      System screenshot
    3. From the What would you like to run? menu, select the entry matching your project (as shown in the following screenshot).

      System screenshot
    4. You can modify the configuration name according to your preference. Here, we plan to conduct the live data previewing, so we can call it Run RiskManagement with Live Data.

      System screenshot

      A new screen opens where you can define the run configuration.

    5. Add the data as described in the preceding table.

    6. In the oData section, Live Data should be selected as the Data Type. Automatically, a new field to configure the Destination of the BusinessPartnerA2X service will be shown. Verify that its content was pre-filled with the apihub_sandbox choice and the Path for BusinessPartnerA2X service destination is s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER. Leave all other configurations as default.

      System screenshot
    7. Now, a new configuration called Run RiskManagement with Live Data is created, and it will adopt the live data for external service "BusinessPartnerA2X" according to the configuration.

      System screenshot
    8. To run it, choose the green triangle right beside the name of your new configuration, which now displays in the Run Configurations menu on the left side.

    9. In the Preview menu, choose Run RiskManagement with Live Data choice.

  2. Check the tile of the Web Application.

    1. Similarly to the previous preview, the procedure starts with a terminal in the bottom, then a debug console, and finally ends up with the preview page.

      System screenshot
    2. In this Preview page, choose the tile of the Web Application on the left side to operate in the SAP Fiori Elements App, built previously.

    3. Choose Go to conduct filtering to show the list of items.

      System screenshot
    4. Now, entries of Risks will be retrieved depending on our data. Choose create to create a new entry.

      System screenshot
    5. A form of this entry displays. We need to enter data in the form as needed.

      System screenshot
    6. Choose the icon button right to the supplier_BusinessPartner field.

      System screenshot
    7. The live data of A_BusinessPartner will be shown. This is retrieved from the live data source behind the destination, which we have configured before this round of preview. We can select any row of entry.

      System screenshot
    8. The real entry from live data will be filled. Choose the Create button at the bottom.

      System screenshot
    9. The new entry of Risks was created.

      System screenshot
    10. Return to the list view. Now, we can see our newly created entry with the association to another entry from the real data source.

      System screenshot
Practice System

Reference Links: Preview Applications

To read more about previewing applications, see: Testing Applications

Log in to track your progress & complete quizzes