Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
francois_vigneron
Participant
The validation of Peppol messages is one of the functionalities that the Peppol service of SAP Document Compliance, cloud edition offers. Validation results are directly available in the eDocument cockpit of your backend system (ECC, SAP S/4HANA, SAP S/4HANA Cloud) for users to take action on.

But how to do a first check invoices before the Peppol Exchange service of SAP Document Compliance is connected? That would e.g. make it possible to fix settings and extend the Peppol message (if applicable) while another colleague proceeds with the cloud integration. For that, many consultants would like to use a local tool or upload files to an online validator.

Let's first look at how to prepare the message (A) and then check how to upload it to an online verification portal (B) and implement a local validation tool (C).

A) Prepare the invoice


The trick is simply to remove the document header while copying its properties to the Invoice tag. From the eDocument Cockpit, export the Invoice file[1]. It will have the following structure:
<n0:StandardBusinessDocument xmlns:n0="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:prx="urn:sap.com:proxy:CCF:/1SAI/TAS9290DB4E2471E379E3D0:779" xmlns:n1="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:n2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:n3="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<n0:StandardBusinessDocumentHeader>
[…]
</n0:StandardBusinessDocumentHeader>

               <n3:Invoice >
[…]
                </n3:Invoice>

</n0:StandardBusinessDocument>

 

Using a tool such as Notepad++[2], you need to remove the header parts (don’t forget the last </n0:StandardBusinessDocument> at the end of the file) and copy the properties to the Invoice tag. Only the bold parts should remain.

The new file looks like this:
<n3:Invoice xmlns:n0="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:prx="urn:sap.com:proxy:CCF:/1SAI/TAS9290DB4E2471E379E3D0:779" xmlns:n1="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:n2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:n3="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">

[…]

</n3:Invoice>

Save the file locally.

B) Use an online validation tool


If you want to use an online validation tool, such as the ones provided by local government platforms such as ZRE or OZG-RE in Germany or VEFA in Norway. If the tool is provided by a third-party, check upfront if uploading complies with your company policies for data protection and confidentiality.

If asked for, select the right rule set, e.g.:

  • for the mandatory Peppol invoice profile, OpenPEPPOL Invoice,

  • for Germany, XRechnung UBL Invoice, etc.


The tool should now provide a detailed validation report and give you hints on whether there is a need to adjust the message and where exactly.

C) Use a local validation tool


As an illustration, we use the KoSIT validator available for Germany. The online documentation is quite self-explanatory. Let's go step by step.

Installation


1. Create a test folder on your local computer.

2. Download the KoSIT tool. At the time of writing, the latest version available is 1.4.

3. Unzip both files.

Use


1. Under Windows, start cmd. Under Mac or Linux, use your preferred terminal.

2. Go to the test folder.

3. There, enter:

  • java -jar ${jar_of_your_choice}.jar -s scenarios.xml [FILE] -h ubl.xml

  • Example: java -jar validationtool-1.4.0-standalone.jar -s scenarios.xml 01.01a-INVOICE_uncefact.xml -h ubl.xml


4. Open the newly created validation report, in our example 01.01a-INVOICE_uncefact-report.html


Validation KoSIT XRechnung 2.0 call


The version 1.4 of the KoSIT validator is calibrated for XRechnung 2.0. If the validation report does not create, check the CustomizationID in your invoice header:

  • If it still has (which should no more be from January 2021): <n2:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2</n2:CustomizationID>

  • Change it to: <n2:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0</n2:CustomizationID>


Debugging 

  • If at Use / step 3, you get an error like "java.lang.NoClassDefFoundError", it's probably due to your Java version being 11 or above. My workaround has been to use an older Java version in parallel.


Happy testing!

For question to the KoSIT tool, please refer to the corresponding GitHub at https://github.com/itplr-kosit. If you have other questions, please use the Ask a Question link in the top right corner.

For more information on SAP Document Compliance visit this Community page. For further context details on XRechnung, see the blog series All you wanted to know about the electronic invoice in Germany (English, German). For details on testing Peppol, see Peppol – Attention points for testing. For details on testing ZUGFeRD, see the blog How to change E-Mail during test phase?

 

[1]  The cockpit can be accessed with transaction EDOC_Cockpit. To export a file, select its line then click the menu item Go To > eDocument History > select the third line > Export file.

[2] For nicer formatting, use the plugin XML Tools (Plugins > XML Tools > Pretty print).

The first part of the blog has been written with input from ga.nagy.
4 Comments