Hi guys, I’m comeback, so busy but not forget keep blogging. I love CPI :).
OK, for relax. Today I want to share my understand about one of the adapter in CPI, it’s XI adapter which include two parts
- XI sender adapter, using for configure OUTBOUND by ABAP PROXY in S/4 HANA
- XI Receiver adapter, using for configure INBOUND by ABAP PROXY in S/4 HANA
As you known, before we worked in system landscape which have join of PI/PO, this landscape I call it is On-Premise Landscape. Kindly take a look.

In this landscape, PI/PO will create structure as Data Type, Message Type, Service Interface and after that will be sync structure to S/4 OR ECC with type is Enterprise Service Repositories as you see in this

Base on configure categories of Service Interface in PI/PO, we will have service with type
- Inbound : Provider service – inbound ABAP proxy – SAP will code logic for front end (POS) call to its. ( Check stock, voucher on SAP ERP)
- Outbound : Consume service – Outbound ABAP proxy – SAP will call service of partner ( E-bank, E-Invoice…)

One more, base on configure Mode we can set call with 2 type
- Asynchronous : Just request, no need response
- Synchronous : Need request and response also.
OK, above is PI/PO. But today, I want to talk about cloud landscape. This is a cloud landscape

In cloud landscape, everything connect through FIREWALL, PROXY, CLOUD CONNECTOR, VPN SITE2SITE…
OK, I think take some overview so long. Now, We will configure one by one scenario in this cloud landscape with XI Adapter in CPI. I love CPI 🙂
Scenario 01 – POS query data on S/4
Step 01 – Configuration at backend S/4
Step 01/01 – Enable service XI.
T-CODE: SICF
Service path: /sap/XI/engine

Set Client for service.
Go to service
Tab Logon Data
Set Client

Step 01/02 – Configure SAP Cloud connector mapping host for XI (Reference on my blog)
Step 01/03 – Configuration for Integration Engine
T-CODE: SXMB_ADM
Integration Engine Configuration
Set Role of Business System is : Application System

Step 01/04 – Create business system name
T-CODE: SXMB_APPL
Node: Business System
Node: Display business system name

Step 01/05 – Create namespace in MDR (Metadata repository)
T-CODE: SPXNGENAPPLÂ


Step 01/06 – Create Enterprise Service
T-Code:SE80
Create new package
Right click package – create – Enterprise Service

Right click Enterprise service – create :
- DATATYPE
- MESSAGE TYPE (Refer to DATATYPE)
- SERIVCE PROVIDER
- Add Operation
- Set request (Refer to structure of request)
- Set response (Refer to structure of response)
- Add Operation




Step 01/07 – Dummy code
Double click on ABAP Name


Add some code for FUN.

Step 01/08 – TEST PROXY


Step 02 – Create and configuration IFLOW



Step 03 – TEST CASE
Test case 01 – Send synchronous (Request and Response)

When using POSMAN to test, we will see that result the same with Step 01/08

Test case 02 – Send Asynchronous, message will schedule in S/4 (SXMB_MONI)

When using POSTMAN to test this, response will descript because we use JMS.

This time, message will schedule on S/4. Using SXMB_MONI, we will see message in queue

…and we have to go queue and active message.
Scenario 02 – S/4 send file XML to FTP by using Consumer service.
We will continue on NAMESPACE, DATATYPE, MESSAGE TYPE IN Scenario 01 for save time.
Step 01 – Configuration S/4
Step 01/01 – Create Service Consumer
Right click Enterprise Service
Create Service Consumer
Backend




Step 01/02 – Integration Engine Configuration
T-CODE: SXMB_ADM
Configure Sender/Receiver ID

Integration Engine Configuration


Step 01/03 – Create new RFC type G
This step will create new RFC type G (Reference in my blog for detail, just the same configuration as Outbound), enter HOST of subaccount, PORT, Path Prefix (refer in deploy IFLOW), Client ID, Client Secret, SSL…

Step 02 – Create and configuration CPI



Step 03 – TEST CASE
TEST CASE 01 – Execute consumer service and send payload to SFTP server


ISSUE 01 – we have no LOGICAL PORT PI for default.
Fix ISSUE 01 – WITHOUT LOGICAL PORT PI
Go to SOAMANAGER (https://<host>:<Port>/sap/bc/webdynpro/sap/appl_soap_managerment?sap_client=<xxx>&SAP_language=EN#)




Run Test again

ISSUE 02 – ABAP.PRX_PROTO_NOT_SUPPORTED Proxy protocol due to invalid destination is not available. Please check the configuration of the l
Fix USSUE 02 – Add destination in Integration Engine Configuration


Run test again




NOTE: In ABAP Program, call to this consumer service, after process is done, do not forget COMMIT.
Check message in SXMB_MONI

Check on SFTP

Scenario 03 – S/4 call WEBSRVICE and receiver response by using Consumer service.
Step 01 – Configuration at backend SAP S/4
Step 01/01 – Add operation with request and response.
In this scenario, we will one more method, example named method_2 which will have Request and Response. Let continue with steps configure above and go to Consumer Service, Add one more operation
NOTE
We also reference steps above for configure RFC, Integration Engine, and also take focus ISSUE-01, ISSUE-02…

In this operation, we have request (Output) and response (Input). ABAP program will call this consumer service with input data is USERNAME, INVOICE_NO, AMOUNT. After that send request to CPI with adapter XI Sender.
CPI will call to service of Partner and mapping data response from partner with structure of RESPONSE of Consumer Service.
We will get structure WSDL of consumer service and use it in CPI.

Step 02 – Create and configuration integration flow on CPI



This will mapping request to response, the end response data will return to ABAP PROGRAM.
NOTE
The message return must the same with structure with response on Consumer Service.

Step 03 – TEST CASE
Go to consumer service and execute

Execute this request, will call to XI Sender and return the payload response. Take look

Summary
So long blog :). OK I think that this post can enough for scenario XI adapter in CPI. Take a look about 2 ISSUE which I mention above. I posted some article about XI adapter in my blog, you can refer to them. Thanks for your reading and any advise, kindly leave your comment on this.
Thanks.
Joseph.