Hi guys, in this article I want to shared step by step How to use XI receiver adapter to call ABAP proxy at backend ERP. As normally, take a look diagram

Explain this diagram little bit
SAP backend will create WEBSERVICE synchronous with input is request message and return result into response message.
Business logic code will be written in Inbound service provider with input is request message and output will return into response message.
Client from internet will call this WEBSERVICE through SAP CPI with communication channel called XI Receiver Adapter and SAP Cloud connect.
This scenario called is “CONSUME WEBSERVICE WITH ABAP PROXY”
Step by step configuration
CONFIGURATION AT SAP BACKEND TO RECEIVE MESSAGE XI 3.0
Configure local integration engine
T-Code : SXMB_ADM

Role of business is : Application System

In system which have no XI Server (PI/PO) we no need config this.
If we need change this config (Ex: Change Not yet configured to Application System)
- Edit -> Change Selected Configuration Data

Configure URL for XI Engine
T-Code : SMICM
This is URL will be exposed to outside
GOTO-> Services

The URL look like : HTTPS://<HOSTNAME>:<PORT>/sap/xi/engine?type=receiver&sap-client=<client>
SAP Cloud Connector will be configure mapping virtual host with this host.
Create Inbound Service Provider in SPROXY
T-Code : SPROXY
For example, I created one in SPROXY as

Run test this proxy with request payload

We will receive response

CONFIGURATION AT SAP CLOUD CONNECTOR
Login to SCC administrator


- (1) : Virtual host : anything
- (2) : Internal host : Host of Integration Engine Local in T-CODE : SIMCM
- (3) : HTTPS
- (4) : NON-SAP System
- (5) : Resource of URL integration engine in T-CODE : SIMCM
Check on SAP BTP Cockpit dashboard

CONFIGURATION INTEGRATION FLOW WITH XI RECEIVER APDATER
In this step, we will create simple integration flow with sender is SOAP adapter, and receiver with XI receiver adapter. We focus into configure of XI receiver adapter
Sender

We choose request-reply for message exchange pattern because we want to receive response message from ABAP proxy
Receiver is XI adapter


- (1) : http://<Virtualhost>:<port>/sap/xi/engine?type=receiver&sap_client=<client number of backend>
- (2) : On-Premise
- (3) : Basic Authentication
- (5) : Credential which created in Security Material with username/pass used to connect to SAP backend.

- (1) : Anything, but we should be put well-name. Example CPI_DEV.
- (2) : Business System of backend. This step, we must to input exactly business system of backend.
- (3) : Service interface of inbound service provider in SPROXY
- (4) : Service interface namespace of inbound service provider in SPROXY

Click to integration flow and choose tab Process

RUN TEST FROM SOAPUI
Go to T-Code SPROXY and copy payload request of inbound service provider and use it as body for request in SOAPUI

