Recently I was working on an interface where users were updating materials in a database, and these changes had to be sent to their SAP backend system (ECC). They wanted to leverage an existing RFC in order to minimise the amount of extra development required, and the response from the RFC call needed to be saved in the database:

Unfortunately SAP PI does not provide a synchronous sender JDBC adapter which is needed for this interface. Although this makes sense from a technical standpoint, it can be limiting when you really need it.

While it’s not possible to have a true synchronous JDBC adapter, it is possible to combine a Sender and Receiver channel in order to get a similar result. Assuming the sender channel has already been set up (asynchronously), the first step is to tell PI that there will be a response message to handle:

Be careful to match up the Module Keys, and note that parameters are case-sensitive.

The second step is to tell PI what to do with the response message. We want to redirect it to a receiver channel which has already been created. The details we need to provide can be found in the receiver channel object:

With this we can fill in the last details:

Using this set-up, we can assign synchronous interfaces to the sender channel, and for the most part there will be no difference. However, there are a couple of things to consider:

  • The sender and receiver channel do not run in the same database session
    Commit and rollback statements should be used correctly in order to avoid locks (especially relevant when the response updates the same record)
  • The channels appear separately in the monitoring tools
    When troubleshooting, you will need to check both channels.