Skip to Content
Technical Articles
Author's profile photo Mohd Danish Imam

Extensibility in SAP Document and Reporting Compliance – Statutory Reporting (Formerly ACR)

Extensibility is the single most powerful attribute of any enterprise application, and SAP S/4HANA Document and reporting compliance – statutory reporting (formerly Advanced compliance reporting – ACR) application is no exception. In this blog I will cover a simple yet powerful way on how standard DRC reports can be extended with attributes from different data sources.

Let’s get started, in this blog we will extend parts of generic VAT report definition (ADV_VAT_RET). For more information on Generic VAT DRC report refer to the link.

Problem Statement

The company code has branches in several countries, and business store their relevant input tax information in a table in Z namespace in group currency. Whereas in standard generic VAT DRC report TaxAmountInRptgCrcy is mapped in the output. The task is to extend the standard report definition and map the input tax with relevant attribute of the table in which the business store their data. The question arises how do you achieve this requirement with minimal effort? Let’s find out.

The first step would be to identify the data source that is currently mapped in the report definition (ADV_VAT_RET).

Extension%20flow%20diagram

Extension flow diagram

 

All the screenshots have been taken from SAP S/4HANA 2020 OP release.

 

Part 1 – Extending standard DRC report definition.

Step1: Open Define Compliance Reports application.

Define%20Compliance%20Report%20Tile

Define Compliance Report Tile

Step 2:  Click on Add button to extend the generic VAT report (ADV_VAT_RET).

Add%20new%20report%20definition

Add new report definition

Step 3:  Give the Reference report definition as “ADV_VAT_RET”. Let’s call our new report definition as “ZADV_VAT_RET_EXT”. Click continue.

Extend%20existing%20report%20definition

Extend existing report definition

This will extend the report definition and all the functionalities of the standard report definition would be “inherited” refer column inherited status.

Inherited

Inherited

Step 4: Note the Data Source Name and corresponding Query ID. The Query ID is used in the Document definition for the mapping.

Query%20ID%20and%20Data%20Source%20Name

Query ID and Data Source Name

Step 5:  TAX_SUMMARY_INPUT_TAX query id has ISRTAXRETURNC (I_StRpTaxReturnCube) as a data source. As a next step open document definition and navigate to the mapping section.

Data source ISRTAXRETURNC (I_StRpTaxReturnCube) is not released under C1 stability contract hence there can be changes in the interface of the CDS view.

Document%20definition

Document definition

Document%20definition%20mapping

Document definition mapping

Step 6: As per the business requirement the business do not need TaxAmountInRptgCrcy in the output instead the business wants Amount in group currency from their custom table mapped in the report output.

Let’s call the table ZGRP_RPTG and the attribute that holds the relevant information IPTAXAMTINGRPCRCY.

“The data source ISRTAXRETURNC (I_StRpTaxReturnCube) identified in step 6 do not have Amount in Group Reporting Currency (IPTAXAMTINGRPCRCY) from ZGRP_RPTG. Part 2 shows how the data source ISRTAXRETURNC (I_StRpTaxReturnCube) can be extended with attribute IPTAXAMTINGRPCRCY from ZGRP_RPTG”.

 

Part 2 – Extending standard CDS data source mapped in standard DRC report output.

Step 1: Fire up the IDE where you have ADT installed, and create the data definition ZI_AMTINGRPCRCY (you can give it any name you like). Give a description and press Next.

CDS creation

Step 2: Select Extend View and click Finish. This will generate a boiler plate code.

Extend CDS view

Step 3: Replace sql_view_append_name with ZAMTGRPCRCY(again you can give a name of your choice) and replace view_name with I_StRpTaxReturnCube.

 

Step 4: Define an association with ZGRP_RPTG as shown below and expose the attribute IPTAXAMTINGRPCRCY  from data source ZGRP_RPTG with an alias of  TaxAmtInGroupCurrency.

