This blog contains the guidelines to populate field values in the ModifyXMLData BAdI implementation. In this blog you will learn how to modify legally allowed fields in the SII XML before sending it to the tax authority.
You have installed the latest version of SAP Cloud Applications Studio
The ModifyXMLData BAdI should be implemented with the filters
We have opened the SII XML for partners/customers to add custom logic to change field values in the SII incoming and SII outgoing XML.
Let us take an example of outgoing scenario where we need to report a customer invoice with Regime 12. When Regime 12 needs to be reported, the mandatory table also needs to be updated.
First, we will see how to change the Regime value. The XML field name for Regime is ‘ClaveRegimenEspecialOTrascendencia’. Now to update this field the below parameters should be passed:
Please find below a sample code to update the Regime field:
2. Next, we will populate the mandatory fields 'SituaciónInmueble' and 'ReferenciaCatastral' of table DatosInmueble. This will be updated in 2 steps as follows:
i. First, create a table with type ValueStructforSIIbadi.NestedFldValues and populate the desired values for the fields SituaciónInmueble and ReferenciaCatastral.
Value derived from custom logic
To populate multiple records in the table, increment the record number and pass the FieldName and Value.
ii. Then pass the above created table to DatosInmueble field.
Table filled in step 2.i.
Please find below a sample code to update the DatosInmueble table:
Similarly, we can pass custom value to other legally allowed fields of the SII XML as per the mapping provided below:
Outgoing scenario :
Incoming scenario :
Part 2 :
Let us take another example to cover Adjustment Document “AJ” scenario for travel agencies. The scenario here is, for special VAT schema for travel agencies, at the end of the travel or event an adjustment of the profit margin must be done. For this adjustment, the travel agency should create a new invoice type called “AJ” which should be an adjustment to the tax amount and report it to the tax authority. We will use ‘ModifyXMLData’ BAdI to achieve this scenario.
The prerequisite is to create a manual tax entry transaction which will be sent as an ‘AJ’ document along with other details using PDI BAdI. An identification (Document Description) in the manual tax entry also has to be added in order to classify it as document type “AJ”.
Below are the fields along with the technical details which need to be modified to report to the tax agencies the adjustment scenario:
We have now learnt how to modify legally allowed fields in the SII XML before submitting to the tax authority. Customers would not only be able to add custom logic to fill fields 'ReferenciaCatastral' and 'SituaciónInmueble' in the SII XML, but also in general, be able to change other legally allowed fields in the XML file.