10.2    Creating Fact Sheet Apps

In this section, we’ll highlight the steps required for creating a fact sheet app using an existing search model and OData service.

10.2.1    Create the Search Model

The processes for creating and extending a search model is very similar. In both cases, the system will take you through a similar sequence of screens to configure the search model. Therefore, refer to Section 10.3.1 on extending the search model for details.

To create a search model, simply select Create in the search and analytics modeler. To extend an existing search model, click Edit (see Figure 10.4). In Section 10.3.1, we’ll show you how to extend an existing search model by adding a new field.

Create or Extend Search ModelSearch and analytics modeler

Figure 10.4    Create or Extend Search Model

In this fact sheet creation process, we’ll assume that you already have a search model and have created a search connector, as we instructed in Chapter 5, Section 5.4. In the following sections, we’ll look at the necessary steps to create a search model by creating and adding the necessary software components. These steps are also relevant for extension.

Create the Software Components

Before you create or extend a search model, you first need to create a customer-specific software component. Similarly, this is also necessary for the extension process to include all the SAP-standard software components and enhance them.

Proceed with the following steps:

  1. Launch the search and analytics modeler tool by running Transaction ESH_MODELER from the ABAP system.
  2. Select Software Components, then click Maintain Software Components (see Figure 10.5).
    Search and Analytics ModelerSearch and analytics modeler

    Figure 10.5    Search and Analytics Modeler

  3. Create a software component by clicking Create (see Figure 10.6).
    Creating Search ConnectorSearch connector

    Figure 10.6    Creating Search Connector

  4. Enter a name in the New SW Comp field.
  5. In the Package Assignment field, assign a package by clicking inline image, as shown in Figure 10.7 (you can create a new package in the Object Navigator via Transaction SE80).
  6. Click Create to create the software component.
    New Search Connector Component

    Figure 10.7    New Search Connector Component

  7. You should now see the new software component in the list shown in Figure 10.8. Click Save.
    Saving Component

    Figure 10.8    Saving Component

  8. Next, you need to add the changes to a transport request. If a transport request exists, it will appear in the list, or you can create a new request by clicking Create (see Figure 10.9).
    Creating Transport RequestTransport request

    Figure 10.9    Creating Transport Request

  9. Select the Request ID, then click Select (see Figure 10.10).
    Assigning Transport Request

    Figure 10.10    Assigning Transport Request

  10. Save the software component by clicking Save (see Figure 10.11).
    Saving Software ComponentSoftware components

    Figure 10.11    Saving Software Component

Add the Software Component to the Customer-Specific Software Components

Next, you’ll add the software component to the customer-specific software components to enhance the model. Follow these steps:

  1. From the search and analytics modeler tool, select the new customer-specific software component, click Software Components, then select Include Software Component (see Figure 10.12).
    Including Standard SAP Component

    Figure 10.12    Including Standard SAP Component

  2. Select the existing software component that you want to refer to—in our example, it’s SAPAPPLH—and click Select (see Figure 10.13).
    Selecting SAP Software Component

    Figure 10.13    Selecting SAP Software Component

  3. On the next screen, you can resolve conflicts (i.e., when there are any object types with identical names, they’re displayed on this screen; the system automatically renames the technical objects and background functions).
  4. In our example, there are no conflicts, so click Close (see Figure 10.14).
    Resolve ConflictsConflicts

    Figure 10.14    Resolve Conflicts

  5. Select a transport Request ID, then click Select (see Figure 10.15).
    Assigning Transport

    Figure 10.15    Assigning Transport

  6. The software component SAPAPPLH will now appear below the customer-specific software component ZSAPAPPLH, as shown in Figure 10.16.
    Customer-Specific Software Component

    Figure 10.16    Customer-Specific Software Component

This completes the process of creating and adding the software components. As previously stated, the extension process is practically identical to creating search models. Therefore, refer to Section 10.3.1 for further information, or visit https://help.sap.com/saphelp_nw73/helpdata/en/b6/e51604ca9a480bb8d58111a837b4ae/content.html.

Creating an OData Service

In Chapter 7, we discussed the steps for creating an OData service. Simply follow the same process to do so again here.

10.2.2    Create the UI Layer

In this section, we’ll show you how to create a new fact sheet app on the sales order search model. We’ll use the CB_SALES_ORDER_SRV OData service (refer to Chapter 5, Section 5.2) to build the fact sheet app. Follow these steps:

  1. Log in to SAP Web IDE, and click New Project from a Template.
  2. You can either build an app using an existing fact sheet app or build the app from the scratch:
  3. For this example, select New Fact Sheet Application, then click Next (see Figure 10.17).
    New Fact Sheet Template

    Figure 10.17    New Fact Sheet Template

  4. Enter the Project Name and click Next (see Figure 10.18).
    Project Name

    Figure 10.18    Project Name

  5. Select the connection name, and search for “CB_SALES_ORDER_SRV”.
  6. Select the CB_SALES_ORDER_SRV service and click Next (see Figure 10.19).
    Data Connection

    Figure 10.19    Data Connection

  7. Enter the following details, as shown in Figure 10.20:
    • Main OData Entity: “SalesOrders”
    • Fact Sheet Name: “NB Sales”
    • Name: “VBELN_DESCR”
    • Additional Name: “SalesOrder”
    Click Next.
    Template FieldsTemplate

    Figure 10.20    Template Fields

  8. Click Finish.
  9. Double-click the CB_SALES_ORDER_SRV.anno file to open it in the fact sheet app editor (see Figure 10.21).
  10. Drag and drop fields from the Available Fields tab to the correct section in the design editor (see Figure 10.22):
    Annotation File

    Figure 10.21    Annotation File

    Drag and Drop Fields

    Figure 10.22    Drag and Drop Fields

  11. Save the project by clicking the Save button.
  12. Run the fact sheet app by right-clicking the ANNO file and selecting RunRun Fact Sheet (see Figure 10.23).
    Preview Fact Sheet

    Figure 10.23    Preview Fact Sheet

You should now see the new Sales Order fact sheet app, showing data from the back-end (see Figure 10.24).

New Fact Sheet

Figure 10.24    New Fact Sheet

We’ve successfully created a fact sheet app. Next, let’s discuss how to deploy the app.

10.2.3    Deploy the Fact Sheet App

In this section, we’ll deploy the project to the ABAP Repository by following these steps:

  1. Right-click the project and select DeployDeploy to SAPUI5 ABAP Repository (see Figure 10.25).
    Deploying to ABAP Repository

    Figure 10.25    Deploying to ABAP Repository

  2. Enter the Name and Description and select a Package. Click Next (see Figure 10.26).
    Application DetailsApplicationdetails

    Figure 10.26    Application Details

  3. Select the ABAP back-end system connection.
  4. Select the Deploy a New Application radio button, then click Next (see Figure 10.27).
    System Details

    Figure 10.27    System Details

  5. Click Finish.

You’ve successfully deployed a new fact sheet app to the ABAP Repository. Next, let’s check whether the app and the service were created in the ABAP back-end server. Follow these steps:

  1. Log in to the ABAP back-end server, and run Transaction SE80.
  2. Search for the “ZNBSALES” BSP application, and check whether the objects are created (see Figure 10.28).
    Project Files

    Figure 10.28    Project Files

  3. Check whether the service was created by running Transaction SICF and searching for the “ZNBSALES” service (see Figure 10.29).
    Fact Sheet Service

    Figure 10.29    Fact Sheet Service

  4. Provide access to the end user to the OData service that you used to build the fact sheet app. In Chapter 4, Section 4.4.2, we showed you how to assign a role to a user. You can follow the same process and assign the SAP_SD_SALESORDER_APP role to the end user (see Figure 10.30).
    Back-End Role

    Figure 10.30    Back-End Role

  5. The next step is to create a new launchpad and application using Transaction LPD_CUST. Refer to Chapter 4, Section 4.6 to complete the following steps:
  6. To create a new launchpad and application, you can use the existing Sales Order fact sheet app as a reference (see Figure 10.31) and use the details from Steps 2 and 3 of this section.
    Fact Sheet Launchpad

    Figure 10.31    Fact Sheet Launchpad

  7. Similarly, to create catalog and target mapping, you can use the existing Sales Order fact sheet’s target mapping details as a reference while creating target mapping (see Figure 10.32).

Now that you understand the end-to-end process to create a fact sheet app, let’s look at the fact sheet extension process.

Target MappingTargetmapping

Figure 10.32    Target Mapping