Financial Management Blogs by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
cancel
Showing results for 
Search instead for 
Did you mean: 
claudia_wada
Advisor
Advisor
Olá,

Neste blog post você vai encontrar detalhes sobre as contingências Switch to Contingency (STC) e Cancel Prior to Authorization (CPA). Estas funcionalidades foram entregues no monitor J1BNFE há alguns anos atrás, mas talvez não sejam de conhecimento de todos os usuários SAP.

Basicamente, elas devem ser utilizadas em caso de falha de conexão com a SEFAZ ou com o sistema de mensageria para uma NF-e em específico.

Sabemos que devido a muitos fatores, uma NF-e pode ficar com status em processamento sem retorno da SEFAZ e gerar sérios impactos na logística e faturamento, como por exemplo a mercadoria não sair para entrega devido ao atraso na aprovação da NF-e.

Nos casos de estoque associado, isto se torna mais crítico pois não é possível cancelar os documentos de origem (billing, documento de material, etc) sem que a NF-e seja cancelada na SEFAZ. Assim uma NF-e parada bloqueia o estoque e gera os transtornos já conhecidos.

As funcionalidades STC e CPA atuam neste cenário, permitindo o cancelamento do documento de origem da NF-e que está com erro, por exemplo a billing, e gerando uma nova NF-e com cópia da original para dar seguimento ao processo.

A NF-e original deverá obrigatoriamente ser cancelada ou inutilizada junto à SEFAZ assim que o problema técnico for resolvido.

OK, mas qual a diferença entre STC e CPA?

Basicamente o STC vai criar a nova NF-e em contingência formulário de segurança; e o CPA vai criar em emissão normal.

É importante entender que existem configurações específicas para STC e CPA:

View J_1BNFE_CUST3_4V:


 

O campo “Cancel Electr.Doc.:” é composto pelas opções:

  • Manually: o documento de origem deve ser cancelado manualmente (por exemplo VF11) e a nova NF-e deve ser gerada manualmente também, via transação de origem (por exemplo VF01)

  • C Create new fiscal doc. And request cancel. for previous one: o sistema automaticamente irá desvincular a NF-e original do documento de origem e será criado uma nova NF-e com cópia vinculando ao documento de origem

  • X Cancel source document automatically: o documento de origem será cancelado automaticamente mas a nova NF-e deve ser gerada de forma manual (por exemplo VF01)


O flag “Send. Cancel. Req. Automatically” é referente ao cancelamento da NF-e na SEFAZ. Assim que o problema técnico da NF-e original for solucionado, o sistema irá solicitar o cancelamento junto à SEFAZ automaticamente se esta flag estiver ativa. Esta opção é altamente recomendada, pois se não houver um processo bem definido, o documento de origem/NF-e pode estar cancelada no ERP mas não estar cancelado na SEFAZ. Lembrando que a maioria das SEFAZ possuem prazo de 24 horas para cancelamento normal.

Não esqueça de preencher os motivos de contingência para STC e CPA, do contrário o cancelamento não será enviado de forma automática para SEFAZ.

 

Após configurado, as funcionalidades STC e CPA podem ser acessadas no monitor J1BNFE:

STC: botão Contingency ou pelo menu More > Fiscal Document > Switch to Contingency


 

CPA: More > Fiscal Document > Cancel > Cancel Prior to Auth.



 

Veja um exemplo considerando a configuração abaixo:


 

Este docnum possui uma billing associada:


 

A NF-e se encontra em processamento sem retorno da SEFAZ:


 

Selecione a opção Contingency:


 

Confirme o motivo da Contingência:


 

Veja que a coluna Switched to Contingency ficou marcada com um X:


 

Neste momento, por conta da opção C, o sistema criou uma nova NF-e e já associou ao billing de forma automática. A NF-e original (docnum 12271) não possui mais referência com a billing:


 

Novo docnum gerado automaticamente e associado a billing:



 

A nova NF-e foi gerada em contingência, veja coluna Poster Under Contingency. Agora a operação poderá seguir.


 

Assim que o problema da NF-e original for resolvido, a SEFAZ poderá retornar a NF-e aprovada rejeitada, caso ela tenha sido autorizada, um cancelamento à SEFAZ será solicitado automaticamente; caso a mesma tenha sido inutilizada,  uma inutilização será solicitada automaticamente. No exemplo, ela foi autorizada portanto uma solicitação de cancelamento foi efetuada automaticamente por conta do flag do customizing mencionado no começo do blog:



 

Para obter um melhor tracking no caso da opção C, na tabela J_1BNFDOC foram criados os campos DOCNUM_NEXT e DOCNUM_PREV que serão preenchidos com os docnums correspondentes:

  • DOCNUM_NEXT: docnum gerado com cópia e em substituição do docnum consultado

  • DOCNUM_PREV: docnum original que foi desvinculado ao documento de origem



 

