Skip to Content
Technical Articles
Author's profile photo Prashant Kumar Singh

Generate Custom Supplier Certificates via Generic Withholding Tax in SAP Document and Reporting Compliance(formerly known as Advanced Compliance Reporting – ACR)

Generic withholding tax reporting helps you configure based on your country/region-specific or company-specific requirements.

The report identifies withholding tax-relevant transactions for the reporting period and generates an ALV output that lists these transactions and groups them based on organizational unit, business partner, tax type, and tax code.

This report can be used to report only extended withholding tax documents or line items. However, withholding tax certificate cannot be generated with the standard solution.

In this blog post, I will cover a simple way to extend the generic withholding tax report (GENC_WHT) and add new correspondence section to generate withholding tax certificate.

  1. Go to Tcode SEGW and create SAP Gateway Service. For this example, we will refer Mexico Gateway Service. Gateway service FDP_FIWTMX_CERT (which is available from SAP S/4HANA 1809 OP Onwards).Gateway%20Service   Figure 1: Mexico Gateway Service
  2. Expand the SAP Gateway Service and go through the Data Model, Associations, Entity Sets and Association Sets. In Entity Type – Query Node will be used for passing filter from DRC(Formerly known as ACR ). In case of Mexico we will generate the certificate for every Unique Supplier, company code , language and Withholding tax Income TypeReferring%20to%20Mexico%20Gateway%20Service Figure 2: Query Node – to be exposed in Document and Reporting Compliance
  3. Navigate to Runtime Artifacts and Use class CL_FDP_FIWTMX_CERT_DPC_EXT to populate data in  the certificateMX%20Runtime%20ArtifactsFigure 3: SAP Gateway Artifacts
  4. Implement the method MXWHTHEADERSET_GET_ENTITY to populate data in the certificateImplement%20Header%20Get%20EntityFigure 4: Sample Data provider Implementation
  5. Note the Service name and maintain it in the Adobe Form.Service%20to%20be%20consumed%20in%20Adobe%20FormsFigure 5: SAP Gateway Service – to be consumed in Adobe Forms
  6. Go to Tcode SFP, enter the form name as FIWTMX_CERT to refer already developed Mexico Certificate.Mexico%20Withholding%20Tax%20CertificateFigure 6: Form Builder
  7. The Form should be of type XFA2, maintain the SAP Gateway Service Name FDP_FIWTMX_CERT_SRV.Layout%20Technology%20XFA2Figure 7: Mexico Adobe Form for reference
  8. Go to Utilities and download the form layout. The layout should be downloaded with XDP extensions.Figure 8: Download Form layout
  9. Extend the generic withholding tax reporting (GENC_WHT_V0)  Extend%20Generic%20Withholding%20TaxFigure 9: Extend Generic Withholding Tax Reporting
  10. Create a New document in the correspondence section in your report definition and provide the following details.
    1. Correspondence ID – ZCORSP
    2. Form Template – FIWTMX_CERT
    4. Correspondence Name – Mexico Supplier Certificate
    5. Output Type – ACCT_WHT(Specifically created for Withholding tax certificate)Correspondence%20Section%20DetailsFigure 10: Correspondence Section
  11. Click on the correspondence line and map the query columns. This unique combination will decide on number of output forms in the correspondence section.Figure 11: Map Query columns to be passed to SAP Gateway Service
  12. Download XSD as shown below(The report should be open in Edit Mode)Download%20Schema%20for%20MappingFigure 12: Download Schema
  13. After downloading the XSD, open Adobe LiveCycle Designer. Open the earlier downloaded layout for Form and perform mappingAdobe%20LiveCycle%20DesignerFigure 13: Adobe Form Layout in Adobe LiveCycle Designer
  14. Right click on the data connection and add New data connection, choose XML schema and upload the XSD(which was downloaded from Extended Report Definition).Figure 14: Import SchemaFigure 15: Map fields from the Imported Schema
  15. Perform the mapping and upload the layout in Tcode SFP and activate the Form.Figure 16: Upload the Form and Activate
  16. Go to SPRO and navigate to path below, click on New Entry and maintain the custom form details: Cross-Application Components > Output Control > Assign Form TemplatesFigure 17: Maintain Custom Form Details
  17. Extend generic reporting category and maintain the extended report definition in the activity section.Extend%20Report%20CategoryFigure 18: Extended Generic Withholding Tax Report Category
  18. Go to Run Compliance section and enter the report nameFigure 19: Run Compliance Report
  19. Choose the extended reporting activity and execute the reportFigure 20: Execute the Extended Activity
  20. You can view the correspondence form in the business partner Reporting SectionFigure 21: Partner Correspondence
  21. Once you click on the display Icon , it will trigger the class CL_FDP_FIWTMX_CERT_DPC_EXT and the form will be populatedFigure 22: Generated Partner Certificate


       Figure 23: Summary

Thank you for reading!

Drop a like or comment below if you found the above steps useful and do let me know in the comments section if you are looking for any other specific use case of US report extensibility.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Renan Correa
      Renan Correa


      Very Interesting post explaining this solution. I understand you are using the OData services as data provider to fetch data from backend system to generate the PDF.

      Would it be possible, with the DRC framework, to trigger the creation of PDF form based on ABAP data structures called from class/methods without using the gateway service?


      Renan Correa

      Author's profile photo Prashant Kumar Singh
      Prashant Kumar Singh
      Blog Post Author

      Hi Renan,

      Yes, it is possible to generate PDF under legal section in DRC framework using CDS/Class Method as query sources. The schema can be generated using the DDIC Structure/JSON/XSD (like the legal file). This schema can be downloaded from DRC and then you can follow Step 13-15. Step 16 is not required for Legal Section.

      However, if you need the Certificate in correspondence section, ODATA is the only option.


      Prashant Singh

      Author's profile photo Renan Correa
      Renan Correa


      Thanks for the quick answer. I see your pojnt, by not using the correspondence/oData I'd simply create a generic file output, so my user would need to download the PDF as a file and send to the corresponding partner manually.

      Great Content!


      Renan Correa

      Author's profile photo Kartik Mehrotra
      Kartik Mehrotra

      Very Informative ! Thanks for sharing.

      Author's profile photo Ruban Chakravarthy SS
      Ruban Chakravarthy SS

      Nicely Documented. Keep posting.!