SAP Program J_1BNFAW - Archiving of Notas Fiscais: Write Program

Description
You use this report to archive Notas Fiscais (NF) and Electronic NotasFiscais (NF-e) after they are no longer needed in the database. Thereport uses the function modules of the function module group ARCH ofthe Archive Development Kit (ADK) with a corresponding standard classhierarchical structure contained in an archiving objectwhich is always defined for a complete set of archiving tools (i.e.archiving, deletion, reload and read program).

Precondition
In the NF Criteria tab, enter the criteria to specify the NFs youwant to archive.
SAP recommends that you always use the same selection criteria for thearchiving. You can change the selection criteria later on, but thismight make reloading certain files from the archive more complicatedthan if you maintain the original selection criteria.
In the NF-e Criteria tab, determine if you want to include,exclude or archive only the NF-es.
Using the Delete Program (Test Run) and the Create ArchiveFile checkboxes, you can switch off the creation of archive files(test mode of the archiving program) and to switch the deletion programto test mode. The deletion is then carried out using a test run variantin which you can specify if deletion actually takes place. This variantcan be accessed via the customizing of the archiving object. If not intest mode the deletion program uses the productive variant which canalso be maintained in the customizing settings.
When the archiving program is executed in batch and all customizingflags are set accordingly, it calls a deletion program after eacharchiving session or after individual archive files have been written.You have to specify the deletion program in the customizing of thestandard class.

Output
If you select the Create Archive File checkbox, the reportcreates archive files containing the selected records from the database.In batch mode it can automatically start a deletion program to removethe archived records from the database. A second option on the selectionscreen allows you to execute the deletion program in test mode so thatthe archived records remain in the database as well.
SAP recommends that you delete the archived data as soon as possible toprevent data from being changed after a version has been created in thearchive, leading to inconsistencies.
If the report is executed in online mode, the output is a list of thearchived data on the screen. However, you have to start the deletionprogram separately since there is no automatic start of deletion in theonline mode.

Results
The execution of the report results in the creation of an archive filethat contains the NFs and NF-es that you specified with the selectioncriteria. If you execute the report in batch mode, when the NFs andNF-es are archived, they are also deleted from the database because theread program automatically calls the delete program.
Additionally the delete program creates an entry in the index table foreach NF and NF-e that is in the archive. This is crucial for the readprogram that looks up the archived NFs position in this table.