No caso de CPA, todo o processo acima é o mesmo, a diferença é que a nova NF-e será gerada em emissão normal ao invés de contingência formulário de segurança.

Para maiores informações, consulte o SAP Help Portal:

Switch to Contingency (STC): https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/c5e66d2df826499d9b8c76b8355601c3/48f8cf229a6f740ee10...

Cancel Prior to Authorization (CPA): https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/c5e66d2df826499d9b8c76b8355601c3/92e0cf8bb66d4cecbe7...

 

Obrigada,

Cláudia Wada




English version

Learn about existing contingencies in the Electronic Nota Fiscal solution in ERP

Hello,

I will describe in this blog details about the Switch to Contingency (STC) and Cancel Prior to Authorization (CPA) contingencies. These functionalities were delivered in the J1BNFE Monitor many years ago but may not be known to all SAP users.

Basically, they should be used in case of connection failure to SEFAZ or messaging system for a specific NF-e.

We know that due to many factors, an NF-e can be in processing status without return from SEFAZ, and cause serious impacts on logistics and billing, such as goods not leaving for delivery due to delayed NF-e approval.

In associated stock cases, this becomes more critical because it is not possible to cancel the source documents (billing, material document, and so on) without the NF-e being canceled in SEFAZ. Thus, a stopped NF-e blocks the stock and generates the known disorders.

The STC and CPA features act on this scenario, allowing you to cancel the source document (for example, billing) of the problematic NF-e and generate a new NF-e with a copy of the original to follow up the process.

Once the technical problem has been solved, the original NF-e must be canceled or skipped in SEFAZ.

OK, but what's the difference between STC and CPA?

Basically, the STC will create the new NF-e in “contingency security form”; and the CPA will create in “normal issuance”.

It is important to know that there are specific settings for STC and CPA:

View J_1BNFE_CUST3_4V


The field “Cancel Electr.Doc.:” consists of the options:

  • Manually: source document must be cancelled manually (e.g., VF11) and new NF-e must be generated manually also via source transaction (e.g., VF01)

  • C Create new fiscal doc. And request cancel. for previous one: the system automatically unlinks the original NF-e from the source document and create a new NF-e with copy linking to the source document.

  • X Cancel source document automatically: the source document will be cancelled automatically, but the new NF-e must be generated manually (e.g., VF01)


The “Send. Cancel Req. Automatically” flag refers to the cancellation of the NF-e at SEFAZ. Once the technical problem of the original NF-e is solved, the system will request the cancellation at SEFAZ automatically if this flag is active. This option is highly recommended because if there is no defined process, the source document/NF-e may be canceled in ERP but not in SEFAZ. Remember that the deadline for normal cancellation at SEFAZ is 24 hours.

Remember to fill the contingency reasons for STC and CPA, otherwise the cancellation will not be sent automatically to SEFAZ.

 

Once configured, the STC and CPA features can be accessed in the J1BNFE Monitor:

 

STC: button Contingency or via menu More > Fiscal Document > Switch to Contingency



CPA: More > Fiscal Document > Cancel > Cancel Prior to Auth.


 

See an example considering the configuration below:


 

This docnum has an associated billing:


 

The NF-e is in process, without SEFAZ’s response:


 

Select the option Contingency:


 

Confirm the reason of Contingency:


 

Note that the Switched to Contingency column is marked with an X:


At this point, the system has created a new NF-e and has already associated it to billing. The original NF-e (docnum 12271) doesn’t have reference with billing anymore:


 

New docnum generated automatically and associated with billing:



 

The new NF-e was generated in contingency, see column Poster Under Contingency. Then the operation can proceed.


 

When the technical problem of the original NF-e is solved, SEFAZ may return or rejected, if it has been authorized, a cancellation from SEFAZ will be requested automatically; in case it has been unused, a skipping will be requested automatically. In this example, the NF-e was approved, so the cancellation request was automatically made because of the Customizing flag:



 

To achieve a better tracking for option C, table J_1BNFDOC contains the fields DOCNUM_NEXT and DOCNUM_PREV, which are filled with the corresponding docnumbers:

  • DOCNUM_NEXT: docnum generated with copy and replacing consulted docnum

  • DOCNUM_PREV: original document that was detached from source document



In case of CPA, the whole process above is the same, the difference is that the new NF-e will be generated in normal issuance instead of security paper contingency.

For more information, see the SAP Help Portal:

Switch to Contingency (STC): https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/c5e66d2df826499d9b8c76b8355601c3/48f8cf229a6f740ee10...

Cancel Prior to Authorization (CPA): https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/c5e66d2df826499d9b8c76b8355601c3/92e0cf8bb66d4cecbe7...

Thank you
2 Comments