SAP PI Tutorial

Ratings:
(4.2)
Views: 3542
Banner-Img
Share this blog:

Welcome to the SAP PI Tutorials. The objective of these tutorials is to get an in-depth understanding of SAP PI. In these tutorials, we will cover various SAP PI with examples. The tutorial starts with an overview of the SAP PI. In addition to these tutorials, we will also cover common issues, Interview questions, and How To’s of SAP PI.

SAP NetWeaver Process Integration (SAP PI) is SAP's enterprise application integration (EAI) software, a component of the NetWeaver product group used to facilitate the exchange of information among a company's internal software and systems and those of external parties.

SAP PI Tutorial  - Table of Contents

SAP offers not only links to SAP product documentation but also links to related information. All links are categorized for transparency:

  • Links with no icon: Links to SAP product documentation
  • Links with the icon: You are entering an SAP-owned site that is not part of SAP product documentation. By using such links, YOU AGREE that unless expressly stated otherwise in your agreements with SAP, the content of such sites is not part of SAP product documentation and that you may not infer any product documentation claims against SAP based on this information.
  • Links with the icon: You are entering a site that is not hosted by SAP. By using such links, YOU AGREE that unless expressly stated otherwise in your agreements with SAP

The content of the linked-to site and any further external site is not product documentation and that you may not infer any product documentation claims against SAP based on this information.

The fact that SAP provides links to external sites does not imply that SAP agrees or disagrees with the contents and information provided on such sites. SAP does not guarantee the correctness of the information provided.

The architecture of SAP PI

sap pi architecture

The SAP PI consists of a hub and spoke structure; the spokes connect with external systems while the hub exchange messages between them. The source system is known as the sender system and the target system is known as the receiver system. The PI is not a single component, but rather a collection of components that work together flexibly to implement integration scenarios. The architecture includes components to be used at design time, at configuration time, and at run time.

We can divide the SAP PI into several areas

  • Integration Server
  • Integration Builder
  • System Landscape
  • Configuration and Monitoring

Integration Server is the central processing engine of the SAP PI. All messages are processed here in a consistent way. It consists of three separate engines

  • Integration Engine
  • Adapter Engine
  • Business Process Engine
If you want to enrich your career and become a professional in SAP PI, then visit Tekslate - a global online training platform: "SAP PI Training"   This course will help you to achieve excellence in this domain.

The integration engine can be considered to be the hub and the Adapter engine is the spoke. Regarding the Business Process Engine, I will explain it later.

Integration Builder is a client-server framework for accessing and editing integration objects and it consists of two related tools:

  • Enterprise Service Repository: to design and develop objects to be used in scenarios
  • Integration Directory: to configure the ESR objects to develop scenarios

Two together, we built integration processes which are commonly called scenarios.

The System Landscape is a central repository of information about software and systems in the data centre and simplifies the administration of your system landscape.

In Configuration and Monitoring, we can monitor the messages and adapters.

Single-Stack and Dual-Stack

When PI was first released, not all components were built on the same platform. Integration Engine and Business Process Engine were built in ABAP while Adapter Engine, Integration Builder, SL, CM, and Mapping Runtime were built in Java. So PI needs both the Java and the ABAP environment to run and is known as the dual-stack.

ABAP Stack

Java Stack

  1. Integration Engine
  2. Business Process Engine
  3. Integration Builder
  • Enterprise Service Repository
  • Integration Directory
  1. Runtime Workbench
  2. System Landscape Directory
  3. Adapter Engine
  4. Mapping Runtime

But in the later version, all the components are built in Java. Some of the dual-stack components are either dispensed off or modified to work on the Java stack. So PI needs only the Java environment to run and is known as the single stack.

Integration Engine

sap pi integration Engine

The Integration Engine is responsible for central Integration Server services i.e. the pipe-line steps - routing and mapping. If the source message structure is different from the target message structure, then the integration engine calls the Mapping Runtime, where the source structure is converted to the target structure. The Mapping Runtime is based on the Java stack.  The integration engine can also utilize an ABAP program for the conversion, which is based on the ABAP stack.

A message can be of two types

  • Synchronous: has both the request-response part.
  • Asynchronous: has either the request or the response part only.

In PI, the message is represented by an interface.

Interface -> structure of the message in XML format + direction

Based on the above criteria, there are three types of interfaces

  • Outbound interface: connect to the sender system
  • Inbound interface: connect to the receiver system
  • Abstract interface: connect to the BPE

