Runtime Variables Overview for SAP Cloud Platform Integration (HCI)

This is an overview of useful and commonly used (dynamic) variables and runtime parameters of SAP Cloud Platform Integration (f.k.a. SAP HCI) based on Apache Camel´s expression language.

SAP Help: Headers and Exchange Properties

Those variables can be used in Integration Flows (e.g. in artifacts as Content Modifier, Router, Channels, …):

ParameterDescription
${in.body} or ${body}Message Payload
${header.var1}Message Header Variable (var1)
${property.prop1}Exchange Property (prop1)
${date:now:yyyy-MM-dd}Current Date/Time with format
${property. SAP_MessageProcessingLogID}Message Guid
${CamelFileName}File Name
${CamelHttpUri}HTTP URI (URL with QueryString)
${CamelDestinationOverrideUrl}SOAP Adapter URL
${exception.message}Error Message
${exception.stacktrace}Error Stacktrace

New SAP Training: WIFMS4 – Inbound Interface Management in SAP S/4HANA

We have developed a standard SAP Training about managing inbound interfaces (ABAP Proxies) in SAP S/4HANA and SAP Business Suite (ERP, CRM, …): WIFMS4.

training

You learn how to implement a robust error handling using already available (and free) SAP standard technology:

  • Forward Error Handling (FEH) and
  • Error and Conflict Handler (ECH)

without the need of implementing a heavy solution, such as SAP AIF.

SAP Blog/Announcement on WIFMS4

SAP Online Training Catalog (with dates)

WHINT Interface Monitoring: Concierge Service for SAP

Interface Monitoring

WHINT® Interface Monitoring is a consulting service to pro-actively monitor your SAP interface landscape.

We generate daily snapshots (if you wish more often) of your SAP middleware and backend systems and perform level-1/level-2 support via follow-up activities. Our pricing is super-competitive. Please contact us under sales@whitepaper-id.com.

 

Integration Content Catalogs in SAP for Standard Interfaces

Looking for standard SAP interfaces?

There is a lot of interfaces and integration content available which you can use for your implementation project using SAP Process Orchestration (SAP PRO) / SAP Process Integration (SAP PI) or SAP HANA Cloud Platform, integration service (SAP HCI).

Here is an overview:


  • SAP API Business Hub – OData/REST and Web Services/SOAP: https://api.sap.com
  • SAP Content Hub – Integration Content (for HCI and PRO) provided by SAP and Partners: https://cloudintegration.hana.ondemand.com/
  • SAP App Center – Integration Content provided by SAP and Partners: https://www.sapappcenter.com/
  • Enterprise Services Workplace – Enterprise Services and BAPIs: http://es-workplace.sap.com
  • SAP Best Practices Explorer – Integration Content as Best Practice or Rapid Deployment Solution also covering S/4HANA : https://rapid.sap.com/bp/
  • IDocs however are not listed in any catalog

SAP API Hub

Catalog1


SAP Content Hub

Catalog2


SAP App Center

Catalog3


Enterprise Services Workplace

Catalog4


SAP Best Practices Explorer

Catalog5Catalog6


IDocs

  • You have to see in your WE60 or in SAP Help which IDoc might fit for your needs. Please consider that IDocs are not delivered by SAP anymore since 2003…

ABAP Inbound Proxy: Inside-Out vs. Outside-In

Implementing ABAP proxies is quite simple. You generate the ABAP classes via SPROXY (which connects to your ESR) and implement the code.

Regarding the Service Interface Design and Implementation you have a choice:

  • Outside-In: You define the Data Types and Message Types in the ESR and generate into ABAP
  • Inside-Out: You choose what you need in ABAP, import into ESR and use the ABAP perspective. Then you generate into ABAP.

Each approach has pros and cons. Here you see what makes the approaches so different and what fits your requirement best.

Development Process


Outside-In

IOOI1


Inside-Out

IOOI2


Summary


Outside-In

  • Clear choice if you are using Global Data Types (GDTs) and do not want to deal with the SAP-internal field names in the ESR or towards the Non-SAP applications

Inside-Out

  • Complex data structures (e.g. BAPIs) & no need to have an abstraction view in ESR
  • No usage of GDTs

 

 

ABAP Outbound Proxy: Set EOIO Queue

In order to use EOIO (Exactly-Once-In-Order), you have to pass the Queue ID to the class before calling the Outbound Proxy in your ABAP Program. It can be a static value like shown below (parameter) or a dynamic object like a document number:

 

PARAMETERS: p_queue TYPE sxmsqidapp.

DATA: l_proxy TYPE REF TO z…,
async_messaging TYPE REF TO if_wsprotocol_async_messaging.

CREATE OBJECT l_proxy.

async_messaging ?= l_proxy->get_protocol( if_wsprotocol=>async_messaging ).
async_messaging->set_serialization_context( p_queue ).

Usage Dependencies in Software Components

There is a useful functionality to reuse objects from one software component in another one.

You can define this usage dependency in SLD or in ESR (software dependencies & underlying software components).

It is needed if want to enhance Standard Enterprise Services or when you create a shared pool of objects that is strictly reused and not copied into other Software Components.

  • Data Type Enhancements (to enhance SAP Data Types)
  • Central Mappings, Function Libraries

Please do not use it to share interface objects across several components/systems.

Different release/deploy/maintenance cycles in the connected systems require a clearly decoupled approach which is also reflected by the software components. In case your data types/message types/service interfaces are equal in both software components, simply copy them over. Starting from then on, you have to add a new field in both components (or you copy again by overwriting the target object).

Key takeaway: Decoupling is more important than reuse (in this case)!

No Mapping required!

As your software components will use their own namespaces you should be careful designing the messages. When you copy over the message type from SWC_1 to SWC_2, the XML Namespace in SWC_2 will automatically have the Namespace of SWC_1. To use this feature smarter, simply use a cross-component, company-wide, global namespace.

XML Namespace in the Message Type: http://<company-domain>/xi/GLOBAL
Btw: This is approach is also used by SAP to design their namespaces.

Example

  • SWC_1: OTC_RETAILER 2016 of whitepaper-id.com
    Namespace: http://whint.de/xi/OTC/RETAILER
  • SWC_2: OTC_SAP_ERP 6.0 of whitepaper-id.com
    Namespace: http://whint.de/xi/OTC/SAP/ERP
  • XML Namespace across all SWC: http://whint.de/xi/GLOBAL

SAP Plain J2SE Adapter Engine in Proxy Mode

In case you want to track your HTTP requests (e.g. to SOAP / HTTP / REST receivers), the SAP Plain Adapter Engine might offer a nice surprise to you.

You simply have to reactivate the adapter type “httpwatcher” and then you can set up your own Proxy Server easily:

J2SE Proxy 1 J2SE Proxy 2

In the Log of this HTTP Watcher Proxy you can see the complete HTTP (not HTTPS) traffic that is going through!

 

WHINT MessageMissing Alert

Functionality

How can we make sure if a message was processed at all with SAP PI/PO? Today, no alert means no error.
But what if the sender system did not place the file or send the message? You will find out, when the business will ask for missing data…
WHINT MessageMissing Alert is a solution that runs pro-actively as a job on your system (e.g. every hour during business hours or every month on the first) and checks in the message (performance) monitor if the interface ran or not. In case no message was found, an e-mail will be sent to a receiver.


Prerequisites

  • Works with SAP NetWeaver PO (PI single-stack) version 7.3 EHP1 and higher (including 7.50)
    • If you read from more than one Adapter Engine and you enforce SSL, you need to apply SP15 for 7.31 / SP10 for 7.40
  • Create a new User with the following standard role (or equivalent custom role): SAP_XI_MONITOR_J2EE
  • Activate the performance monitoring in NWA
    • Configuration > Infrastructure > Java System Properties
    • Services > XPI Service: AF Core
    • Properties > profile.performance.runtime = true
    • Configure the interval to keep the last 31 days of the message processing by executing the following URL on your PI/PO system: http(s)://host:port/mdt/performancedataqueryservlet?PeriodConfig=DAILY=31
  • Import the Software Component into your ESR provided by Whitepaper InterfaceDesign
  • Deploy the SCA/EAR file provided by Whitepaper InterfaceDesign using NWDS/JSPM/SUM/Telnet
  • Configure the Scenario by installing the Integration Scenario in NWDS (via iFlows) or in Integration Directory Swing Client. Per default “WHINT_MMA” is defined as the sender business component.

MMA1


