Skip to Content
User Experience Insights

Electronic invoice for Italy with SAP Business ByDesign

This blog will describe how to configure the transformation settings to enable the system to send an electronic invoice in Italy.

In Italy it is legally required to provide an electronic invoice when dealing with any Italian company.

The Government has created a specific layout for the XML format that must be complied with.

Then, using the standard functionality of e-invoicing with SAP Business ByDesign, see the blog https://blogs.sap.com/2020/07/22/e-invoicing-with-sap-business-bydesign/, we created the two needed XSLT files for transformation, one to automatically create the Italian e-invoice for customer

and other one to correctly acquire the supplier invoice in the same format.

For customer Invoices, once the transformation has been correctly assigned to the output channel selection

system will automatically create the final XML file in the output history, once the customer invoice has been posted

For Vendor Inovices, you have to upload the vendor XML file and select the XSLT Transformation ID to use.

The system processes the XML input file and create the vendor invoice entry in ByD.

How to create XSTL files?

Using existing tools like Altova XMLSpy, Oxigen XSLT Editor, EDITIX, Liquid Studio, you can develop XSLT file needed for the transformation.

For Customer Invoices, Byd produce an XML file containing all invoice information. Using the XSLT for Customer Invoices you can obtain a “custom” XML output.

For Vendor invoice you need to transform the supplier XML file  into XML defined into webservice “Manage Supplier Invoice”.

We conclude, that we have covered in this blog post the configuration of the transformation settings to be able to send and receive the electronic invoice according to the Government directives.

2 Comments
You must be Logged on to comment or reply to a post.
  • Im having so much trouble with the xslt file, I dont have experience working with it before so thats the main issue, but whatever file I put as the .xslt it results in an error when trying to see the output XML from a released customer invoice. Did you have the same issue ?

    I tried using the first part of an example in this sap blog post:
    https://blogs.sap.com/2020/10/16/sap-business-by-design-output-management-part-2/comment-page-1/#comment-542459

    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
    	<xsl:output encoding="UTF-8" indent="yes" method="xml" />
    	<xsl:strip-space elements="*" />
    	<xsl:template match="/">
    		<b1i-xs1:Invoice xmlns:b1i-xs1="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:Q2Q:/1SAI/TAS369B8FA8185C943E30C3:711:2008/09/23">
    			<cbc:ID>
    				<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/ID" />
    			</cbc:ID>
    			<cbc:DueDate>
    				<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/Date" />
    			</cbc:DueDate>
    			<cac:PayeeParty>
    				<cac:PartyIdentification>
    					<cbc:ID>
    						<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/BuyerParty/InternalID" />
    					</cbc:ID>
    				</cac:PartyIdentification>
    				<cac:PartyName>
    					<cbc:Name>
    						<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/BuyerParty/FormattedName" />
    					</cbc:Name>
    				</cac:PartyName>
    			</cac:PayeeParty>
    			<cac:LegalMonetaryTotal>
    				<cbc:LineExtensionAmount currencyCode="USD">
    					<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/PriceAndTax/NetAmount" />
    				</cbc:LineExtensionAmount>
    				<cbc:TaxExclusiveAmount currencyCode="USD">
    					<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/PriceAndTax/TaxAmount" />
    				</cbc:TaxExclusiveAmount>
    				<cbc:TaxInclusiveAmount currencyCode="USD">
    					<xsl:value-of select="/n0:FormInvoiceRequest/CustomerInvoice/PriceAndTax/GrossAmount" />
    				</cbc:TaxInclusiveAmount>
    			</cac:LegalMonetaryTotal>
    			<cac:InvoiceLine>
    				<xsl:for-each select="/n0:FormInvoiceRequest/CustomerInvoice/Item">
    					<cac:Item>
    						<cbc:ID>
    							<xsl:value-of select="ID" />
    						</cbc:ID>
    						<cbc:Description>
    							<xsl:value-of select="Description" />
    						</cbc:Description>
    					</cac:Item>
    				</xsl:for-each>
    			</cac:InvoiceLine>
    		</b1i-xs1:Invoice>
    	</xsl:template>
    </xsl:transform>
    

    Ive tried it out on an online transformer and it should generate at least some kind of an XML but all I get is errors in byd.

     

    One more question, do you just send the generated XML to an endpoint or do you have another step in between where you generate the propper request. Im asking because I have to send username, password and the xml in the body of my POST request but I think this way it just sends the generated XML ?

    Best regards.

  • Hi Josip!

     

    Please vote for the e-invoice improvement request, so it would be easier to send out e-invoices:

    https://influence.sap.com/sap/ino/#/idea/258859/
    Thank You!
    Kind regards,
    Siim-Joonas Räim