This post is a complement to the post: SAP TDF – Where to start from?

Once again, thank you to my friend Karen Rodrigues for allowing me to translate her SCN post in here. So, please, if you found this information useful, take half of a minute to rate her post on SCN with 5 stars: TDF – Persistencia de DF-e

From this point and beyond, it is a complete translation of her post:

Folks, you may have heard about the BAdI J_1BNF_ADD_DATA also known as “NEW BADI”. Not yet? Know it exist but doesn’t know the difference?
The new BAdI is one of the pre-requisites if you are thinking in migrating to SAP TDF!

00Source: SAP

I hope this post will clarify a little about this subject and give you the motivation to implement in in your company or customers.

But first…. What is the difference between the new BAdI and the classic BAdI (CL_NFE_PRINT~ FILL_HEADER and FILL_ITEM)?

The first difference to mention is that the new BAdI has the functionality of data persistence. When you change information in the NFe creation via classic BAdI CL_NFE_PRINT, all the data changed is stored only in the XML file! The information is not recorded back in the NFe document at SAP ERP, which is a huge issue. If you have to send the data from SAP ERP to another external interface (e.g. fiscal bolt-on system to report SPED) you will have to build the same logic in that interface.

With the new BAdI, the information changed in the XML will be updated back in the ERP, which helps a lot when interfacing with other system, and reduces the differences between what you see on J1B3N (SAP ERP) versus the XML generated.

This also avoids paying fines during a tax audit when there are differences between the information reported and stored or even missing information.

Another difference is in the moment that the BAdI is called. The new BAdI is called at the moment that the document is posted, instead when the document is sent to the message system. An advantage of that is that you can implement several validation rules even before the document be assigned to a number and/or sent to message system.


Flow before the persistence:


Source: SAP


Flow after the Persistence:


Source: SAP

Another important difference to be mentioned is that not all the information that today can be updated via classic BAdI are available in the new BAdI. That means, be careful during the migration from classic to new BAdI. If you find a need to populate a field that it is not available due to an issue on SAP, recommended to open an incident to SAP. Otherwise review the process.


The new BAdI also brings new fields and views on J1B1N, see below some screenshots:

Source: SAP


Other Frequent Asked Questions:

  • Do I need to have the SAP TDF license to implement the new BAdI?

No. The New BAdI is covered via SAP ERP license and it is not dependent on SAP TDF license.

  • Is the new BAdI a pre-requisite to SAP TDF?

Yes. And it is strongly recommended to implement the BAdI way before moving to TDF. Consider the new BAdI as SAP best practices.

  • Do I need to implement the OSS Notes referent to the Master Data enhancement (new fields)?

Yes. It is recommended that you implement those OSS notes.

  • Besides the Master Data enhancements, is there any other pre-requisite to be considered? 

Yes. You will need to implement the new Screen Control for NF documents.

  • By activating the new BAdI, will the classic BAdI stop working?

That was the initial behavior, but SAP released an OSS Note that allows you to implement the new BAdI in phases. See more in this blog post (in Portuguese):

  • Is the new BAdI Available to all SAP Versions?

No. Only to versions from ECC 6 EHP5 or higher!

  • What are the main OSS notes to consider?

1844619 – NF-e: Storing Additional Data – BAdI, derived fields, texts

1844621 – NF-e: Storing Additional Data – Obj.Services & NF Writer

1860433 – NF-e: Storing Additional Data for DANFE & Reporting

1860360 – NF-e: Storing Additional Data – application generated NFs

1860362 – NF-e: Storing Additional Data – outbound NF-e & Reports

1860433 – NF-e: Storing Additional Data for DANFE & Reporting

1869063 – NF-e: send obsCont, obsFisco, procRef to GRC

1865657 – NF-e: Update MM/FI with NF-e number – Credit Memos

1889990 – NF-e: Update MM/FI with NF-e number – Credit Memos

1803009 – Renewal of Screen Controls in Nota Fiscal Writer

1877404 – NF-e: Enhancements NF Writer screen controls

1859126 – NF-e: Storing Additional Data – Enhancement of NF Writer

1882947 – NF-e: Storing Additional Data – Corrections for NF Writer

1923423 – Nota Fiscal: only two tax lines are displayed on the tax screen

1951532 – Nota Fiscal: scroll through items not consistent


In conclusion

To implement the new BAdI is easy to justify by the fact that it will bring to the source (ECC) the information as it is reported to the SEFAZ and recude the maintenance in interfaces with external systems.

Karen Rodrigues