You are on page 1of 17

End-To-End Tracing for

Cloud Integration to On-


Premise SAP Applications
SAP BTP - SAP Cloud Integration

Vijaigeetha Chittaranjan (Geetha), Wayne Smith © 2021 SAP AG. All rights reserved.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP


BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products
Rao Bheemarasetty, Aasavari Bhave and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and other
countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal


Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business
Objects products and services mentioned herein as well as their respective
logos are trademarks or registered trademarks of Business Objects Software
Ltd. Business Objects is an SAP company.

Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and
other Sybase products and services mentioned herein as well as their
respective logos are trademarks or registered trademarks of Sybase Inc.
Sybase is an SAP company.

Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered
trademarks of Crossgate AG in Germany and other countries. Crossgate is an
SAP company.

All other product and service names mentioned are the trademarks of their
respective companies. Data contained in this document serves informational
purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are
provided by SAP AG and its affiliated companies ("SAP Group") for
informational purposes only, without representation or warranty of any
kind, and SAP Group shall not be liable for errors or omissions with respect
to the materials. The only warranties for SAP Group products and services
are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be
construed as constituting an additional warranty.
Document History

Document Version Authored By Description Date Created


1.0 Vijaigeetha Chittaranjan First release of this Aug 11, 2021
(Geetha), Wayne Smith, Rao whitepaper
Bhemarasetty, Aasavari Bhave

Document Version Reviewer Description


Ali Chalhoub First review Aug 11, 2021

2
TABLE OF CONTENTS
Document History ...................................................................................................................................................... 2
ABSTRACT .....................................................................................................................................................4
Chapter 1 –Introduction ............................................................................................................................................ 4
Chapter 2 – Enable Tracing ........................................................................................................................................ 4
Chapter 3 – Ping to On-Premise system with End-To-End Tracing............................................................................ 4
Chapter 4 – OData call to On-Premise system with End-To-End Tracing .................................................................. 4
CHAPTER 1 INTRODUCTION...........................................................................................................................5
CHAPTER 2 ENABLE TRACING .........................................................................................................................6
Cloud Integration iFlow ............................................................................................................................................. 6
SAP Cloud Connector ................................................................................................................................................. 7
Backend SAP System .................................................................................................................................................. 8
CHAPTER 3 PING TO ON-PREMISE SYSTEM WITH END-TO-END TRACING ....................................................... 10
Build iFlow and Enable Trace ................................................................................................................................... 10
Analyze Payload from End-To-End .......................................................................................................................... 11
CHAPTER 4 ODATA CALL TO ON-PREMISE SYSTEM WITH END-TO-END TRACING ............................................ 15
Build iFlow and Enable Trace ................................................................................................................................... 15
OData Payload trace ................................................................................................................................................ 17
Abstract
Chapter 1 –Introduction

Chapter 2 – Enable Tracing


2.1. Cloud Integration iFlow
2.2. SAP Cloud Connector
2.3. Backend SAP System

Chapter 3 – Ping to On-Premise system with End-To-End Tracing


3.1. Build iFlow and Enable Trace
3.2. Analyze the Payload from End-To-End
3.2.1. iFlow Message Processing
3.2.2. Cloud Connector Trace
3.2.3. SMICM trace analysis with SAP-PASSPORT

Chapter 4 – OData call to On-Premise system with End-To-End Tracing


4.1. Build iFlow and Enable Trace
4.2. OData Payload Trace

4
Chapter 1
Introduction

Cloud Integration, formerly called Cloud Platform Integration in BTP Core is an integration tool. It connects other SAP
and non-SAP applications hosted in cloud and On-Premise. It facilitates end-to-end process integration through
exchange of messages between them. This document focuses on connecting Cloud Integration to an On-Premise SAP
system via SAP Cloud Connector and provide guidelines for:
• Tracing Cloud Integration iFlow, Cloud Connector and the SAP backend
• Tracking a Message ID from Cloud Integration iFlow to Cloud Connector and On-Premise system
• A simple ping to SAP system from Cloud Integration iFlow and tracing it end-to-end
• A Cloud Integration iFlow that calls an OData service on the On-Premise SAP system and tracing it end-to-end

The Cloud Integration project and the artifacts used as examples in this document are simple and the focus is on
traces rather than artifacts themselves. The same traces can be applied to any complicated Cloud Integration projects
with adapter(s) connecting to On-Premise system.
When a Cloud Integration iFlow is accessing an On-Premise SAP system (or any On-Premise system) it is through SAP
Cloud Connector and message exchange is shown below and the document covers tracing at each step.

Cloud Integration On-Premise


Cloud Connector
Tenant SAP System

5
Chapter 2
Enable Tracing

This section covers steps required on Cloud Integration Tenant, SAP Cloud Connector and SAP backend to enable
tracing of messages.

1. Familarity with Cloud Integration Tenant and navigating tiles in Monitoring tab
Requirement 2. Familarity with SAP Cloud Connector Console
3. Familarity with accessing SAP system with SAP Logon

Cloud Integration iFlow

1. Log on to Cloud Integration tenant and go to overview tab. Select Manage Integration Content and select
iFlow to be traced
2. Enable tracing in the iFlow and check the message getting passed through by changing log level to Trace

3. Check that the message is logged via Monitor Message Processing and select the appropriate payload

4. Open the trace file and check to see the message passing between each step.

For more details check KBA 2665258- How to trace message contents in Cloud Integration Web Tooling
6
SAP Cloud Connector

1. To Enable Cloud Connector trace, go to subaccount connection in the Cloud Connector Administration
console and click on “Log and Trace File” and then select the pencil icon to edit the Trace settings.

