Product Information
Custom Tax File Generation in SAP Business ByDesign
Keeping pace with the ever-changing regulatory environment is a challenge; tax return file is a good use case of such legal format changes in many countries. Keeping them updated as per latest regulations from standard delivery is a challenge.
In this blog, we will explain the new feature of possibility to generate custom tax return files in SAP Business ByDesign. This would enable the partners to adapt tax return files to relevant format according to specific country regulations. This feature has been made available to be consumed even for pre-localized and non-localized country tax return(by using the generic tax return).
Partners/Customers would now have 2 approaches to amend a given tax return file format and content.
Approach 1: Edit values in SAP generated tax return files
To do this, the partners would need to implement the enhancement option
PDI AE Multiple Usage Tax File Generation BAdI for VAT return files (OR)
PDI AE Multiple Usage Withholding Tax File Generation BAdI for withholding tax return files(Available with release 2108)
in the SAP Cloud Applications Studio with relevant filter conditions. The implementation can be done for a combination of tax country and tax return type. Please refer example snapshot below.
Enhancement Implementation Filter
In the implementation, partners would have the option to edit SAP generated file content. We would recommend partner to edit this content judiciously. Please refer example implementation in below snapshot.
Sample Implementation
Approach 2: Generate a new custom tax return file
Please note that knowledge of XSL Transformation would be a pre-requisite to generate these valid custom tax return files.
The brief steps to be followed for the partners/customers to achieve this would be as below
Step 1: Check Electronic Submission Indicator in relevant tax return arrangement.
Electronic Submission indicator is used to determine if an electronic file should be generated when releasing a tax return. If the indicator is unchecked, no file is created.
To do so, follow the path Tax Management Company Tax Arrangements. Search for required company. Click Edit. Under Tax Return Arrangements, check the Electronic Submission checkbox.
If the electronic submission indicator is unchecked and non-editable, you need to first maintain a dummy XSL transformation.
Step 2: Create XSL Transformation
In case the partner wants to see the exact content of the SAP generated tax return file, then they can refer the input parameter to the enhancement option PDI AE Multiple Usage Tax File Generation BAdI for VAT or PDI AE Multiple Usage Withholding Tax File Generation BAdI for withholding tax.
However, if the partner just wants the input structure format, then they could refer the datatype ‘ProductTaxDeclaration’ for VAT return and ‘WithholdingTaxDeclaration’ for Withholding tax return in Repository Explorer of SAP Cloud Applications Studio.
Step 3: Maintain XSL Transformation in XSLT Repository
Once the XSL transformation is created, you need to maintain it in the XSL transformation repository. You can maintain the configuration in the Common Master Data Configuration using configuration type code Transformation Repository. This feature allows you to store a single or multiple customer-specific XSLT files in the repository from which dedicated transformations can be created as per your business requirements.
Ensure to maintain the Transformation Type as TXRT – XSL Transformation Tax Return while adding XSL transformation.
For steps on how to add an XSL transformation, please see XSL Transformation.
The steps to generate tax returns itself remain unchanged. However kindly note that for a given tax return, the custom XSL transformation file(if maintained properly) takes precedence over the standard file delivered by SAP.
Since this feature enables customization of tax return file content, if this is consumed, then SAP does not validate the modified content, the customer/partner would need to modify/validate the content themselves judiciously.
Please free to provide your queries and feedback here. Happy to help!
Hi,
Thanks for this blog! We have a question about step 2 Create XSL Transformation.
Is there any exemple file we can look at? So we can understand how we should start build this XLS file.
/Olivia Johansson
Hi Olivia,
Regarding your question about step 2 (Create XSL Transformation), please check the link below for steps on how to add an XSL transformation:
https://help.sap.com/viewer/0635ec3491974ad988be05d6b1dcf734/2111/en-US/82421168ccf24e9d8d7101079e3f174c.html
Best Regards,
Ihan
Hi,
We have checked this, but it´s not helping us. Because we dont know how the file should be created and how we should build it.
We have tried create a XSL file, but ByD dont accept the file.
Do you have any example file that we can look at?
/Olivia
Hi Olivia,
As mentioned in the blog, knowledge of XSL Transformation would be a pre-requisite to generate your custom tax return file. I would suggest you to get this knowledge from online resources. For example, https://www.w3schools.com/xml/xsl_transformation.asp. There are other online resources too to learn.
In brief, the flow would be as below
Input XML Structure => Uses XSL Transformation Data => To transform into target file
Hence, for deriving at the XSL transformation file structure, it is required to know both, 'Input format'(mentioned below) and 'Output format'(Depends on country's desired tax file format).
The schema of the input XML structure for this use case can be found by referring to the datatype ‘ProductTaxDeclaration’ for VAT return and ‘WithholdingTaxDeclaration’ for Withholding tax return in Repository Explorer of SAP Cloud Applications Studio.
For your reference, attaching a XSL file created by my colleague for a part of Spain 303 tax return file.
Best Regards,
Krishna
Hi and thank you for the information!
I understand that I can get the structure of the output file from the datatype ‘ProductTaxDeclaration’ for VAT return and ‘WithholdingTaxDeclaration’ for Withholding tax return in Repository Explorer of SAP Cloud Applications Studio.
I'm using a mapping program and i need a file for mapping all the needed fields.
2. Is there an output xml sample with all fields for ProductTaxDeclaration?
Without that, manually doing the XSLT is very time consuming.
Thank You!
Kind regards,
Siim
Hi and thank you for the information!
I understand that I can get the structure of the output file from the datatype ‘ProductTaxDeclaration’ for VAT return and ‘WithholdingTaxDeclaration’ for Withholding tax return in Repository Explorer of SAP Cloud Applications Studio.
I'm using a mapping program and i need a file for mapping all the needed fields.
2. Is there an output xml sample with all fields for ProductTaxDeclaration?
Without that, manually doing the XSLT is very time consuming.
Thank You!
Kind regards,
Siim
Hi Krishna Ramadesikan,
Do you know how I can download the input XML data and The schema of the input XML structure?
Regards,
Tri
Hi Tri,
The schema of the input XML structure can be found in Repository explorer of SAP Cloud Applications Studio. You can refer the datatype ‘ProductTaxDeclaration’ for VAT return and ‘WithholdingTaxDeclaration’ for Withholding tax return.
Sample XML of a Product Tax Declaration can be read by implementing the enhancement implementation(described in approach 1) and debugging the same during generation of a tax return file for that scenario. Since this XML structure is nested, it is recommended to look for specific fields(based on schema) during debugging.
Best Regards,
Krishna