Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
aliceotero
Advisor
Advisor
(Scroll down for the English version, which is proudly presented by the SAP Leonardo machine translation service .)

Olá pessoal,

Uma das bases da comunicação do SAP ERP HCM eSocial com o ambiente nacional do eSocial é o certificado digital. Ele garante a segurança na transmissão e na assinatura dos documentos enviados. Conforme a regulamentação do eSocial, os certificados digitais aceitos devem ser do tipo e-CPF ou e-CNPJ. No blog de hoje, vamos falar sobre o problema de se usar diferentes números de inscrição devido a trocas de certificados.

O problema: diferentes números de inscrição

Em alguns casos, as empresas usam os certificados e-CPF para transmitir o evento ao ambiente nacional do eSocial, mas trocam o certificado por outro, por exemplo, porque o empregado vinculado àquele CPF foi desligado da empresa. Só depois de trocar o certificado é que a empresa consulta a resposta dos lotes. Neste cenário, o lote consultado retorna com os erros 504 e 604:
-<retornoProcessamentoLoteEventos>
-<status>
<cdResposta>504</cdResposta>
<descResposta>Solicitação de consulta incorreta - Erro Certificado.</descResposta>
-<ocorrencias>
-<ocorrencia>
<codigo>604</codigo>
<descricao>O retorno do processamento do lote somente é acessivel a quem enviou a solicitação.</descricao>
<tipo>1</tipo>
</ocorrencia>
</ocorrencias>
</status>
</retornoProcessamentoLoteEventos>

Usar o certificado digital do tipo e-CPF e trocá-lo pode constituir um risco. A questão é que o CPF do certificado que enviou o lote é diferente do que solicitou a consulta da resposta do lote. Conforme o Manual de Orientação ao Desenvolvedor do eSocial, essa diferença no número de inscrição não pode ocorrer:
Observação: Somente quem transmitiu a solicitação de processamento tem acesso ao resultado do processamento. Portanto, é necessário utilizar o mesmo certificado (certificado com o mesmo número de inscrição) da transmissão para acessar o resultado do processamento do lote.

(Consultamos a versão 1.7 do manual, página 44, em 5 de outubro de 2018.)

Orientações da SAP

A nossa principal orientação é que o número de inscrição do certificado digital seja constante, mesmo que o certificado em si não seja o mesmo. O e-CNPJ oferece mais segurança nesse sentido, porque o número de inscrição (CNPJ) se mantém, mesmo que o certificado em si seja trocado.

Sabemos, porém, que cada empresa tem suas peculiaridades, e há casos em que o certificado digital do tipo e-CPF será usado. Tenha sempre em mente o risco da troca do certificado, conforme explicamos acima. Antes de efetuar a troca, certifique-se que todos os lotes enviados não estejam com status Esperando resposta.

Caso esta troca de certificado do tipo e-CPF ocorra depois de a empresa transmitir os eventos e antes de consultar a resposta, será preciso utilizar alguma solução própria para ajustar o status dos eventos afetados.

Gostou desse post? Dê um Like e compartilhe o conteúdo com seus colegas.

Fique à vontade para deixar um feedback, comentário ou pergunta no espaço abaixo. E não esqueça de seguir a tag HCM Payroll Brazil na SAP Community para ficar ligado nas últimas notícias sobre o eSocial.

Um abraço,

Alice

----

Hi everyone,

One of the SAP ERP HCM eSocial communication bases with the eSocial national environment is the digital certificate. It ensures security in transmission and signature of submitted documents. According to the eSocial regulation, the accepted digital certificates must be of types e-CPF or e-CNPJ. In today's blog post, we'll talk about the problem that happens if you use different registration numbers due to certificate changes.

The Problem: Different Registration Numbers

In some cases, companies use the e-CPF certificates to transmit the event to the eSocial national environment, but replace the certificate with another certificate, for example because the employee linked to that CPF was terminated. Only after replacing the certificate does the company queries the batch response. In this scenario, the requested batch returns with errors 504 and 604:
-<retornoProcessamentoLoteEventos>
-<status>
<cdResposta>504</cdResposta>
<descResposta>Solicitação de consulta incorreta - Erro Certificado.</descResposta>
-<ocorrencias>
-<ocorrencia>
<codigo>604</codigo>
<descricao>O retorno do processamento do lote somente é acessivel a quem enviou a solicitação.</descricao>
<tipo>1</tipo>
</ocorrencia>
</ocorrencias>
</status>
</retornoProcessamentoLoteEventos>

 

Using the digital certificate of type e-CPF and replacing it can be a risk. The point is that the CPF of the certificate that sent the batch is different from the one that requested the batch response query. According to the eSocial Developer Guidance Manual, this difference in the registration number cannot occur:
Note: Only the person who transmitted the processing request has access to the processing result. Therefore, it is necessary to use the same certificate (certificate with the same registration number) of the transmission to access the result of the batch processing.

(This is SAP's translation for the eSocial Developer Guidance Manual relevant excerpt. We have consulted version 1.7 of the manual, page 44, on October 5, 2018 - original content in Portuguese.)

SAP Orientations

Our main orientation is that the registration number of the digital certificate is constant, even if the certificate itself is not the same. The e-CNPJ is safer in this sense, because the registration number (CNPJ) is the same, although the actual certificate might be replaced.

We know, however, that every company has its unique aspects, and there are cases where the digital certificate of type e-CPF will be used. Always keep in mind the risk of replacing the certificate, as explained above. Before replacing the certificate, make sure that all submitted batches are not in status Waiting for response.

If the e-CPF certificate is replaced after the company transmits the events and before the company queries the batch response, you must use your own solution to adjust the status of the affected events.

Did you enjoy this post? Choose “Like” and share the content with your colleagues.

Feel free to leave your feedback, comment or question in the space provided below. And don’t forget to follow the tag HCM Payroll Brazil in SAP Community to stay tuned on eSocial latest news.

All the best,

Alice