2. Change the settings as per screenshot below. The Payload Trace checkbox shows the payload that is getting
sent from Cloud Integration to On-Premise and the response back from On-Premise to Cloud Integration.

For more details Check KBA 2452568 - Log and Trace files for the SAP Cloud Connector

7
Backend SAP System

Follow the steps to enable On-Premise SMICM Trace


1. Go to transaction RZ11 and enter the parameter icm/trace_secured_data. Click on display

2. Click on Change value and enter TRUE and click on Save button.

3. Once the profile parameter is set, now enable SMICM level 3 trace. This trace can be used to check the
payload in the On-Premise system. The SMICM trace shows what is coming in from the Cloud Connector and
what is sent out.
4. Enter the transaction code SMICM

8
5. Change the trace level to 3 and press the Change button

6. Check wiki link on how to configure SCMICM level 3 trace https://wiki.scn.sap.com/wiki/x/c4E_FQ

9
Chapter 3
Ping to On-Premise system with End-To-End Tracing

This chapter covers building an iFlow to ping an On-Premise SAP system and analyzing the message exchange
end-to-end.

Build iFlow and Enable Trace

1. The iFlow consists of a simple timer with an http receiver adapter(outgoing) that connects to the On-
Premise system using ping utility through a Cloud Connector. It shows if the server is reachable as
shown below

2. The following is the simple iFlow design with HTTP receiver adapter

3. The following is the HTTP receiver adapter configuration details

4. The following Groovy script is for logging the message


import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;

def Message processData(Message message){


def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
messageLog.addAttachmentAsString("Log current Payload:", body, "text/plain");
}
return message;
}

10
5. Deploy the iFlow and use steps in Chapter 2 Cloud Integration iFlow to enable trace
6. The following is Cloud Connector configuration for SAP On-Premise system

7. Enable the trace in Cloud Connector by following steps in Chapter 2 SAP Cloud Connector
8. Enable tracing on SAP Backend system by following steps in Chapter 2 Backend SAP System

Analyze Payload from End-To-End

iFlow Message Processing


1. In Cloud Integration tenant open Monitor Message Processing and open the trace
2. In the iFlow trace identify the SAP-PASSPORT and Location Id of the Cloud Connector sent as HTTP
header

Cloud Connector Trace


1. Open Cloud Connector Administration Console and open ljs_trace.log file.
2. In the ljs_trace.log search for the string “SAP-PASSPORT”. The trace also shows opening connection to
the backend and “SAP-PASSPORT” getting sent to it. Verify the value of “SAP-PASSPORT” in iFlow and
ljs_trace.log are identical and same message exchange is being tracked. Note the Connector Id for e.g.
0x540b6993 as shown in the following screenshot. It is used to track the payload sent to the On-
Premise system.

11
3. Open the traffic_trace_<subaccount>_<connectioninfo>.trc and search for the Connection Id identified
in step 2 above. This log shows the payload being sent as request data along with “SAP-PASSPORT”.

4. The traffic trace file also shows response back from the On-Premise server with the HTTP status code
and response payload

SMICM trace analysis with SAP-PASSPORT

SMICM trace tracks all http and https communication to and from On-Premise system. Due to verbosity in
nature of the trace it better to reset it prior to capturing all message exchanges.

Note Resetting the trace will result in losing old trace information.

12
1. Reset the trace as shown in the following screenshot

2. Reproduce the issue and display or download trace file to open in a suitable text editor e.g. Notepad ++

13
3. Open the file in text editor and track the payload with the “SAP-PASSPORT”.

In the text editor search for “SAP-PASSPORT” string and get the associated thread Id 140549202605824 as
shown in the above screenshot. Also there is corresponding connection Id 31/68392/1
Below is an example of connection Id 31/68392/1 was used for this connection and corresponding thread Id
140549202605824.

It is not recommended to use the “SAP-PASSPORT” number as the search string because it can be truncated. The
following screenshot is the response back from the On-Premise system going through SMICM process.

Notice the Connection Id and the thread Id to be the same for the response back.
14
Chapter 4
OData call to On-Premise system with End-To-End Tracing

Build iFlow and Enable Trace

1. The iFlow is a simple timer utility with OData call. It uses a custom-built OData service to On-Premise
ERP system through Cloud Connector.

2. For OData configuration follow the two screenshots below

15
3. The working of the OData call is shown below for completeness.
The metadata of the OData service contains an entity Employees that can be retrieved using OData
Service ZDEMO_SRV

4. GET call returns a set of Employees as shown below

5. Go to transaction /n/IWFND/MAINT_SERVICE and select the OData service, for e.g. ZDEMO_SRV.
Double click on the service and select SAP Gateway Client to test the service.

16
6. In the OData server ZDEMO_SRV enter the URI with the entity and click Execute e.g. Employees. This
completes the OData service test in Gateway Client.

7. Deploy the iFlow and trace it with steps in Chapter 2 Cloud Integration iFlow
8. Enable the trace in Cloud Connector by following steps in Chapter 2 SAP Cloud Connector
9. Enable tracing on SAP Backend system by following steps in Chapter 2 backend SAP System
The On-Premise OData service has the OData Payload trace. The OData Payload trace and SMICM trace are
useful in checking the payload and verify the content reached the On-Premise server.

OData Payload trace

To capture the OData Payload trace.


1. Go to Transaction /n/IWFND/TRACES
2. Select Error Full and click on payload Trace check box. This should trace the complete payload in the On-
Premise system.

17

You might also like