Performing Root Cause Analysis

Objective

After completing this lesson, you will be able to perform Root Cause Analysis

Overview of Route Cause Analysis (RCA)

  • The client itself: User applications run on iOS or Android devices.

  • The cloud middleware component: The SAP Business Technology Platform Mobile services SAP Business Technology Platform Mobile Services.

  • The on-premise back-end system (HUB or Embedded).

Similar to any multilevel landscape, there are different places to examine or analyze. Each offer their own capabilities and insights. Therefore, depending on the issue, it is important to know where to start. You can encounter technical and functional issues. Most functional errors pass back to the application end-through the solution framework. For technical errors, we must examine the system to see if the root cause can be identified and fixed or if it must be reported to SAP. Such root causes can be configuration issues, admin issues, or even known or unknown bugs.

Where to Start the Analysis

Usually, when you receive error reports, the first place to check are the SAP Business Technology Platform Mobile Services logs in the SAP Business Technology Platform. They indicate the layer (MDK Client or back-end) on which the issue occurs. With the information you can then proceed to analyze either client logs for UI/MDK related issues and Gateway logs, trace, or application logs in the SAP back end. Then, you can follow this process based on the information you get from each layer. This is not a strict procedure, but rather a guidance.

In the following sections, we discuss these components in more detail.

MDK Client (Application)

MDK Application Client with client logs and device logs.

Your device has synchronization errors that provide information related to synchronization. These can be business errors that the data provider passes back down, for example, the Work Order Plant does not match. In addition to technical errors, there can be 403 authorization responses. You can click functional business errors to bring the user to the erroneous object. You can use technical errors to identify potential issues or to contact support.

Also, you can send the activity log to the administration team. In the profile page, you can select the support option and select Send Activity Log. If you experience client issues, such as the object not opening correctly or missing values, you can configure the Assigned Feature for Mobile Client Log. Also, you can restrict the logging to a specific user.

Screenshot of the Mobile Client Log Upload. The User field is highlighted.

This sends the client application log (client logs) to SAP Business Technology Platform Mobile Services. The SAP Business Technology Platform Mobile Services admin can analyze the log for a possible root cause. To view recently uploaded logs, you can open the Mobile Services cockpit and navigate to AnalyticsLogsTechnical logs. Set the type to Client Log and choose Go.

SAP Business Technology Platform Mobile Services

Mobile Services: SAP Business Technology Platform Mobile Services logs, SAP Business Technology Platform Mobile Services Network Trace, SAP Business Technology Platform Mobile Services app Config.

In-mobile services have features that help system administrators identify root causes and indicate solutions for issues.

SAP Business Technology Platform Mobile Services is the overall offering. SAP Business Technology Platform Mobile Services includes cloud services, tools, and SDKs needed for building and running enterprise-grade mobile apps. A set of common cloud services enable mobile app capabilities, such as offline functionality, data integration, notifications, security, and supportability. The mobile services are available in the Cloud Foundry and Neo environments for SAP.

SAP Business Technology Platform Mobile Services Logs

SAP Business Technology Platform Mobile Services provides a comprehensive logging framework.

To view the SAP Business Technology Platform Mobile Services logs, open the Mobile Services cockpit and navigate to AnalyticsLogs.

SAP Business Technology Platform Mobile Services Network Trace

In addition to the SAP Business Technology Platform Mobile Services events log, you can configure the Mobile Services to trace incoming and outgoing requests and download them as archived HTTP requests in the HAR format. You can download tracing reports to either a .zip or a .har file.

Screenshot of the event log showing a 403 status code.

We can see the exact request sent by Mobile Services. For example, we search for 403 status codes and what we first find is the call from the event log. In the figure, View Network Traces shows the crucial bits.

You can filter network traces by username, registration ID, application ID, or a given timeframe, and then download it as either a .zip or .har file.

