Skip to Content

New Distribution Web Service (NFeDistribuicaoDFe)

Hello everyone,

Some of you have some questions about how the new distribution webservice works and how GRC (SAP NFE) deals with it. That said, we have created the following KBA to maybe enlighten you a bit more:

2131912 – KBA [3.10] Best practices for new distribution webservice of NF-e

I hope this information helps you.

Best regards,


You must be Logged on to comment or reply to a post.
  • Hi Tiago!

    Thanks for sharing this 🙂

    From the KBA I have a doubt: is it now possible to perform the Operation Acknowledgement manually, or will it be always triggered?

    In other words, is it still mandatory and automatic, or can we disable it (so users can choose when to perform it and select the docs)?

    From the NT2012.002 (not sure if there is an update for this point) I got this: “O destinatário deve apresentar uma manifestação conclusiva dentro de um prazo máximo definido, contados a partir da data de autorização da NF-e. Este prazo é parametrizável e atualmente está definido em 180 dias.”, meaning that if we have the Operation Acknowledgement event, we must present another one to ‘close’ the operation.

    But most of the companies are not obligated to present the Operation Acknowledgement for all processes, so I understand that this step should not be mandatory/automatic – at least configurable (if the customer wants to download the XML file, then it would be OK to force to have the ACK).

    By being a mandatory step, even those docs that are not being closely monitored by the users (like docs with small amounts) will require an analysis to check if the goods were received to close the process, forcing them to have someone checking this. If the step is optional, they can focus only on those docs that are relevant, and maybe in the future introduce a routine to check them all.

    Kind regards,

    Eduardo Hartmann

    • Hi Eduardo,

      You see, the point is that SEFAZ only allows you to download the XML from this webservice if you issue the operation acknowledgment event. Otherwise, you won’t be able to download from SEFAZ but only receive it via B2B.

      So, answering your question. Depends (Yes or No). Example:

      If you are still receiving the NF-e via B2B you don’t have to issue the Operation Acknowledgement Event. Then, when running the Collect Documents, as the NF-e will already exist in your system, GRC will ignore it and all your processes will continue as they exist today. However, if you don’t have the NF-e, you will have two options:

      1 – You can issue the Operation Acknowledgement and then download the XML from SEFAZ (Again, SEFAZ only sends you the complete XML if this event is authorized!) and continue with the whole process;

      2 – You can opt to use the Badi described in the help and not issue the Operation Acknowledgement Event. With this, the NF-e will not be downloaded from SEFAZ and you will only have this NF-e with this summary process as you only have a few information on it. Then, you have to contact your partner to check how to get the NF-e for example.

      Let me know if you still have any questions.



      • Hi Tiago!

        1 – You can issue the Operation Acknowledgement and then download the XML from SEFAZ (Again, SEFAZ only sends you the complete XML if this event is authorized!) and continue with the whole process;

        About this option, I conclude that if we don’t implement the BAdI, then the event is created automatically (when the XML was not received via B2B).

        But if we don’t want to create the event and neither download the XML (at least automatically)? It would be good to have an option so that the user can choose to create the event of Operation Acknowledgement, and then the XML could be downloaded automatically (or not, maybe this could also be left as manual – according to configuration).

        Do you see any problems on this approach?

        It is perfectly clear that:

        a) We can only download the XML if Operation Ack is done.

        b) Companies are obligated to store the XMLs.

        Thanks, kind regards!

        Eduardo Hartmann

        • Hi Eduardo,

          Yes, if you don’t have the badi implemented, the event will always be created (if the NF-e don’t exist in your database table).

          So, today, the return value for this badi only have two values of return, which is to continue and issue the event to download afterwards or to not issue the event and the set the process as completed (will be as summary until you receive via B2B). So, if you want to change that, it would be a new requirement, so I would suggest you to open a new topic in the ideas place for example and explain which are the reasons for that.

          However, as a ‘workaround’ let’s say, for now, if you really want for the user to decide if they want to issue the event or not, you can create your own logic inside the badi and return an invalid value (you can use the user of the job for example). Then, the step validate will be set to error and then the user has two options. If he wants to issue the event, he clicks in continue process, then the badi will be called again (validate step) and this time your logic set the step to OK and then the event will be created. If he doesn’t want to issue the event, it is possible to manually set the process to OK, which will not issue the event then (keep in mind that an infotext has to be inserted and all NF-es have to manually processed).

          But then again, this is up to you as today this scenario is not supported (you either issue the event or you don’t). If you want to try to change the standard behaviour please suggest in the ideas place as I mentioned before.