9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner About
About
Home / Community / Blogs + Actions
Testing Ariba Network integration cXML with SAP
ERP MM
November 24, 2015 | 6,118 Views |
Andreas Muno
more by this author
MM (Materials Management)
ariba | ariba-sap erp 6.0 | aribaintegration | badi | cxml | former jive document | invoice
share
0 share tweet share
Follow RSS
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 1/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
As you are integrating your SAP ERP MM with the Ariba Network to digitize and automate
your purchase order to invoice and payment processes in collaboration with your suppliers,
you will at some point in time have to test proper processing of cXML messages such as
invoices coming in from your suppliers on the Ariba Network. Well, before you go about
real data from your real suppliers, you may want to test with some dummy supplier on the
network.
If you were to do do something as “daring” as implement one of the Business Add-Ins (or BAdI for short, even
though they are also goodies for you, for sure), you’d want to see how the data coming in with the cXML
message are going to be processed in your ERP system. Alright. Do something daring today. Implement a
BAdI.
This test guide shall lead you through the respective testing procedure. It is provided with best knowledge
and intent, based on SAP–internal development and test landscapes. Customizations in your landscapes
may be different and will have to be adapted accordingly.
Preconditions for this test to work
All you need at this point are:
A test account as a supplier (sic) on the Ariba Network (ask your Ariba AE or support contact to
provide you with one, or just use the attached cXML template and test data files)
An SAP ERP system, at least at ECC 6.0, with the Ariba Network Integration for SAP Business
Suite Add-On 1.0 installed. How to do that is described in this help.sap.com link (scroll down to
Installation and Upgrade Information, and apply notes for Foundation Component ARBFNDI1 and
2 as applicable to your ERP release level, and the note for SAP ERP Integration Component
ARBERPI1).
Obtaining a cXML File from an Ariba Supplier
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 2/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Buyers who correspond with their suppliers using the Ariba Network can obtain cXML files of the
invoices the suppliers send them. The supplier needs to log on to his Ariba account, go to one of the last
invoices sent and export the cXML file. The cXML downloads as a text file.
Figure 1 Ariba Network – Supplier View of an Invoice
Figure 2 cXML downloads as text file
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 3/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Figure 3 cXML Text File Sample
For your convenience, a sample xml text is copied below at XML Sample, and I attached a template and
my own test data file for you.
Using cXML File in SAP ERP
In the SAP ERP system, use transaction SPROXY.
Select the Enterprise Services Browser and find package ARBFND1_PRX. (If you can’t find that package for
the heck of it, the add-on has not yet been installed. Get your basis team to install that for you following the
instructions mentioned above at “Preconditions”.)
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 4/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Figure 4 SPROXY – Enterprise Service Browser – ARBFND1_PRX
Doubleclick on Object cXMLInvoiceDetailRequest_In to obtain the object details displayed in figure 4 on
the right hand side.
With the cursor still on object cXMLInvoiceDetailRequest_In start the test with function key F8. A popup
window appears which you just need to confirm.
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 5/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Figure 5 – Popup Window creating request template – just confirm
Figure 6 – XML Request Template – use button “XML Editor” or (Ctrl+F2)
In the request template, you need to replace the message type “String 1” with “InvoiceDetailRequest”,
and replace everything between <cXML> and </cXMLMessageContent> with the respective content
from your cXML file (in the attached zip). In order to do that, you first need to open the cXML Editor
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 6/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
using keys Ctrl+F2. For practical purposes, we shall assume it is indeed the InvoiceDetailRequest that you
are planning on testing.
From the cXML test file (below and attached), copy only the text in between <cXML payloadID … and
</Request></cXML>, but not the first two lines
<?xml version=”1.0″encoding=”UTF-8″?> and <!DOCTYPE cXML SYSTEM
“http://xml.cxml.org/schemas/cXML/1.2.028/InvoiceDetail.dtd“>.
Figure 7 – Insert the content from the cXML file into the Test Service Provider editor
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 7/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Use the XML checker (function key F9) to ensure a well-formed XML. The checker will return with errors
that are easy to solve.
Figure 8 – The checker will throw errors which are easy to solve
Confirm the error, and see in which line the checker highlights the issue. Most likely, the text file has
separated strings that belong together for the XML parser to recognize. Just mend those lines by rejoining
loose ends. Here are some examples:
Figure 9 – XML parser found an open bracket and threw an error
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 8/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
In Figure 9, the highlight in line 88 and the position of the cursor show where the parser stumbled. Apparently,
the bracket was not closed. You can easily fix that. Position the cursor after PA</ and delete the trailing white
space.
Figure 10 – Once the white space is eliminated, test again
Once the white space is eliminated, test again, until no further issues occur and the checker confirms
“XML is well-formed”.
Here some more samples for errors and how the fix looks.
Figure 11 – Parser throws “Error while parsing an XML stream: ”=’ expected’.”
Here you’ve got to fix the connection of the open bracket at the end of line 122. See Figure 12 below.
Figure 12 – Line 122 had an open bracket. Close it by deleting trailing white space of line 122
Figure 13 – Again a trailing white space issue in line 138 …
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 9/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Figure 14 – … easily fixed by eliminating white space
Once the checker confirms “XML is well-formed”, you can go on and test the request.
Test the Request
Press Execute button or use function key F8.
A Response tab will open and likely show some error due to missing customer-specific configuration.
Figure 15 – The Response tab shows errors, mostly due to missing configuration
Typical errors related to missing configuration are identified as
028(ARBERP_MAP “No company code assigned to NetworkID in Customizing”, or
122(ARBERP_MAP), “No company code could be determined for partner name [partner name]
sent by vendor”.
Basic Customer-specific Settings
In order to eliminate message 028, assign a company code to the network ID in customizing.
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 10/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
In transaction SPRO, open the SAP Reference IMG (F5) and follow this path of the SAP Customizing
Implementation Guide:
Integration with Other SAP Components > SAP Business Suite Integration Component for Ariba >
Application-Specific Settings > SAP ERP Integration Component for Ariba > Assign Ariba Network ID to
Company Code. Enter the network ID from your cXML file introduced by brackets <To> <Credential
domain=”NetworkID”> <Identity>, e.g. “AN02000277436” and assign a valid company code.
Figure 16 – Customizing for Ariba Network ID and Company Code
Retest the Request. You may have to restart the test by returning to transaction SPROXY. Download your
XML file and reload it as you restart the test.
Breakpoint for Customer BAdI
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 11/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
In transaction se80, you can set a breakpoint in class CL_ARBERP_MAP_IN, METHOD:
IF_ARBFND_APPL_IN~EXECUTE_APPLICATION_INBOUND, at “me-
>call_define_cust_spec_pro_badi”.
Or you set a breakpoint in class CL_ARBERP_MAP_IN, method
CALL_DEFINE_CUST_SPEC_PRO_BADI.
In order to implement the BAdI method for processing Invoices, consider methods
DEFINE_CUST_SPEC_PROCESSING and MAP_INVC_TO_BUS2081_IN_PRE.
Implement the BAdI from the IMG (Figure 16).
Bonne chance!
This concludes the test procedure. Please let me know your results, and suggestions for improvement.
XML Sample
[This sample was taken from a test supplier on the Ariba Network and represents a test invoice for
services]
<cXML payloadID=”[email protected]″ timestamp=”2015-11-10T12:49:13-
08:00″><Header>
<From>
<Credential
domain=”NetworkID”>
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 12/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
<Identity>AN02000277438</Identity>
</Credential>
<Credential
domain=”VendorID”><Identity>9010</Identity></Credential><Credential
domain=”PrivateID”><Identity>9010</Identity></Credential></From>
<To>
<Credential
domain=”NetworkID”>
<Identity>AN02000277436</Identity>
</Credential>
</To>
<Sender>
<Credential domain=”NetworkID”>
<Identity>AN01000000001</Identity>
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 13/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
</Credential>
<UserAgent>SCMSupplier</UserAgent>
</Sender>
</Header>
<Request
deploymentMode=”production”><InvoiceDetailRequest><InvoiceDetailRequestHeader invoiceDate=”2015-11-10T12:49:13-
08:00″
invoiceID=”INV025775″ invoiceOrigin=”supplier” operation=”new”
purpose=”standard”><InvoiceDetailHeaderIndicator/><InvoiceDetailLineIndicator/><InvoicePartner><Contact
role=”remitTo”><Name
xml:lang=”en”>9010 LOB Nala
Supplier1</Name><PostalAddress><Street>PO12129</Street><Street/><Street/><Street/><City>Pittsburg</City><State>P
A</State><PostalCode>15222</PostalCode><Country
isoCountryCode=”US”>United
States</Country></PostalAddress></Contact></InvoicePartner><InvoicePartner><Contact
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 14/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
role=”billTo”><Name
xml:lang=”en”>BestRun USA</Name><PostalAddress
name=”IDES
US INC”><Street>1230 Lincoln Avenue</Street><City>NEW
YORK</City><State>NY</State><PostalCode>10019</PostalCode><Country
isoCountryCode=”US”/></PostalAddress><Phone><TelephoneNumber><CountryCode
isoCountryCode=”US”>1</CountryCode><AreaOrCityCode> </AreaOrCityCode><Number>212-345-
0983</Number></TelephoneNumber></Phone><Fax><TelephoneNumber><CountryCode
isoCountryCode=”US”>1</CountryCode><AreaOrCityCode> </AreaOrCityCode><Number>212-345-
5693</Number></TelephoneNumber></Fax></Contact></InvoicePartner><InvoicePartner><Contact
role=”from”><Name
xml:lang=”en”>9010 LOB Nala
Supplier1</Name><PostalAddress><Street>.</Street><Street/><Street/><Street/><City>New
York</City><State>NY</State><PostalCode>10021</PostalCode><Country
isoCountryCode=”US”>United
States</Country></PostalAddress></Contact></InvoicePartner><InvoicePartner><Contact
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 15/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
role=”billFrom”><Name
xml:lang=”en”>9010 LOB Nala
Supplier1</Name><PostalAddress><Street>.</Street><Street/><Street/><Street/><City>New
York</City><State>NY</State><PostalCode>10021</PostalCode><Country
isoCountryCode=”US”>United
States</Country></PostalAddress></Contact></InvoicePartner><InvoicePartner><Contact
role=”soldTo”><Name
xml:lang=”en”>LOB NALA
BUYER2</Name><PostalAddress><Street>PO12129</Street><Street/><Street/><Street/><City>Pittsburg</City><State>PA</
State><PostalCode>15222</PostalCode><Country
isoCountryCode=”US”>United
States</Country></PostalAddress></Contact></InvoicePartner><InvoiceDetailShipping><Contact
role=”shipFrom”><Name
xml:lang=”en”>9010 LOB Nala
Supplier1</Name><PostalAddress><Street>PO12129</Street><Street/><Street/><Street/><City>Pittsburg</City><State>P
A</State><PostalCode>15222</PostalCode><Country
isoCountryCode=”US”>United
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 16/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
States</Country></PostalAddress></Contact><Contact
addressID=”3200″ role=”shipTo”><Name
xml:lang=”en”>Atlanta</Name><PostalAddress
name=”default”><Street>867 1 300 Peach tree
street South</Street><City>ATLANTA</City><State>GA</State><PostalCode>30310</PostalCode><Country
isoCountryCode=”US”/></PostalAddress><Phone><TelephoneNumber><CountryCode
isoCountryCode=”US”>1</CountryCode><AreaOrCityCode/><Number>040-22707-
0</Number></TelephoneNumber></Phone><Fax><TelephoneNumber><CountryCode
isoCountryCode=”US”>1</CountryCode><AreaOrCityCode/><Number>040-22707-
101</Number></TelephoneNumber></Fax></Contact></InvoiceDetailShipping><PaymentTerm
payInNumberOfDays=”14″><Discount><DiscountPercent
percent=”3.000″/></Discount></PaymentTerm><PaymentTerm
payInNumberOfDays=”30″><Discount><DiscountPercent
percent=”2.000″/></Discount></PaymentTerm><PaymentTerm
payInNumberOfDays=”45″><Discount><DiscountPercent
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 17/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
percent=”0.00″/></Discount></PaymentTerm><Extrinsic
name=”invoiceSourceDocument”>PurchaseOrder</Extrinsic><Extrinsic
name=”invoiceSubmissionMethod”>Online</Extrinsic></InvoiceDetailRequestHeader>
<InvoiceDetailOrder><InvoiceDetailOrderInfo><OrderReference orderID=”4500025775″><DocumentReference
payloadID=”005056834D3E1ED5A1FBD5C2FFD76286″></DocumentReference></OrderReference></InvoiceDetailOrderInfo><Invo
iceDetailServiceItem invoiceLineNumber=”1″ quantity=”100″><InvoiceDetailServiceItemReference
lineNumber=”1000200010″><Description xml:lang=”en”>Gardening
Servies</Description></InvoiceDetailServiceItemReference><ServiceEntryItemReference serviceEntryDate=”2015-11-
10T12:43:16-08:00″ serviceEntryID=”SES25775″ serviceLineNumber=”1″><DocumentReference payloadID=”1447188196796-
[email protected]″></DocumentReference></ServiceEntryItemReference><SubtotalAmount><Money
currency=”USD”>1700</Money></SubtotalAmount><UnitOfMeasure>HUR</UnitOfMeasure><UnitPrice><Money
currency=”USD”>17</Money></UnitPrice><GrossAmount><Money
currency=”USD”>1700</Money></GrossAmount><NetAmount><Money
currency=”USD”>1700</Money></NetAmount></InvoiceDetailServiceItem></InvoiceDetailOrder><InvoiceDetailSummary><Su
btotalAmount><Money currency=”USD”>1700</Money></SubtotalAmount><Tax><Money
currency=”USD”>0.00</Money><Description xml:lang=”en”></Description><TaxDetail category=”Tax Exempt”
percentageRate=”0″><TaxableAmount><Money currency=”USD”>1700</Money></TaxableAmount><TaxAmount><Money
currency=”USD”>0.00</Money></TaxAmount><Description xml:lang=”en”>NALA LOB
Exempt</Description></TaxDetail></Tax><GrossAmount><Money
currency=”USD”>1700</Money></GrossAmount><NetAmount><Money
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 18/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
currency=”USD”>1700</Money></NetAmount><DueAmount><Money
currency=”USD”>1700</Money></DueAmount></InvoiceDetailSummary></InvoiceDetailRequest>
</Request>
</cXML>
Alert Moderator
2 Comments
You must be Logged on to comment or reply to a post.
Former Member
April 7, 2016 at 5:06 am
Hi Andreas,
This is really helpful blog to test an AN invoice.
Thanks
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 19/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Varun Goel
Former Member
April 7, 2016 at 2:52 pm
Hi Andreas,
While testing Invoice Details proxy, we got an error:
<text>Cannot determine last retry information for XML msg. ID 005056B11EF01ED5BF946C33B116ACE4; contact SAP”. This
message belongs to message class ARBFND_FRW.</text>
<id> 026(ARBFND_FRW) </id>
This error terminated the process as well.
Upon further analysis, the source of this error message seems like a missing protocol “IF_WSPROTOCOL_SEQUENCE”. could
you please suggest if any other configurations are required.
Thanks
Varun Goel
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 20/21
9/10/2018 Testing Ariba Network integration cXML with SAP ERP MM | SAP Blogs
Share & Follow
Privacy Terms of Use Legal Disclosure Copyright Trademark AdChoices Sitemap Newsletter
https://blogs.sap.com/2015/11/24/testing-ariba-network-integration-cxml-with-sap-erp-mm/ 21/21