Documente Academic
Documente Profesional
Documente Cultură
2019-10-29
SAP Nota Fiscal Eletrônica (SAP NFE, SAP Electronic Invoicing for Brazil) helps companies comply with the
Brazilian requirements for electronic invoicing. SAP NFE is a centralized data store and workplace for all
messages communicated between your company and the government system, as well as for messages
between your company and other companies' systems in B2B scenarios. It also is the central platform for
storing the exchanged files as required by law and provides interfaces for easy access to these documents. This
document describes the configuration of the NF-e outbound and NF-e event procedures.
As a first setting, the tax number(s) of your company need(s) to be defined to control further customizing
settings based on the CNJP(s).
Use transaction SPRO and navigate to the SAP Customizing Implementation Guide (IMG): Nota Fiscal
Eletrônica General Settings Maintain Own Tax Numbers
2. Digital Signature
2.1. Prerequisites
● Prerequisites
○ User Role
Prerequisite to capture the digital signature is the user role SAP_QAP_RZL_ADM to execute transaction
Strust.
○ Request of Certificate
In order to issue electronic invoices the xml must be signed using a digital certificate compliant with
ICP-Brasil standards securing the access between the NFE system and the government's servers.
To obtain the digital certificate you must interact with a certification authority. You can find a
completed and updated list of certificating authorities on the website of the National Information
Technology Institute (ITI Brazil) http://www.iti.gov.br. The main certification authorities are:
Caixa, Serasa, Certisign, Valid, Digitalsign, and Boa Vista.
The certificating authorities can issue both certificates, as well as certificates in the form of a physical
token. Therefore, make sure you request the digital certificate that can be used for e-commerce
transactions in PKCS#12 format with the ending .pfx. The certificate can also be used for the client
● Outbound Configuration
○ Create PSE
Use the tool SAPGENPSE to create a PSE from the existing private certificate as described in Importing
a PKCS#12 File:
Note
The user interface for master data maintenance and the central messaging monitoring uses Web technology,
for which you must activate the relevant services.
In SAP NFE, enter the transaction code SICF and choose Execute. Select the following entries:
In the navigation tree for the virtual hosts/services, navigate to default_host sap bc webdynpro
xnfe :
Activate the basis services for the virtual hosts/services for each of the following entries by using the context
menu and selecting Activate Service:
Batches that package NF-es/events require a number range to identify and to monitor the batches in process.
In the batch monitors of SAP NFE, you can use this number range to access all NF-es/events that the system
has combined into one batch.
Note
CT-e and MDF-e events are not authorized in batches. Every event for CT-e/MDF-e is send individually and
synchronously.
Use transaction code SNUM to create the number range for the object /XNFE/BAID, as well as /XNFE/EVBT
and create interval 01 with a length of 15 digits.
Use transaction code SM59 in the logistics feeder system SAP ERP to define the RFC destination for the core
application of SAP NFE:
Use transaction code SM59 in SAP NFE to define the RFC destination for the SAP ERP system:
NFE and SAP NetWeaver PI must be connected. To do that, use transaction sxmb_admin Integration
Engine Configuration .
To adjust the user menu for SAP NFE Outbound, the following roles are needed:
1. /XNFE/WP_NFE_ADMIN
Transaction PFCG shows that this role is intended for the NFE Administrator. It does not contain
authorizations and is therefore only meant to create and set up the user menu. You should copy this role to
adjust the user menu according to your requirements. This role can be combined with other roles in a
composite role.
For communication processes, you must define batch jobs that require regular processing.
For creating a batch job, use transaction code SM36. Enter a job name and go to Start condition.
Determine which XML version is used for individual message types when communicating with authorities.
Configure the system behavior and storage location of the certificate that you use for digital signatures. Also
configure whether or not you use the productive or test system environment for your communication. You have
to do this for every tax number that you are using in your company:
Define the codes (and their descriptions) that the authorities use as electronic answer message. You receive
this list from your responsible tax authority. Use transaction /XNFE/STATUS_UPLOAD to upload the electronic
list version to the system. An individual line of the file can only contain one code and its description, split by a
separator.
The process Issue of NF-e with Batch consists of the following steps (also described in the application help
under http://help.sap.com/nfe Application Help English ):
You can influence the handling of the process flow depending on the sender's and/or recipient's CNPJ number
in the document.
Determine the business partners you want to exchange electronic documents with.
● Option 1: Create a new entry with a blank CNPJ field and select indicator* for electronic communication.
This activates sending electronic documents for all business partners.
● Option 2: Create an entry for each business partner with whom you want to exchange documents
electronically in a manner that is different from the standard setting. To do so, enter the tax number
(CNPJ).
*In the B2B Active field, you decide between the following parameters:
Determine with which natural persons you want to exchange electronic documents.
1. Option 1: Create a new entry with a blank CPF (tax number for a natural person) field and select the
indicator B2B Active (B2B Scenario CPFs). This activates general sending for all natural persons.
2. Option 2: Create an entry for each business partner with whom you want to exchange documents
electronically in a manner that is different from the standard setting. To do so, enter the CPF number.
Configure to which authority system you want to send your NF-e messages.
1. Select the desired logical system and enter your tax number (CNPJ).
2. Then select the region (CUF) of the authority system you want to communicate with, and determine
whether you want to use the system environment (Test or Production) at SEFAZ/SCAN Authority.
Determine which XML version you want to use for individual message types.
1. Enter the logical system and tax number. A blank tax number is also permitted.
2. The document types must be defined for each tax number
3. The XML versions for the message types NFE (Issue NF-e) and INUTNFE (Skip NF-e) have to be
maintained.
16. NF-e: Define Query for Service Status for Authority (SEFAZ)
The availability of the SEFAZ system as well as the responsible contingency system has to be checked
periodically. To do so, use following parameters for each combination of Brazilian region and system
environment:
The process NFEISSU1 bundles NF-es into batches. The following parameters must be defined:
Note
These parameters have a high influence on the CPU usage, disk usage, and overall performance of SAP
NFE. Therefore, change the parameters according to business needs and try to create the batches with the
highest NF-e number in an acceptable time duration. Be aware that using small values for Max.Collecting
Time, Max. Batch Size, or Max. Number of NF-es increases the amount of batches. This can provoke
performance problems in the processing. The creation of NF-e batches is also influenced by the way you
schedule the job for the batch report. For more information about batch jobs, refer to the section NF-e
Batch Job Planning (Outbound) in the application help of SAP NFE (see http://help.sap.com/nfe ).
Assign the desired process type to the CNPJ number. You can also make a blank entry for the CNPJ number. In
this case, the system first searches for an entry that matches the relevant CNPJ number when determining the
process type. If no matching entry is found, the system uses the blank entry.
The process determination is carried out when the NF-e is received from the feeder system (ERP). There is
no option to switch between the two processes during processing. If you want to send a rejected NF-e with
a different process, you have to forward the rejection to your feeder system (Change the Customizing!) and
send the NF-e again.
To double check that the necessary customizing and the batch jobs are correct, execute program /XNFE/
CONF_CHECK.
2. A table with the information about the following customizing/jobs for this CNPJ is displayed:
○ Signature
○ XML Version for NF-e
○ XML Version for Skip
○ XML Version for NF-e Events
○ Job for NF-e Sending
○ Job for Acknowledgements
○ Job for Skip NF-e Sending
○ Job for NF-e Event Sending
○ Job for Status Check
○ Job for B2B Sending
○ Job for Continue Process
3. The red marked statuses show missing entries. By selecting the line and clicking on the button Adapt
Configuration, you navigate to the linked IMG activity.
Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:
● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:
● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.
● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such
links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.
Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.
Gender-Related Language
We try not to use gender-specific word forms and formulations. As appropriate for context and readability, SAP may use masculine word forms to refer to all genders.
SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.