Bravo ! come to here, we configured successful this scenario. This is just small example for XI receiver adapter. For more detail about XI receiver adapter, we will take a look one more scenario
CALL ABAP PROXY WITH ASYNCHONOUS MESSAGE
Sometime, we just want to call ABAP proxy but no need message response. In this cases, we also user XI receiver adapter with config delivery assurance. In there, we use another quality of service then type best effort. It is Exactly One.
Exactly One is used for asynchronous one-way scenarios, that means if your sender system has an asynchronous interface through which you like to send a message to Cloud Integration you need to use this option. If you configure this option the message is temporarily stored in the Cloud Integration tenant and, if an error occurs, the message is retried from there. The sender gets the successfully received status as soon as the message is persisted in the temporary storage.
With Exactly Once. In this case the Temporary Storage needs to be defined. You can select to store the message temporarily either in the Data Store or in JMS Queues:
- When Data Store is selected, the message is persisted temporarily in the tenant’s database. The stored message can be monitored in the data store monitor.
- If JMS Queue is selected the message is stored in a JMS queue on the connected JMS broker. Note, that the JMS Queue option is the recommended option because it is more performant but is only available if you have an Enterprise edition or Integration Suite for the tenant.
If Data Store is configured as Temporary Storage, the following additional settings need to be defined:
- Retry Interval: Here you define after which time a retry shall be triggered if there was an error during message processing.
- Exponential Backoff: If the flag is selected (which I would recommend), the retry interval is doubled after each unsuccessful retry.
- Maximum Retry Interval: Here you enter the limit to avoid endless increase of the retry interval caused by the exponential backoff setting. This field is only available is Exponential Backoff is selected. The recommendation is to either keep the 60 minutes or even increase it if this is acceptable for the scenario.
- Encrypt Message During Persistence: If this option is selected the message is encrypted in the data store during temporary storage. Note that this is recommended if the message contains sensitive data. However, the drawback is that this setting reduces the performance slightly.
- Note that no configuration option is available for dead-letter queue handling. If the data store is used as temporary storage, the out-of-memory handling is always active. This means that after the 3rd retry caused by an out-of-memory, a message is blocked and taken out of further processing.
If JMS Queue is configured as Temporary Storage the following additional settings need to be defined:
- Retry Interval: Here you define after which time a retry shall be triggered if there was an error during message processing.
- Exponential Backoff: If the flag is selected, which I would recommend, the retry interval is doubled after each unsuccessful retry.
- Maximum Retry Interval: Here you enter the limit to avoid endless increase of the retry interval caused by the exponential backoff setting. This field is only available is Exponential Backoff is selected. The recommendation is to either keep the 60 minutes or even increase it if this is acceptable by the scenario.
- Dead-Letter Queue: You should select this option to handle potential out-of-memory situations caused by large messages. If selected, a message is blocked and taken out of further processing after the 3rd retry caused by an out-of-memory. More details about the dead letter queue handling can be found in blog How to configure Dead Letter Handling in JMS Adapter.
- Encrypt Message During Persistence: You define if the message is to be encrypted in the data store during temporary storage. Note that this is recommended for sensitiv data but it reduces the performance slightly.
For example, we change config of XI receiver adapter to Exactly One and use Data Store

Run test again from SOAPUI, in this here we will receiver payload request, not response because we use exactly one, one-way

Because this is asynchronous message so message will be in queue of backend and view log in SXMB_MONI we will see message with status schedule.

OK, next we will take simulation that backend cannot connect. This time client still receive status code 200 OK but message will be hold in datastore of CPI.

View in data store

OK, message will be in there until backend connect OK. This time, connection is OK. Check data store again, we will see that message sent to backend.


MORE DETAIL ABOUT THIS
All above step, we consider configuration in system which have XI Server (PI/PO) . When system have PI/PO ( XI Server), we config SLD and determinate business system.
But if system have no XI server (PI/PO), we cannot determinate Business System of Backend, and we call inbound ABAP proxy, we will receive System Error in SXMB_MONI of backend


Key word error :
- #SLD_NO_OWN_BS
- #Error while reading ID of own business system from SLD for system
How can we define business system when our system have no XI server (PI/PO) ? How can we fix above error ? OK , just declare business system in backend, we can fix this iss.
Fix Issue
Go to T-Code : SXMB_APPL


ISSUE-02_ XI receiver call to client default if your system have many client.
In case, your system have 2 clients, example 100 and 110. Although you call to URL

XI Receiver still call to Client default is 100. So, some case we will call WEBSERICES is wrong.
CAUSE & SOLLUTION TO FIX
Get this issue because we no set Client in service /sap/XI/engine.
To fix it, we have to:
- SICF
- PATH : /sap/XI/engine
- Logon Data
- Client = Set your client.

Summary
In this article, I shared step by step How to call ABAP proxy by XI Receiver Adapter from SAP CPI with synchronous & asynchronous message. Next article, I will shared how to send data from SAP backend on premise to external by call ABAP Proxy outbound to SAP CPI. Thanks for your reading and any advise, kindly leave your comment on below this. Thanks.
Joseph.
If there is no SLD from where do you take the Business System of the ERP?
LikeLike
Hi Recardo,
If there is no SLD we can config business system in T-CODE: SXMB_APPL
Step 01 : T-CODE : SXMB_APPL
Step 02 : Go to Business System
Step 03 : Display business system name
Step 04 : Create business system name.
LikeLike
Do you also have instructions on how to do this the other way around.
I mean collecting information in ABAP and passing that information to a CPI integration so the collected can be processed in the CPI integration and passed on to a different external system via for example a webservice.
LikeLike
Dear Arthur,
Sorry reply late.
This scenario look like inbound call web service from external system into S/4.
We also have another scenario collect data of S/4 and send to CPI, after that send to external by API. Kindly reference this article in this blog.
https://sapzero2hero.com/2022/08/12/working-with-xi-sender-in-cpi-and-s-4-hana-for-abap-proxy/
LikeLike