Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
jaishreeseth
Advisor
Advisor
This blog post is a part of the multi part series of blog posts on the Define compliance Reports application in which we cover the end to end process of creating a report using SAP Document and Reporting Compliance – Statutory Reporting (Formerly ACR).

In this blog post, we’ll talk about creating a schema – the structural information of the report output. In DRC - Statutory Reporting, schemas can be created based on a technical object or also from a query defined in the report itself. The various technical object formats which are supported for schema creation include XSD, JSON, XBRL. Additionally, users can also create schemas using DDIC structures or CDS views or DRC - Statutory Reporting queries. 

Here we talk about how to create a schema using ABAP dictionary structure and using an DRC - Statutory Reporting query. 

Schema created using DDIC structure 

The example schema has the following structure: 

Report Header:

  • Company Name 

  • Country Key 

  • Total Input Tax 

  • Tax Amount in Local Currency 

  • Total Output Tax 

  • Total Tax Payable 

  • Reporting Currency 


Item Level (Output tax): 

  • Company Code 

  • Transaction Key 

  • Tax on Sales/Purchases Code 

  • Percentage share of return delivery 

  • Tax Reporting Country/Region 

  • Tax Base Amount in Local Currency 

  • Tax Amount in Local Currency 

  • Total Amount in Local Currency 

  • Currency Key 


Item Level (Input tax): 

  • Company Code 

  • Transaction Key 

  • Tax on Sales/Purchases Code 

  • Percentage share of return delivery 

  • Tax Reporting Country/Region 

  • Tax Base Amount in Local Currency 

  • Tax Amount in Local Currency 

  • Total Amount in Local Currency 

  • Currency Key 


To create a schema using DDIC structure, first create database structure with the required fields. 

Here is the structure which will be used in this example: 




ZDEMO_TT_VAT_OUTTAX is a table type of structure shown below: 

 


ZDEMO_TT_VAT_INTAX is a table type of structure shown below: 

 


Now to create schema in report definition. 

In the Report Definition, Document section, specify a schema ID and click on Create. 

 


In the popup, choose ABAP Dictionary and choose the structure (like the one created above) 


 


Now, click on verify to check if the schema has any errors. If there are no errors, click on Activate. 


And the schema is created. 

To see the details of schema created, navigate to Mapping section. 

Here the details are available and the corresponding data sources can also be mapped. 

The DDIC structure name is available as 1st element, followed by header details. 


Then the item level information (output tax and input tax) is available. For item level information, since multiple nodes are possible, there is an option to assign loop query.  


 


 

Schema created using query 

To create a schema using query, first a query needs to be created. For this go to query section in report definition and create a query [more details about how to create query in blog post here]. In this example, we assume that output tax needs to be submitted to government.  

Example query: 

 


Now, this query will be used to create a schema. In the Report Definition, Document section, select the radio button for “Query”. 


In the pop-up, select the query from which the schema must be created. 


Now click on “Select Columns” to select the fields that will be used to create schema. 

 


Next popup displays all the available columns from the CDS view used for creating query.  



The required columns can be selected. It is also possible to order the selected columns based on the requirements. 

In the mapping section, the schema elements can be seen along with mapping. 


 
With this blog post, you have learned how to create a schema using DDIC structure and DRC - Statutory Reporting query.


If you have any questions/queries, you can post them here.

 

 
1 Comment