Skip to Content
Technical Articles
Author's profile photo Kaustubh P Deshpande

Working with Custom Routing in SAP ARIBA CIG

We all are aware that SAP ARIBA is on cloud edition and can be integrated with SAP S4 HANA or SAP ERP backend / backends via CIG (Cloud Integration Gateway on cloud middle ware based on CPI).
To achieve transactional or master data flow from one system to another flawlessly, SAP ARIBA has given standard interfaces. Also, there is document routing for interfaces coming from external suppliers. However, in practice, its observed that for some cases where in CXML message is showing some other target system and hence CIG interface went in to ERROR or Failed status.
To address such cases one can easily configure the custom routing in CIG. Integration consultant must know that there is mapping possible without changing the CXML message format to handle the project situation.
Earlier customer support use to set up this routing for customer documents.
Customer support must enable the functionality of mapping custom routing via SR.

What way we can use custom routing in CIG.
We can use this routing to send data via documents within SAP ARIBA applications to ARIBA Network or to SAP ERP. We can map both inbound and outbound paths via this custom routing within CIG.

Case1- If invoice coming from Supplier portal in to S4 HANA is coming as system id “Child”, and because of which CIG document status “InvoiceDetailRequest” use to get in to error or failed. We must need to go with the custom routing. Here we should define the X Path in configuration (Path till system id equals to Child in CXML message). We should instruct the system that where ever this document comes with “Child” as system id please in CXML replace it with Action Value as “XYZCLNT100” so as to get invoice in to ERP or S4 HANA system.

Case2- If we have multiple ERP systems connected to one SAP ARIBA buying, to receive the PO acknowledgement back from SAP ERP. “PurchaseOrderExportRequest”


Company code is filtering criteria used in X path.

Case3- When ever Quote Request is been sent from S4 HANA to SAP ARIBA and if we have single endpoint (System ID for both Ariba sourcing and Ariba Procurement is same) mapped for all processes.
IDOC generated in S4 has system name as ABCCLNT100 which then we want to be replaced as CHILD1.


Steps to create routing in CIG.

1.Log in to the SAP Ariba Cloud Integration Gateway portal.

2.Go to My Configuration and then click Custom Routing.

3.Click Create Custom Routing.

4.Choose the following on the My Configuration – Custom Routing page:

Direction: Choose the direction for the documents.

Inbound – To route documents flowing from Ariba Network or SAP Ariba applications to a specific SAP ERP system.

Outbound – To route documents from the SAP ERP system to Ariba Network or SAP Ariba applications.

Document Type: Choose the document type for the transaction.

Action: This field stores the value “Replace System ID.”
Name: Enter a name for the custom routing.
Description: Enter a description for the custom routing.

Action Value: Choose the system ID for the SAP ERP system. SAP Ariba Cloud Integration Gateway routes the transaction documents to this SAP ERP system.

5.In the Conditions table, click the plus sign (Add) to specify the Xpath.
Select from the available Xpaths.

To create a new Xpath, click the New XPath button.

In the Custom XPath pop up, enter values for the Name, Description, XPath, Data Type fields.

To edit an existing Xpath, click the edit icon for an Xpath and modify the required values.

6.Specify the Operand, Expected Value, and Conjunction conditions for the Xpath.
7.Save the changes.
8. Activate the new routing

Summary– As a Integration consultant can able to configure the custom routing in  SAP ARIBA CIG.

Sources/ References


2) “SAP Ariba Cloud Integration Gateway January_February 2019 release guide”

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Ramesh Gulipalli
      Ramesh Gulipalli

      Hi Kaustubh,

      your blog is very nice.

      I have same requirement  and implemented the your blog.I created 2 projects one for target for S4 Dev and one for S4 QA in CIG.Created custom routing  for but it is failed document in CIG.Could you please help me on this issue.



      Cutom routing:




      Author's profile photo Kaustubh P Deshpande
      Kaustubh P Deshpande
      Blog Post Author

      Sorry Ramesh,

      Can you please let me know which document ( PR , PO , Invoice etc) you need to sent from which system to which ? I am not clear with your screen shots.

      I can see from screen shots Error is at PR import interface and you have configured in custom routing for PO export and PR budget interface. Which is not correct, if you want to handle custom for PR Import interface , so same interface has to be there in custom routing too.

      1. If you want to send PR from S4 to ARIBA BUYING - CIG is not supporting it yet.
      2. For your error did you raised the SR to SAP ARIBA?



      Author's profile photo Tuan Duc Le
      Tuan Duc Le

      Dear mate,

      I got a concern on this, in the Endpoint in Administration tab, we can define the Document Routing as flip back to original Order, example that Purchase Order sent from S4 to AN, and once Order Confirmation has done, Inbound message will base on itself original outbound message SystemId to flip back to S/4.

      From your example, I see this is for case REPLACE the SystemId to its appropriate before CIG sends it to Backend.

      So this custom routing is the same thing with the setup of Routing correct?

      Please correct me from wrong.


      Author's profile photo Shikha Ghodeshwar
      Shikha Ghodeshwar

      Hi All,
      I want to conact three filed in output cXML for CIG mapping but i am not able to see any option to concat more than two fields.
      Can you please let me know that it is possible or not ? Or how can i concat three fields?

      Author's profile photo Shikha Ghodeshwar
      Shikha Ghodeshwar

      Hi Kaustubh,


      How can we add crossref for custom routings. Since in already implemented project new system id is not avaibale which is used for custom routing

      Author's profile photo Pedro Marques
      Pedro Marques

      Hi Guys,


      How can I make the custom routing based on a custom field. For example:

      - ERPOrder_PurchOrdHeaderDetails_Item
      - item
             - custom
                <CustomString name="PurchasingUnit">XYZ</CustomString>

      I saw this option, below but I'm not sure how to reflect it on the Custom Mapping only for "PurchasingUnit equals "XYZ"


      Any clue?

      Thank you.

      Author's profile photo Raja Muhamad Amril bin Raja Rahaizat
      Raja Muhamad Amril bin Raja Rahaizat

      Hi Guys,

      With regards to the custom routing shared, would like to check if we are able to also leverage on the custom routing if we are having 2 different system to connect to at one time. For an example, Purchasing Unit 1000 will send/receive transaction from SAP ECC meanwhile for Purchasing Unit 2000 will send/receive transaction from SAP S/4HANA?

      Appreciate your feedback.


      Author's profile photo Harsh Agarwal
      Harsh Agarwal

      Hi Raja,

      Hope you re well, I have similar kind of requirement and we are looking forward to custom routing. Did you managed to find a solution for this?

      A response would be much appreciated.