Skip to Content
Technical Articles
Author's profile photo Alexandre Moura

SAP S/4HANA for statutory reporting: Como preencher tabelas shadow/complementares utilizando a API CTR Complementary Table Data Maintenance

(Scroll down for the English version, which is proudly presented by the SAP Translation Portal)

Olá pessoal, 

Neste post vamos explicar como você pode preencher as tabelas shadow/complementares do Central Tax Repository (CTR) no SAP S/4HANA para geração dos relatórios através do statutory reporting utilizando a API CTR Complementary Data Maintenance. 

O CTR, como o próprio nome diz, é um repositório central de dados fiscais para geração dos seguintes relatórios do Brasil: 

  • ECD
  • ECF
  • EFD 
  • EFD-Contibuições 
  • EFD-Reinf 

Devido à natureza dos dados necessários para geração desses relatórios, nem toda a informação pode estar disponível no SAP S/4HANA. Para que os relatórios sejam gerados com todas os dados necessários, muitas vezes é preciso que dados de outras fontes sejam utilizados. 

Portanto, o CTR possui diversas tabelas que podem ser populadas com dados provenientes de outras fontes para complementar as informações referentes aos registros que devem ser gerados de acordo com cada leiaute e com as necessidades de cada cliente.  O preenchimento dessas tabelas complementares agora é possível através da API CTR Complementary Table Data Maintenance.  

Essa API foi construída utilizando ABAP RESTful Application Programming Model (RAP) e utiliza o protocolo OData V4, devido ao uso das mais novas tecnologias disponíveis. A API está disponível no SAP S/4HANA Cloud (versão 2111) e a partir da versão do SAP S/4HANA 2021 (lançado em outubro 2021). 

Com esta API, é possível manipular os dados de 300+ tabelas complementares do CTR de uma maneira simples e intuitiva, onde o nome de cada entidade representa uma tabela complementar. Veja um exemplo a seguir: 

Podemos considerar a tabela complementar “NF Item”. O nome dessa tabela no banco de dados é /tmf/nf_item e a entidade que representa essa tabela é a /nf_item. Conforme a imagem abaixo, é possível realizar diversas operações na tabela complementar: 

  • GET – Get entities from nf_item – retorna todos os dados da tabela /tmf/nf_item sem utilização de filtro de seleção. 
  • POST – Add new entry to nf_item – salva dados na tabela /tmf/nf_item. 
  • GET – Get entity from nf_item by key – retorna dados da tabela /tmf/nf_item a partir da utilização de campos chave como filtro. 
  • PATCH – Update entity in nf_item – atualiza um registro previamente existente na tabela /tmf/nf_item. 
  • DELETE – Delete entity from nf_item – realiza a deleção de um registro previamente existente da tabela /tmf/nf_item. 

As mesmas operações podem ser realizadas para todas as outras entidades disponíveis na API seguindo os mesmos procedimentos. 

Para conhecer mais detalhes e até mesmo testar a utilização da API, basta acessar a o SAP API Business Hub pelos links abaixo: 

Gostaríamos muito de receber o seu feedback. Deixe seu comentário abaixo caso tenha alguma dúvida ou sugestão para um próximo post. Além dos comentários, você pode entrar em contato conosco através da plataforma Customer Influence. Lá você pode propor ideias para melhorar nosso produto, votar em outras ideias já lançadas e acompanhar ideias em implementação. Também não esqueça de seguir a tag Advanced Compliance Reporting (antigo nome da feature de statutory reporting) aqui na SAP Community para ficar ligado nas últimas notícias sobre o SAP S/4HANA for statutory reporting. 

Até a próxima! 

Alexandre Moura 

Time de desenvolvimento do statutory reporting. 

#SAPGoGlobal #SAPLocalization #ACR 

SAP S/4HANA for statutory reporting: How to populate shadow/complementary tables using the API CTR Complementary Table Data Maintenance 

Hey guys, 

In this post, we will explain how you can fill the shadow/complementary tables of the Central Tax Repository (CTR) in SAP S/4HANA to generate reports through statutory reporting using the API CTR Complementary Data Maintenance. 

CTR, as the name implies, is a central repository of fiscal data for the generation of the following reports in Brazil: 

  • ECD
  • ECF
  • EFD
  • EFD-Contribuições
  • EFD-Reinf

Due to the nature of the data required to generate these reports, not all information may be available in SAP S/4HANA. For the reports to be generated with all the necessary data, it’s often necessary to use data from other sources. 

Therefore, the CTR has several tables that can be populated with data from other sources to complement the information regarding the records that must be generated according to each layout and the needs of each client. The filling of these complementary tables is now possible through the CTR Complementary Table Data Maintenance API. 


 This API was built using ABAP RESTful Application Programming Model (RAP) and uses the protocol OData V4 in order to utilize the newest technologies available. The API is available in SAP S/4HANA Cloud (version 2111) and SAP S/4HANA version 2021 (released in October 2021). 

With this API, it’s possible to manipulate the data of 300+ CTR complementary tables in a simple and intuitive way, where the name of each entity represents a supplementary table. See an example below: 

We can consider the complementary table “NF Item”. The name of this table in the database is /tmf/nf_item and the entity representing this table is /nf_item. As shown in the image below, it’s possible to perform several operations on the complementary table: 

  • GET – Get entities from nf_item – returns all data from /tmf/nf_item table without using a selection filter.
  • POST – Add new entry to nf_item – saves data in table /tmf/nf_item.
  • GET – Get entity from nf_item by key – returns data from the /tmf/nf_item table using key fields as filters.
  • PATCH – Update entity in nf_item – updates a previously existing record in the /tmf/nf_item table.
  • DELETE – Delete entity from nf_item – deletes a previously existing record from the /tmf/nf_item table.

The same operations can be performed for all other entities available in the API following the same procedures. 

To find out more details and test the API, access the SAP API Business Hub through the links below: 

We would love to receive your feedback. Leave your comment below if you have any questions or suggestions for a next post. In addition to comments, you can contact us through the Customer Influence platform. There you can propose ideas for our product, vote on other ideas that have already been published, and improve ideas that are being implemented. Also, don’t forget to follow the Advanced Compliance Reporting tag here in the SAP Community to stay tuned for the latest SAP S/4HANA news for statutory reporting.  

See you soon!  

Alexandre Moura 

Statutory reporting development team.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.