When we configure integration logic (scenario) in the SAP PI as per our business requirements, it is the integration engine that executes that configuration in a step-wise manner. The pipeline is the term used to refer to all steps that are performed during the processing of an XML message. The pipeline steps consist of the following:

  • Receiver Identification: determines the system that participates in the exchange of the message.
  • Interface Determination: determine which interface will receive the message.
  • Message Split: if more than one receiver is found, PI will instantiate a new message for each receiver.
  • Message Mapping: mapping to transform the source message to destination message format.
  • Technical Routing: bind a specific destination and protocol to the message.
  • Call Adapter: send the transformed message to the adapter or a proxy.

Adapter Engine

You must have noticed earlier that the integration engine handles messages in XML-SOAP protocol only. But what if we have a sender and a receiver business system where the data is not in the same format. We use the various adapters in the Adapter Engine to convert XML- and HTTP-based messages to the specific protocol and format required by these systems, and vice versa.

sap pi adapter engine

As we have discussed earlier, SAP PI is a hub and spoke structure where the Adapter Engine can be considered as a spoke. We use the Adapter Engine to connect the Integration Engine (Hub) to the external systems. The Adapter Framework is the basis of the Adapter Engine. The Adapter Framework is based on the SAP J2EE Engine (as part of the SAP Web Application Server) and the J2EE Connector Architecture (JCA). The Adapter Framework provides interfaces for configuration, management, and monitoring of adapters.

In a dual-stack system, most of the adapters were based on the Java stack barring two adapters that are based on the ABAP stack.

Java Stack  RFC adapter, SAP Business Connector adapter, file/FTP adapter, JDBC adapter, JMS adapter, SOAP adapter, Marketplace Adapter, Mail adapter, RNIF adapter, CIDX adapter
ABAP stack  DOC adapter and HTTP adapter

When SAP PI moved from dual-stack to single-stack than these two adapters became part of the Java stack. The modified adapter engine is known as the Advance Adapter Engine and the two adapters are called the IDOC_AAE adapter and HTTP_AAE adapter respectively.

sap pi

The Business Process Engine is responsible for executing and persisting integration processes.

BPM stands for cross-component Business Process Management or cc BPA and is also called the Integration process. An integration process is an executable, cross-system process for processing messages. In an integration process, you define all the process steps that are to be executed and the parameters relevant for controlling the process. Business Process Management provides SAP Exchange Infrastructure with the following functions:

  • State-full message processing: The status of an integration process is persisted on the Integration Server.
  • You can also use correlations to establish semantic relationships between messages.
  • You implement integration processes when you want to define, control, and monitor complex integration processes that extend across enterprise and application boundaries i.e. collect/Merge, Split, Multicast

At runtime, the Business Process Engine executes the integration processes. The integration process can send and receive messages using abstract interfaces only.

Checkout: [ SAP PI Interview Questions ]

Build a scenario in SAP PI

We start from the Home page if we have to build a scenario in PI.

The home page will look similar to as given below:

sap pi

The Home page has hyperlinks to the following 4 working areas:

  • Enterprise Services Repository (ESR)
  • Integration Directory (ID)
  • System Landscape (SL)
  • Configuration and Monitoring (CM)

Each hyperlink will open one application. All these four are Java applications. ESR and ID are swing applications. They are launched from the browser based on JNLP. So for the first time, it takes more time as it downloads the entire library file. But from the second time onwards, it takes less time to launch. SL and CM are pure web applications and run on the browser.

Enterprise Services Repository

Here we design and create objects to be used in the making of an integration scenario. The data flow in PI will look similar to as shown below:

sap pi enterprise services

We find the option to design the following:

  • Interface objects – Service Interface, Message Type, Data Type
  • Mapping objects – Operation Mapping and Message Mapping
  • Integration Processes

 sap pi service interface

PI uses an integration repository to design message structure for both sender and receiver systems and develop an interface message using corresponding message structures that act as a point of interaction to the outside world. Data type and Message type are used to simplify and modularize the design of a complex interface.

sap pi operation mapping

Operation Mapping allows the transformation of a source structure to a target structure when the two structures are different. But if the source and the target structure are the same then the operation mapping may be dispensed off. Similar to the service interface, message mapping is used to simplify and modularize the design of a complex operation mapping. Message mapping can be implemented in 4 ways

  • Graphical Mapping
  • Java Mapping
  • XSLT Mapping
  • ABAP Mapping

Graphical mapping is the most used as it allows the developer to map attributes of both structures graphically to pass data using service interfaces. For the other three, we have to develop the mapping by writing code. If it is a single-stack server, then the ABAP mapping will not be available.

 

You liked the article?

Like: 0

Vote for difficulty

Current difficulty (Avg): Medium

EasyMediumHardDifficultExpert
IMPROVE ARTICLEReport Issue

About Author

Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.

Table of Contents
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox