Optimizing the Performance

Objectives

After completing this lesson, you will be able to:
  • Remove an Entity Set
  • Optimize OData Query

Entity Set Removal

You can optimize the performance of the mobile application by limiting the data downloaded. One way to limit the data download is to prevent download of unused entities via Removing Entity sets.

For example, Time recording can be configured in one of two ways: TimeSheets (CATS) or Labor Time. At any given time, one of these is enabled, but not both. The standard Asset Manager application is configured for TimeSheets. However, data from both EntitySets are downloaded to the application. This is for convenience. To switch to Labor Time, you only need to make a change in the Mobile Configuration Panel. You don't need to make a change in the metadata.

However, this convenience has a cost. Even though they are not used, all Labor Time entries are downloaded to the application. If this EntitySet has a lot of entries taking up significant time during the initial synchronization, then this EntitySet can be turned off.

Remove an Entity Set to Improve Synchronization Performance

Note

The steps below are giving a guide so that you can perform this exercise in your own system landscape.

Task 1: Remove an Entity Set

Steps

  1. Open the Mobile Application Configuration Panel.

    1. Use transaction Code/SYCLO/CONFIGPANEL to open the Mobile Application Configuration Panel.

    2. Navigate to Component Assignment.

    3. Use the Mobile Application Filter to filter the mobile application.

    4. Choose on the Mobile Application to launch the Component Assignment:

      1 - Select a Mobile Application Filter from the dropdown. 2 - Select the Mobile Application
  2. Remove PM confirmations Entity set from MT persona synchronization.

    1. Choose the User Personas tab.

    2. Choose the Change button.

    3. Choose the User Persona tab.

    4. Set filter for User Persona = MAINTENANCE_TECHNICIAN.

    5. Set Display Option = Show only Enable.

    6. Choose App Feature ID = PM_CONFIRMATION.

    7. Set Active Flag = Clear.

      1 - Change, 2 - User Personas tab. 3 - User Persona dropdown, 4 - Display option dropdown, 5 App Feature ID list, 6 - Action Flag checkbox.

      Note

      1. Since the App Feature itself is unassigned from User Persona, all oMDOs and related EntitySets are excluded from the Sync.
      2. However, you unassign individual oMDOs from the App Feature and the corresponding EntitySets are not included in the Sync.

      The following oMDOs are assigned to the App Feature PM_CONFIRMATION and as a result of the unassigning the App Feature from User Persona, these oMDOs are excluded from subsequent Sync.

      Screenshot of the Application Assignment Definitions screen. The oMDO tab is selected.
    8. Choose Save.

    9. When prompted for the transport, choose the default transport from previous exercises.

    10. Choose Save.

Task 2: Test Your Change on Your Mobile Device

Steps

  1. Test your change on your mobile device, reset the Mobile application and carry out a new synchronization to see if the performance is improved.

    1. On the main page, choose the Profile icon.

      Choose the Profile icon.
    2. Choose the Reset button.

      Choose Reset.
    3. Choose OK to confirm.

      Choose OK.

      Note

      You can apply this process to other EntitySets. However, further metadata changes can be necessary so that the deleted EntitySet is not referenced in the application. For example, if the Equipment EntitySet is turned off, then Equipment-related information must be removed or hidden on all screens. In the preceding example, the standard configuration of AssetManager ensures that, when Labor Time is disabled, Labor Time related information is already hidden in the application.

OData Query Optimization

Indexes have a downside. They are generated during the initial sync when the data is being downloaded to the application. This additional process results in a slight performance degradation during the initial download of data from the back-end. This is why the standard configuration only contains a few indexes that are deemed most important.

Optimize OData Queries

Note

The steps below are giving a guide so that you can perform this exercise in your own system landscape.

Steps

  1. Change the Mobile Client Work Assignment behavior via Mobile Application Parameters.

    1. Log in to the Config Panel with transaction /n/syclo/configpanel.

    2. Navigate to Mobile Application Configuration.

    3. If necessary, use the Filter to restrict your App = IAM150_##, otherwise, simply select the app on the left side.

    4. Choose Change.

    5. Navigate to the Parameters tab.

    6. Choose the Parameter Group table column heading and set the filter = ASSIGNMENTTYPE.

    7. Choose the row with the parameter name Work Order.

    8. Set the parameter value to 6.

    9. Clear the Use Rule checkbox.

    10. Choose Save.

  2. Change the Data Distribution of Work Orders via Config Panel.

    1. Log in to Config Panel Transaction /n/syclo/configpanel

    2. Navigate to oData Channel Integration SettingsoData Mobile Data Object Configuration.

    3. User Filter to restrict your App = IAM150_##

    4. Choose oMDO for Work Order ZIAMxxxx_WORK_ORDER_GENERIC

    5. Choose Change.

    6. Navigate to the Data Filter tab.

    7. Choose Filter READData DistributionWO_ASSIGNMENT_TYPE.

    8. Set the filter Rule Type to Static Value in Range Table Format.

    9. Change the value in dropdown for "Low Value = 6 (Operation/Task Level Work Center).

    10. Choose Save.

      Note

      This distribution model can download many operations in SAP Service and Asset Manager. This can cause the Operations page to take a long time to load.
  3. Assign the User Parameter for Work Center.

    1. In SAP GUI, go to transaction SU3.

    2. Navigate to the Parameters tab.

    3. Configure parameter VAP = T-ME00.

  4. Get the new set of operations.

    1. Reset SAP Service and Asset Manager.

    2. Log in to the client.

    3. On the Main Page, choose the Profile icon.

      Result

      Choose the Profile icon.
    4. In the dialog box, choose Reset.

      Result

      Choose Reset.
    5. In the dialog box, choose OK to reset.

      Result

      To confirm, choose OK.
    6. After the client reset, log in to the App. On the Main page you observe Operations section along with Notifications & Equipment.

    7. Choose the Operations section on the main page to view the operations.

  5. View the EntitySet for this list.

    Use the following information:

    Metadata file: WorkOrderOperationsListView.page.

    1. In SAP Web IDE, navigate to within the /SAPAssetManager project choose Pages \WorkOrders\Operations\ WorkOrderOperationsListView.page.

      Screenshot showing the folder path in SAP Web IDE.
    2. Right-click on the file provided in the step.

    3. To open the metadata file, choose Open Code Editor.

    4. In the metadata file, under the Target section, view the target object for EntitySet.

      Screenshot highlighting the EntitySet in the code.

      Result

      The EntitySet for the list is in the OperationsEntitySet.js file.
  6. Find the entity that must be indexed.

    Use the following information:

    File: OperationsEntitySet.js.

    1. In SAP Web IDE, navigate to /SAPAssetManagerRulesWorkOrders\Operations\OperationsEntitySet.js.

      Right-click the OperationsEntitySet.js file.
    2. Right-click on the file provided in the step.

    3. To open the file, choose Open Code Editor.

      Result

      The EntitySet that must be indexed is MyWorkOrderOperations.

      The MyWorkOrderOperations EntitySet is highlighted in the code.
  7. In Mobile Services, add an index for this EntitySet.

    1. Go to the SAP BTP Mobile Services.

    2. Expand the Mobile Applications section and select Native/Hybrid.

    3. Select the application SAP_Asset_Manager_IAM150_## from the list.

    4. On the application details page, choose the Info tab.

    5. To go to the Offline Configuration page, select Mobile Offline Access under the Assigned Features section.

    6. On the Offline Configuration page, choose the Edit button next to the destination name DEST_SAM2205_PPROP.

    7. On the Edit Offline Configuration dialog window, until the page with the Client Indexes displays, choose Next.

      Result

      There are several settings that can be configured here. For the purposes of this exercise, we only modify the indexes.
    8. To add a new index, choose Add.

    9. Enter the following data.

      IndexProperties
      Sap_mobile.MyWorkOrderOperationsOrderId
      The new index is added.
    10. Choose Next until the edit offline configuration process finishes.

  8. When running OData queries, to trigger the index, make the index property part of the orderby clause of the OData query.

    1. Back on the WorkOrderOperationsListView.page, view the WorkOrderOperationsListViewQueryOption.js file.

      Result

      The QueryOptions come from the WorkOrderOperationsListViewQueryOptionWrapper.js file.

      In the code, the QueryOptions line is highlighted.
    2. This can be a potential result on your mobile:

      Screenshot of a sample result on the mobile app.
  9. To decide if changes are required, view the OperationConstants.

    1. Follow the code to the OperationConstants class to the Project/SAPAssetManager and navigate to RuleWorkOrders/Operations/WorkOrderOperationLibrary.js.

      Result

      The code shows that the OrderId property is already part of the orderby clause. No change is required.

      Screenshot of the WorkOrderOperationLibrary.js code.

      Note

      If the property is not part of the clause, we must overwrite this file in the custom project and modify the query accordingly.
  10. Trigger the new index.

    1. Fully reset and resync Asset Manager.

    2. On the Main page, click on the Profile icon.

    3. Open the Profile page, choose Reset and choose OK to confirm the reset of the client.

    4. Fetch the new offline configuration setting.

Log in to track your progress & complete quizzes