CDS extension code

@AbapCatalog.sqlViewAppendName: 'ZAMTGRPCRCY'
@EndUserText.label: 'Amount in group currency'
extend view I_StRpTaxReturnCube with ZI_AMTINGRPCRCY 
association [0..1] to zgrp_rptg   as ZGRP_RPTG      on  $projection.companycode = ZGRP_RPTG.bukrs
                                                    and $projection.fiscalyear = ZGRP_RPTG.gjahr  
                                                    and $projection.accountingdocument = ZGRP_RPTG.belnr
                                                    and $projection.taxitem = ZGRP_RPTG.buzei
{
    zgrp_rptg.iptaxamtingrpcrcy as TaxAmtInGroupCurrency

}

 

The data source(I_StRpTaxReturnCube) mapped in the document definition(Part 1 – Step 6) is extended with IPTAXAMTINGRPCRCY  from data source ZGRP_RPTG. Now we can use the exposed attribute for mapping in document definition. So, let’s head back to where we left off in part1.

The exposed attribute would also be available in the corresponding analytical query which consumes the cube view

Note: The performance of the CDS view would have to be taken into consideration. Once the attribute is materialized the corresponding association would be executed as a left outer join.

Part 3 – Mapping the extended data source in DRC output.

Step 1: Go to edit mode and Click on the F4 help against the attribute that you want to remap with. Once the popup appears scroll to the query id TAX_SUMMARY_INPUT_TAX  and give the attribute exposed in the extended view in search bar and select the attribute.

Select query

Step 2: You can change the label and once it’s done save and activate the changes.

Save%20and%20activate

Save and activate

Step 3: Let’s test the changes. If everything goes fine the report would be generated successfully, and our changes would reflect in the report output.

Output

Output

In Summary:

Summary

Summary

That’s how simple extensibility is in SAP Document and Reporting Compliance. If the blog added something to your knowledge and helped you in your SAP Document and Reporting Compliance journey let me and the community know in the comment section and drop a like. It would be very interesting to see different scenarios where you made use of extensibility. If you have questions related to following topics please refer to the link Advance compliance reporting.

Happy learning and Thank you for reading!

A big thank you to Kumar Abhishek for sharing his inputs.

 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Erika Buson
      Erika Buson

      Nice blog!

      Author's profile photo Mohd Danish Imam
      Mohd Danish Imam
      Blog Post Author

      Thank you!, Erika.

      Author's profile photo Kazim Rizvi
      Kazim Rizvi

      Hi Danish,

      Appreciate your initiative to come up with a post on one of the topics where we don't have much write ups available. Although SAP DRC is a new learning area for me but I can better relate your post because I do understand the functionality of new Extensibility framework
      with S/4HANA being introduced with In-App and Side-by-Side extensions for the custom code management.

      Author's profile photo Jaymin Thakkar
      Jaymin Thakkar

      Hi Danish,

      Nice Blog!

      I tried the follow the steps mentioned by you to extend the ACR report for Taiwan, but I am not able to view the extended column in the report? I am able to see the extended column at CDS view level but not in report definition. Do I have to perform any steps to make it visible in Define Compliance Report?

      Author's profile photo Matthias Flury
      Matthias Flury

      Hi Danish

       

      The generated documents are stored in DMS_C1_ST ContenCategoriy. This category uses the repository DMS_C1 which goes to database tables. In a SAP HANA System this is a no go. Also the repository DMS_C1 is communicated as a demo repository, not to be used for productiv documents. So the question is where can You customize the Content Category where the generated documents are stored.

      Thanks for the hint

      Matthias

       

      Author's profile photo Sriram Rekapalli
      Sriram Rekapalli

      Nice one Mohd Danish Imam . This is very helpful from an extensibility perspective in the context of extending available standard reporting in DRC. Also looking forward to see if there is any similar content on 'custom report' scenario within the extensibility framework of DRC