While working with SAP PI as a novice, we all have faced the initial hurdle of how to start and from where. Hence, in this blog series, I would like to share some of my experiences in building an A2A (Application-To-Application) scenario using enterprise services and consuming those services in ABAP.
This is a two part series blog which would demonstrate the following scenario in a step by step manner:
I would also show a few variation of the above scenario, like configuring the services using SAP PI runtime and how only a SAP BW process chain can be used to trigger the services.
Note: The PI system that is shown in this example has the version 7.11.
To start with, let’s understand what is exactly meant by A2A scenario. A scenario is termed as an application to application scenario incase the exchange of service interface messages is used to integrate internal company processes. Hence, in case the components between which the data flows are internal company processes, it can be said as an application to application data flow.
The following diagram depicts the integration between two systems through SAP PI:
Let’s now try to understand the kind of systems (shown in the diagram above) and the functionality of a PI in an A2A scenario:
The system in which the service is created is usually referred to as the “Provider System” and the system in which the consumer proxy is created is usually referred to as the “Consumer System”.
SAP calls PI an integration broker because it mediates between entities with varying requirements in terms of connectivity, format, and protocols. According to SAP, PI reduces the Total Cost of Ownership (TCO) by providing a common repository for interfaces. The central component of SAP PI is the SAP Integration Server, which facilitates interaction between diverse operating systems and applications across internal and external networked computer systems.
PI is built upon the SAP Web Application Server.
Note: The ABAP application server for the consumer and provider system should be present in the SLD of the PI system. A corresponding technical system and business system for the ABAP AS would be required to be created in the PI system SLD. This can be done, as shown in the blog link given below or with the help of the BASIS team.
How do you activate ABAP Proxies?
Scenario: In this blog, let’s try to send a text from the consumer system and get it stored in a table of the provider system. Hence the service and the consumer proxy would look something like this:
Designing/Creating asynchronous enterprise service
In this section we would see the creation of a service definition and consumer proxy. A consumer proxy is a service that is used to consume/call a service.
To create a service, follow the steps below:
(For the above example, you can create a data type with an element of Type Short_Description)
Note: This is called the outside-in approach of creating services in which an external service definition for example, a service definition created in the ESR, is used to create the service. In the inside-out approach, an existing functionality (like a function module in which the business functionality is available) is exposed as a service.
Creating the consumer service proxy
To create a consumer proxy log into the ABAP AS of the consumer system and follow the same steps as service , with the following settings for the Service Interface part.
Once the consumer proxy is designed in the ESR, it has to be generated in the consumer system ABAP AS, with the help of the SPROXY transaction. As in the case of the service, the logic for the consumer proxy also has to be implemented in the proxy class method.
A consumer proxy can also be created from the repository browser (transaction se80) of the consumer system using the service creation wizard. For that:
Note: A Message Data Type and the corresponding Data Type for the consumer proxy has to be created separately.
More in the next part of the blog ...