Usage

  • Schedule the job from NWA -> Operations -> Jobs -> Java Scheduler
  • Add Task with Job name MessageTriggerJob
  • The solution is using WHINT MessageTrigger Job which can generically send an XML message to the PI/PO runtime.
  • Parameters:
    • ScenarioID: WHINT_MMA (actually this value can have an
    • ScenarioSender: MMA_TEST1 (this value has to match the IntegratedConfiguration/iFlow configuration)
    • Param01: Interface=<the interface name of the message you look for. “*” is the wildcard.>
    • Param02: InterfaceNS=<the interface namespace of the message you look for. “*” is the wildcard.>
    • Param03: SenderComponent=<the sender system of the message you look for. “*” is the wildcard.>
    • Param04: SenderParty=<the sender party of the message you look for. This parameter is optional.>
    • Param05: ReceiverComponent=<the receiver system of the message you look for. “*” is the wildcard.>
    • Param06: ReceiverParty=<the receiver party of the message you look for. This parameter is optional.>
    • Param07: Period=<DAY/HOUR/15MIN>
    • Param08: Frequency=<e.g. the amount of hours within the message was processed>. Possible values / Unit:
      • DAY: 1..31
      • HOUR: 1..24
      • 15MIN: 1..4
    • Param09: EmailRecipient=<E-Mail Address or list: receiver1@company.com;receiver2@company.com>
  • The sequence of the parameters is not important.
  • The scheduling should be done according to your business needs (hourly, Mon-Fri between 8:00 and 18:00)

MMA2

MMA3


Example

Finance data for reconciliation from a payment service provider shall be sent monthly from an SFTP server and posted into SAP accounting. The solution makes sure that the interface is running every month at least once or at a given day.

Another example is that the warehouse interface shall be active during business hours. Stock movement messages should be sent at least once every 30 minutes from SAP ERP to the AS/400 warehouse system. An immediate alert is sent out if no messaging takes place.

MMA4


 

WHINT Proxy FileTransfer

PFT_SAP

Whenever possible, please try to avoid file-based integration (flat or not, going through the file system is not a good integration pattern), see blog post: Avoid using flat files!. However, sometimes it is still the best fit when the connected system does not provide a clean (RESTful or WebService-based) API….


Functionality

This solution makes FTP/SFTP(SSH) communication with your SAP Backend system obsolete. Your ABAP programs can still use file-based integration (Import/Export), but the communication with PI/PO is done with HTTP(S). This is especially useful, when you do not want ANY system to connect to the file system of your SAP landscape or you want to make sure only the SAP system itself is accessing the (local/remote) file system, no other system or user.

The integration is done through the ABAP Proxy runtime, which supports multipart messages. The XML data of each ABAP proxy contains the meta data (file name, directory, job/program name) and the data file itself is transferred as an attachment.
WHINT_PFT


Prerequisites

  • Import the TPZ file provided by Whitepaper InterfaceDesign into your ESR
  • Import the ABAP transport containing the objects into your SAP Backend system via Transaction SAINT

Usage

From SAP

  • Proxy: ManagedFileTransfer_Out [http://whint.de/xi/PFT]
  • Define an iFlow/Integrated Configuration (ICO) to connect your SAP Backend with a receiver system
    • To map the data from the attachment into the main payload and set the DynamicConfiguration values (ASMA) for FileName and Directory, you can run Operation Mapping FileMessageFromProxy
    • Alternatively you can use your own mapping of course
  • Run: Execute ABAP Program /WHINT/MFT_SEND
    • Enter the file name and source directory
    • Optional: Decide if the file shall be deleted after processing
    • Optional: Enter a scenario id to make routing in the IntegrationDirectory easier. The value will be part of the meta data (XML) as well as a context object (PFTScenarioID)

To SAP

  • Proxy: ManagedFileTransfer_In [http://whint.de/xi/PFT]
  • Define an iFlow/Integrated Configuration (ICO) to connect your sender system with your SAP Backend
    • To map the main payload into the attachment and (optionally) read the DynamicConfiguration values (ASMA), you can run Operation Mapping FileMessageToProxy.
      • To set the FileName and Directory from DynamicConfiguration, set mapping parameter to “ASMA”, otherwise enter the value in the Configuration (iFlow/ICO)
      • If you want to execute a program or schedule a job (with variant), you can also specify those with the mapping parameters. To leave the parameters empty, set the parameter value to “IGNORE”.
    • Alternatively you can use your own mapping of course
  • Run: Send the data from your source system