During one of latest projects I worked on, there was a need for sending data across multiple PI 7.1 systems. Main issue for this kind of landscape configuration are related to find and monitor many possible points of failure along complex data pipeline.
Dealing with complete monitored solution it's often not so easy, so that's the reason why I worked trying to solve the problem and share the solution with XI/PI Community Experts.
The goal is to handle messages sent from one or more SAP systems (section A) connected to one or more SAP systems (section D) through two PI systems (section B and C), belonging to different customer departments, providing data validation mechanism as well. Data should be processed on section D only if the amount of received messages for each independent flow is equal to what is sent from section A, in other words the messages have to be treated as bundle and maintained together. The solution should also prevent BPM adoption.
When you treat these scenarios, it’s really critical to foresee and manage all possible points of failure during data exchange through several systems.Consider IDocs or Proxy messages generated on section A stuck in many points for technical and/or functional issues! You will surely waste time and struggle any time with errors occurred in the pipeline.
An additional requirement is even to minimize interactions between PI systems as well as build a monitoring cockpit for the complete landscape which flows are safely and quickly monitored in.
This blog is only focused on Sender side solution (section A and B), with a brief description of Receiver side.
The solution offers the chance to handle both IDoc and ABAP proxy technologies on section A to send data out from your SAP systems, choosing Queued and Not Queued communication type according to specific business requirements. The idea is to let PI system of section B be responsible of starting, controlling and alerting activity of the flow up to edge with section C, where received messages should be compared with the amount of messages “declared” by PI system of section B. In section C, finally, a cockpit is developed to gather information and show the results.
The connection between PI system B and C is accomplished using XI protocol that connects directly Integration Engines bypassing Adapter Engine step, improving delivery performance and enabling automatically, for instance, acknowledgments propagation for each message when requested. Let’s have a look in deep to technical solution of each section.
Proposed solution is actually adopted to handle ABAP Proxy scenario with queued communication and IDoc without queued communication but you can customize according to different scenarios. Concerning Proxy approach, it’s possible to maintain fixed or variable queue names with an additional prefix to better identify and treat flows (such as XBQSMATMAS*). Refers here for documentation about Proxy Runtime.
The steps to enable IDoc communication on section A are:
For enabling Proxy communication:
As stated before the idea is to give PI system (B) the control for checking system availability of SAP systems (A) and second PI (C) before transmission start, verifying former process flow run in the past, triggering message sending from A, updating transmission details on C and also providing monitoring feature as described here.
After a little bit of debug on ABAP side I found the standard function module to activate qRFC is TRFC_QIN_ACTIVATE that is called to trigger Proxy messages processing. There was even the need to write an easy function module named Z_IDOC_CONTROLM, to handle message activation only for IDocs on each source system (A) involved.
So I wrote the Report that executes below mentioned steps:
For a deeper explanation about Report and to download ABAP code, click the link here.
After report creation you have to schedule a job for each interface involved in the scenario then filling the parameters to identify the flow together with a defined alert category to be raised in case of failure. Take in account to set a properly value to Max Queues Activation Time.
Receiver side of scenario is out of scope of this blog. From a functional perspective, a job on system (C) compares a table filled with flow details, to verify if "declared" number of messages is equal to the ones received and processed on system. If no errors occur a flag is set on a table meaning that new messages package can be received and processed. The results of the checks done are collected into a fast-view cockpit to accomplish a full monitored solution.
A successfully test scenario in shown below together with a fault case after which an alert is generated and a mail is forwarded to monitoring group.
Just to summarize, the steps needed to extend this approach to new flows are:
The scenario described is currently adopted from one of my customer and is currently handling Proxy and IDoc messages without facing any kind of problem, with monthly approx 85.000 messages exchanged.
Using Proxy approach with solution built here, there is also the chance to enable a fixed time process execution. As mentioned into SAP Documentation related to function TRFC_QIN_ACTIVATE (If you set the import parameter MAXTIME to a value not equal to 0 (0= unrestricted; the call is returned once the queue is empty), the qRFC Manager only activates the queue within the specified time. If the time runs out while the last LUW is being processed, this call is returned after the last LUW ), it's possible to calculate end time for processing messages on PI. Surely, that's not the best ideal solution since it's never a good approach to play with time while dealing with distributed programming, but one of my customer needs is to send messages generated on section A, within a fixed time slot, not before not later.
This approach provides with few restrictions a fixed and phased delivery process.
A limitation of this approach is that the validating job on PI system(C), needs a minimum amount of time to update and approve all different flows; let's define this time , tupdate = 2 min approx, that means also triggering job for each flow on PI system(B) must respect this time limitation. If ti is the starting time for flow named i, t MAXTIME is the value of Input parameter (Max Queues Activation Time) of the report then in order to avoid a job errod ti+1 > ti + tupdate + t MAXTIME.
That means to avoid errors on scheduled job, you have to schedule next job start for each independent flow, after previous job is finished + approving flow time on system C.
Finally, I wish to thank Sergio Cipolla for great given support.