Once these are specified and downloaded, you can open the logs in any text editor and view all requests for the provided time period. Also, you can use programs like Fiddler to open and view these network traces to make analysis more legible.

Note

These methods are NOT intended for high load situations or long period runs. The tool is only for debugging issues and not for monitoring. In addition, the tool is powerful and records all traffic through mobile services. It generates large files and can fill your database, causing several issues.

SAP Cloud Connector

Diagram showing SAP S/4HANA On-Premise with SAP Gateway, Mobile Add-on, and SAP EAM On-Premise connected to ECC On-Premise. It includes Cloud Connector with SCC Logs and Config, and various logs and traces.

The SAP Cloud Connector (SCC) connects your applications running on SAP Business Technology Platform with on-premise systems. All requests from your SAP Business Technology Platform Mobile Services application to your on-premise systems pass through the SCC.

If there are communication issues, it can help to extract and look at the logs that SCC collects. Frequently, to make debugging easier, you must enable verbose logging.

To set the SCC log verbosity, log in to the SAP Cloud connector administration tool.

In the left column, select Audit. Under Audit Settings, select All as the audit level. In the left column, select Logs and, under Log and Trace Settings, select All as the log level. Review the logs and trace files that the SAP Cloud connector generates.

Again, in the SAP Cloud connector administration tool, navigate to Audit and check the most recent access request. You see the name of the user who requested the back-end data.

Select Log and Trace Files, select the <date_time>ljs_trace.log file. In the most recent access request, you see the DN that is in use.

Optionally, copy the text from "back end:" up to, but not including, the "|." Save the text to a file with a .crt exetension. View it on a Windows computer.

Screenshot of the log file in Notepad.

Once you have the log files, reset the logging level to normal.

Back-end

Diagram showing SAP S/4HANA On-Premise with SAP Gateway, Mobile Add-on, and SAP EAM On-Premise connected to ECC On-Premise. It includes Cloud Connector with SCC Logs and Config, and various logs and traces.

SAP NetWeaver Gateway

The SAP Gateway component exposes your OData services to your application.

This component can be set up in a HUB or Embedded scenario Separate Gateway server installation or same server installation as your back-end ERP/S/4HANA system). In either scenario, the same troubleshooting tools are available to you.

SAP Gateway Error Logs

The SAP Gateway error logs log all errors passed through the framework. This includes function business errors passed from the back-end application. For back-end business errors, more information may be needed from the specific component. However, the GW error log shows enough information to indicate the error or direct you where to look next. It reveals basic details about errors and shows errors from all users for a given client:

  • If the log level is set to secure, advanced details can be hidden.

  • If users fail to properly authenticate, it does not reveal generic authorization errors.

SAP Gateway Trace

Also, if you need more information or the logs do not capture enough information for you to identify the root cause, you can use the gateway tracing tool.

In the gateway tracing tool, you can configure the gateway tracing tool to run according to a user name or a request URI prefix. In the SAP Gateway tracing tool, you can take two types of traces: Performance Trace or Payload Trace. If necessary, both can be enabled at the same time.

  • Performance Trace: Displays trace log of process that ran and detailed performance information regarding those processes.

  • Payload Trace: Displays detailed OData request and response data coming into SAP Gateway.

Screenshot of SAP Gateway: Tracking Tools. The Payload Trace tab is highlighted.

SAP Gateway Trace:

  • Will display detailed request and response data coming into SAP Gateway.

  • Only remains active for short time.

  • Purges on regular basis.

Note

  • The Gateway Traces logs displays detailed request and response data coming into SAP Gateway.

  • The Traces remains active for a short period of time.

  • Traces are purged regularly.

You can trace in the front end or back-end components:

Front-end Trace
Command: /IWFND/TRACES.

This tool reveals advanced details of all OData calls made by any specified user.

  • Details revealed in HTTP format with requests and responses included.
  • Payload responses are included in full, batch responses are not formatted.
  • Requests can be replayed.
Back-end Trace
Command: /IWBEP/TRACES.

Can reveal advanced details of back end processes that are run by OData calls made to the back end.

SAP Mobile Add-On (For SAP S/4HANA or ERP On-Premise)

The mobile add-on is the component that builds the dataset for the SAP Service and Asset Manager application and integrates the mobile application to the Back-end System PM and other core components.

MAIF Admin and Configuration Panel

The configuration panel is where many data configurations are made for the SAP Service and Asset Manager application. The administration portal has many key insights into the operation and data in the application. Information from both of these can be used to see what is happening in the mobile component and what data is being sent to users.

You can access the administration panel through transaction /SYCLO/ADMIN or through the URL: https://<host:port>/sap/bc/webdynpro/syclo/core_admin_moni_portal?sap-client=<client_Number>&sap-language=EN.

You can access the configuration panel through /SYCLO/CONFIGPANEL or through the URL: https://<host:port>/sap/bc/webdynpro/syclo/core_config_wb?sap-client=<client_Number>&sap-language=EN#

Here, we can see the client state for work order object. If we see data missing from the client state, we can look into the configuration options in the configuration panel to see what data filters and how we configured the data queries to select data.

SAP S/4HANA / ERP

SAP Application Logs

TCode SLG1, object = /syclo/.

These logs show us application errors in the mobile add-on component.

Screenshot of the Display logs. Here, you can view application errors in the back-end system.

These can be filtered down per user, component, and time frames. These can provide information on application errors in the back-end system mobile add-on component. In the figure, SAP Application Logs, we can see that the error is because a priority is improperly maintained in the data received from the client.

ST22

If an unhandled exception occurs while an ABAP program executes, the ABAP runtime environment triggers an ABAP runtime error. The execution of the program terminates and a detailed error log (short dump) is created and saved in the affected ABAP system.

You can use the tools of the ABAP dump analysis (ST22) to list the ABAP runtime errors that occur in an ABAP system and also the relevant short dumps. It displays and analyzes update statistics again.

ST12 – ABAP Trace

For each request, we can then see the execution logic. You can sort by highest %Net time or Hierarchy to see what is most expensive in the process. This enables you to dive into the ABAP code or database calls for further analysis.

ABAP Debugger

The debugger is a programming tool that you can use to execute ABAP programs, either by line or by section. With this tool, you can display data objects and check the flow logic of programs. The new ABAP Debugger executes in a separate external session (debugger), while the application being analyzed uses a second external session. With this technology, the user interface of the debugger can be freely designed by ABAP means. The ABAP Debugger is an integrated test tool in the ABAP Workbench.

We can use the debugging feature in SAP to further analyse the root causes and trace what the ABAP code does.

We can set breakpoints in classes and methods in the mobile addon packages to pause and analyze the program details.

ICM Logs or Traces

The Internet Communication Manager (ICM) can reveal client certificates and other information sent alongside HTTP requests. You can access the ICM through the transaction SMICM. (If operating in a Hub scenario, then access this transaction on the Hub server. This is not a GW component and can be found on any SAP stack). The ICM manages all internet facing traffic for SAP ABAP systems.

Here are the locations for the trace file and levels for the ICM set through the Goto menu in your system:

GotoTrace FileDisplay/download file

GotoTrace LevelSet, Increase, Decrease

Trace files reveal potential issues with principal propagation. You can use incoming forwarded client certificate to determine if certificate mapping rules are properly established.

The Forwarded Client certification is highlighted.

Perform a Root Cause Analysis (RCA)

Business Scenario

In this exercise, you learn about different troubleshooting steps when you face an issue.

Note

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

Task 1: Change the SAP Business Technology Platform Mobile Services Logs and Enable Client Logging

