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: 
(Scroll down for the English version, which is proudly presented by the SAP Translation Portal)


É muito comum precisar entender detalhadamente como foi feito o cálculo dos impostos reportados nos relatórios SPED. Para isso, é necessário analisar o resultado da saída das HANA calculation views.

No Tax Declaration Framework Add-on, era possível verificar a saída gerada pelas HANA calculation views escrevendo um comando SQL ou navegando até o pacote sap.glo.tmflocbr para usar a funcionalidade “Data Preview” do HANA Studio.

Essa forma de ver a saída de uma HANA calculation view mudou no Advanced Compliance Reporting – Brazil Option, já que ele utiliza a SAP HANA Deployment Infrastructure (HDI). Mais informações neste blog post.

Utilizar HDI significa que as HANA calculation views NÃO estão mais no repositório HANA (Conforme a nota 2943905 - [OBSOLETE] [S/4HANA ACR BR Option] Deletion of HTA Views), mas em um HDI container chamado SAPTMF_RT.


Repositório Obsoleto


Então, como acessar as HANA calculation views dentro do HDI Container SAPTMF_RT?

Existem 3 formas de ver o resultado (Data Preview) de uma HANA calculation view do HDI.

1. A forma mais rápida e acessível é pela transação SCTS_HDI_DEPLOY.



  • Pré-requisitos

    • Funcionalidade disponível a partir das versões abaixo:

      • ABAP Platform 1909 (aka 7.54) SP02

      • ABAP Platform 1809 (aka 7.53) SP05

      • AS ABAP 7.52 SP07





  • Seu usuário precisa ter as seguintes permissões (mais informações neste link😞




  • Basta acessar a transação SCTS_HDI_DEPLOY e informar:

    • Logical HDI Container: SAPTMF_RT

    • HDI Namespace: sap.glo.tmflocbr







  • Selecione uma view do CTR que não tenha placeholders (filtros) para o seu primeiro teste, como, por exemplo, a NF_DOCUMENTO_ITEM_IMPOSTO

  • Depois, acesse no menu superior HDI Object -> Calculation View -> Create View For Node....





  • Abrirá um pop-up com os nodos disponíveis na view. Escolha o nodo em que você quer executar o select. Se você quer a saída final da view, selecione o finalNode.




  • No pop-up aberto, clique em Copiar SQL

  • Clique em Abrir DB02





  • Clique no SQL Editor.

  • Cole sua consulta SQL no editor. Para banco de dados grandes, lembre-se de adicionar filtros na sua consulta. Click em execute.





  • Pontos importantes que precisam ser observados no SQL gerado:

    • Preste atenção no nome físico do container SAPTMF_RT_XXXX. SAPTMF_RT é o nome lógico e SAPTMF_RT_9000 é o nome físico. Todos os SQL executados devem ser feitos usando o nome físico do container. Esse número de quatro dígitos é diferente em cada sistema. Assim, ao descobrir o nome físico do seu container, você pode acessar direto a transação DB02 e executar o SQL para ver a saída da HANA calculation view. Perceba que SAPTMF_RT_9000 é um schema, mas é chamado de HDI container por ter essa questão de isolamento e independência, que trazem segurança e velocidade de ativação dos objetos.

    • Esse processo de criar uma view de debug para o nodo é o que o Data Preview do HANA Studio faz por baixo dos panos. Ele cria uma nova view, cujo final é o nodo que você escolheu.

    • No momento, o SQL gerado não contempla os filtros de placeholder. Desse modo, quando você escolher uma view que tenha placeholders, lembre-se de incluir os placeholders no SQL.

    • Depois de terminar as suas análises (Data Preview), clique no menu superior HDI Object->Calculation View->Drop View of Nodes para apagar todas as views de debug temporárias.




2. A forma que traz a melhor experiência na visualização e execução das views é configurar o WEBIDE for HANA no seu ambiente.




  • O Check-out vai copiar as HANA calculation views do ABAP para o workspace configurado no WebIDE For HANA

  • No WebIDE For HANA, é possível visualizar e executar o data preview nas HANA calculation views.


3. A terceira forma é usando o HANA Studio, lembrando que ele está obsoleto. Para executar o Data Preview em nodos das HANA calculation views, você precisa criar a view de debug para o nodo desejado anteriormente, conforme o apresentado no item 1.



  • Conforme dito antes, o container do HDI tem dois nomes, o nome lógico e o nome físico. O nome lógico é fixo, “SAPTMF_RT”, enquanto o nome físico tem uma parte numérica aleatória, como mostra a figura baixo.





  • Para descobrir o nome do container físico, acesse a transação SCTS_AMHC e digite o nome lógico SAPTMF_RT

  • Depois, é necessário dar permissão de leitura para o seu usuário do HANA acessar o container físico SAPTMF_RT_XXXX.

  • Após ter o acesso, é possível ver o container e as views no catalog.





  • Exemplo de SQL

    • SELECT TOP 10 FROM "SAPTMF_RT_9000"."sap.glo.tmflocbr.ctr::AJUSTE_APURACAO_IPI";




Neste blog post, vimos três diferentes formas de como executar data previews nas HANA calculation views do ACR Brazil Option.

Gostaríamos muito de saber 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 aqui na SAP Community para ficar ligado nas últimas notícias sobre o S/4HANA ACR Brazil Option.

 

Até a próxima!

Jovani Alves

Time de desenvolvimento do ACR

#SAPGoGlobal #SAPLocalization #ACR

 

 

SAP S/4HANA for Advanced Compliance Reporting, Brazil Option:


How to See the Result of a HANA Calculation View



It is very common to have a detailed understanding of how the taxes reported in the SPED reports were calculated. To do this, it is necessary to analyze the result of the output of the HANA calculation views.

In the Tax Declaration Framework Add-on, it was possible to check the output generated by HANA calculation views by writing an SQL command or navigating to the sap.glo.tmflocbr package to use the “Data Preview” functionality of HANA Studio.

This way of seeing the output of a HANA calculation view has changed in Advanced Compliance Reporting – Brazil Option as it uses the SAP HANA Deployment Infrastructure (HDI). More information in this blog post.

Using HDI means that HANA calculation views are NOT in the HANA repository anymore (as per note 2943905 - [OBSOLETE] [S/4HANA ACR BR Option] Deletion of HTA Views), but in an HDI container called SAPTMF_RT.


Obsolete repository


Thus, how can we access HANA calculation views within the SAPTMF_RT HDI Container?

There are 3 forms of seeing the result (Data Preview) of an HDI HANA calculation view.

1. The quickest and most accessible way is through transaction SCTS_HDI_DEPLOY.



  • Pre-requisites

    • Available functionality after the following versions:

      • ABAP Platform 1909 (aka 7.54) SP02

      • ABAP Platform 1809 (aka 7.53) SP05

      • AS ABAP 7.52 SP07



    • Your user needs to have the following permissions (more information in this link😞






  • You only need to access SCTS_HDI_DEPLOY and inform:

    • Logical HDI Container: SAPTMF_RT

    • HDI Namespace: sap.glo.tmflocbr






  • Select a view from CTR with no placeholders (filters) for your first test, such as, for instance, NF_DOCUMENTO_ITEM_IMPOSTO.

  • Then, access HDI Object -> Calculation View -> Create View For Node.... on the menu on top.




  • A pop-up will open with all the available nodes on the Choose the node where you want to execute the select. If you want the final output of the view, choose the finalNode.

  • In the open pop-up, click on Copy SQL

  • Click on Open DB02




  • Click on the SQL Editor

  • Paste your SQL query on the editor. For bigger databases, remember to add filters to your query. Click on execute.




  • Important points to be taken into consideration on the generated SQL:

    • Pay attention to the physical name of the container SAPTMF_RT_XXXX. SAPTMF_RT is its logical name, whereas SAPTMF_RT_9000 is its physical name. All executed SQL must be done using the physical container name. This four-digit number is different in each system. Thus, by discovering the physical name of your container, you can directly access transaction DB02 and execute the SQL to see the output of the HANA calculation view. Note that SAPTMF_RT_9000 is a schema but is called the HDI container, since it has this issue of isolation and independence, which brings security and speed on objects activation.

    • This process of creating a debug view for the node is what HANA Studio Data Preview does under the hood. It creates a new view, whose end is the node you chose.

    • At the moment, the generated SQL does not contemplate the placeholder filters. As such, when you choose a view with placeholders, do not forget to include the placeholders on the SQL.

    • After finishing your analyses (Data Preview), click on HDI Object -> Calculation View -> Drop View of Nodes on the top menu to erase all the temporary debug views.




2. The best way to view and run views is to configure WEBIDE for HANA in your environment.





  • Check-out will copy the HANAcalculation views from ABAP to the configured workspace on WebIDE For HANA

  • On WebIDE For HANA, it is possible to view and execute Data Preview on the HANA calculation views.


3. The third way is using HANA Studio, bearing in mind that it is deprecated. To run the Data Preview on HANA calculation views nodes, you need to create the debug view for the desired node in advance, as shown in item 1.

  • As we mentioned before, the HDI container has two names, the logical name and the physical name. The logical name is fixed, “SAPTMF_RT”, whereas the physical name has a random numeric part, as shown in the image below.




  • To discover the name of the physical container, access transaction SCTS_AMHC and type the logical name SAPTMF_RT

  • Later, it is necessary to give reading permission to your HANA user so that it can access the physical container SAPTMF_RT_XXXX.

  • After having access to it, it is possible to see the container and the views in the catalog




  • SQL example

    • SELECT TOP 10 FROM "SAPTMF_RT_7236"."sap.glo.tmflocbr.ctr::AJUSTE_APURACAO_IPI";




In this blog post, we have seen three different ways of executing Data Previews in the HANA calculation views of ACR Brazil Option.

We would very much like to know your feedback. Leave your comment below if you have any questions or suggestions for an upcoming post. In addition to the comments, you can contact us via the Customer Influence platform. There, you can propose ideas to improve our product, vote on other ideas already released, and follow up on ideas in implementation. Also, remember to follow the Advanced Compliance Reporting tag here in the SAP Community to know the latest news about S/4HANA ACR Brazil Option.

Best regards,

Jovani Alves

ACR Development Team

#SAPGoGlobal #SAPLocalization #ACR