Steps

  1. View any log entries and filters.

    1. Log in to mobile services.

    2. Select AnalyticsLogs.

      In the Mobile Services screen, the Logs tab is highlighted.
  2. Enable client logging.

    1. Go to Mobile ApplicationsNative/Hybrid.

    2. Choose your Application ID.

    3. Within the Mobile App Assigned Feature, choose Mobile Client Log Upload.

    4. Configure the Default Logging and User Specific Logging.

      In the Mobile Client Log Upload screen, the Configuration tab is selected. The User field is highlighted.
  3. Open the SAP Service and Asset Manager client.

    1. From the overview page, choose the Profile Icon.

    2. Select the Support menu option.

      In iOS, the Support screen is selected.
  4. Select the activity log.

    1. Enable the log if not already enabled.

    2. Increase the Log Level setting.

      In iOS, the Activity Log is selected.
  5. Initiate a failed synchronization.

    1. Turn on airplane mode.

    2. Initiate a synchronization (transmit).

      in iOS, the SAP Asset Manager screen is shown.
    3. After the synchronization fails, disable airplane mode.

  6. Send the Activity log.

    1. Navigate to Profile iconSupportActivity Log.

    2. Select Send Activity Log.

      Choose Send Activity Log.
  7. View the file.

    1. If the log upload is successful, you can see this client log file in the SAP Business Technology Platform Mobile Services log page (under Mobile App Assigned FeaturesMobile Client Log Upload)

    2. Select the checkbox for your client log and you can either select display or download to view the file.

Task 2: Trace a SAP Business Technology Platform Mobile Services Network

Steps

  1. Record network traces.

    1. If not already there, log into Mobile Services.

    2. Navigate to Mobile ApplicationsNative/HybridNetwork Traces.

      Select Mobile Applications>Native/MDK, then select an Application ID.Choose Network Trace.
    3. If the feature is not available, choose the + icon.

    4. Choose Network Traces.

      On the Add Feature popup, select the Mobile Network Trace checkboxes.
    5. Choose OK.

    6. Choose Start Recording.

      On the Add Feature popup, select the Mobile Network Trace radio button.
  2. Set the Performance and Payload Trace.

    1. Log on to the GW system

    2. Navigate to transaction /N/IWFND/TRACES.

      Note

      The transaction has to start with /n.
    3. Verify the username or URI.

      Use your user ID.

    4. Ensure that the Error Log Level is set to Full.

    5. Select the Performance Trace and Payload Trace options.

      Error Log level is set to Full. Select the Performance Trace and Payload Trace checkboxes.
  3. Initiate a synchronization.

    1. On your mobile device, choose the Transmit button to initiate a synchronization.

      On the mobile app, choose Transmit.
  4. Download the network trace.

    1. Once the synchronization completes, stop your network trace.

    2. Select Download.

      1 - Choose Stop. 2 - Choose Download.

      You can also stop the GW traces by unchecking the Performance Trace and Payload Trace checkboxes.

      To stop the traces, clear the Performance Trace and Payload Trace checkboxes.
  5. View the traces in GW.

    1. To view performance metrics on the OData calls, change from the Configuration tab to the Performance Trace tab.

      System screenshot
    2. To see further details on this call, navigate into each line.

  6. View the requests sent in batch calls and the payload of a data transmission.

    1. Navigate to the payload trace of a call from the previous step or on the request list page move to the Payload trace tab.

    2. Use the payload trace to identify the requests sent in batch calls and also the payload of a data transmission.

      For example, identify the order numbers.Screenshot of the SAP Gateway: Payload Trace screen.

  7. Track the requests.

    1. Open the HAR file in a viewer.

      HAR is a file extension.

      Use an HTTP Archive viewer to see it (for example: Google Chrome extension work. See: https://chrome.google.com/webstore/detail/http-archive-viewer/ebbdbdmhegaoooipfnjikefdpeoaidml?hl=en).

    2. Analyze and compare with your GW trace.

      Screenshots comparing the HTTP Archive viewer with the GW trace.

Log in to track your progress & complete quizzes