Saphelp nfe10 en 93 cc40a6f0434083a64e23823175a8ff content

174
SAP NOTA FISCAL ELETRÔNICA (SAP ELECTRONIC INVOICING FOR BRAZIL) PDF download from SAP Help Portal: http://help.sap.com Created on March 07, 2014 The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal. Note This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included. The selected structure has more than 150 subtopics. This download contains only the first 150 subtopics. You can manually download the missing subtopics. © 2014 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see www.sap.com/corporate- en/legal/copyright/index.epx#trademark for additional trademark information and notices. PUBLIC © 2013 SAP AG or an SAP affiliate company. All rights reserved. Page 1 of 174

Transcript of Saphelp nfe10 en 93 cc40a6f0434083a64e23823175a8ff content

SAP NOTA FISCAL ELETRÔNICA (SAP ELECTRONIC INVOICINGFOR BRAZIL)PDF download from SAP Help Portal:http://help.sap.com

Created on March 07, 2014

The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal.

NoteThis PDF document contains the selected topic and its subtopics (max. 150) in the selected structure.Subtopics from other structures are not included.The selected structure has more than 150 subtopics. This download contains only the first 150 subtopics. Youcan manually download the missing subtopics.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in anyform or for any purpose without the express permission of SAP AG. The information contained herein may be changed without priornotice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other softwarevendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAPGroup") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors oromissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in theexpress warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting anadditional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks orregistered trademarks of SAP AG in Germany and other countries. Please see www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 1 of 174

TABLE OF CONTENT1 SAP Nota Fiscal Eletrônica (SAP Electronic Invoicing for Brazil)1.1 Overview of SAP Nota Fiscal Eletrônica1.2 Architecture of SAP Nota Fiscal Eletrônica1.3 Configure SAP Nota Fiscal Eletrônica1.3.1 General Settings for SAP Nota Fiscal Eletrônica1.3.2 Configuration of NF-e Outbound1.3.2.1 Configuration of NF-e (Outbound)1.3.2.1.1 Technical Settings for NF-e Outbound1.3.2.1.2 Digital Signature Configuration for NF-e Outbound1.3.2.1.3 Setup of System Communication from and to SAP NFE for NF-es1.3.2.1.4 Activating Services for UI Display of NF-e Monitors (Outbound)1.3.2.1.5 Process Settings and Customizing (Outbound)1.3.2.1.6 Settings for NF-e Batch Processing (Outbound)1.3.2.1.7 NF-e Batch Job Planning (Outbound)1.3.2.1.8 User Roles and Authorizations for NF-e (Outbound)1.3.2.2 SAP NetWeaver PI Configuration for NF-e (Outbound)1.3.2.2.1 Creating NF-e Configuration Scenarios from Integration Scenarios1.3.2.2.1.1 Integration Scenarios for NF-e Configuration (Outbound)1.3.2.2.2 Configuration Object Definition for NF-e Configuration Scenarios1.3.2.2.2.1 NF-e Communication with Authority Systems (Outbound)1.3.2.2.2.2 Communicating with NF-e B2B Partners1.3.2.2.3 Completing NF-e Configuration Scenario Settings (Outbound)1.3.2.2.4 Configuration for NFE on AEX (Java-only PI)1.3.2.2.5 NF-e Alert Configuration1.3.3 Configuration of CT-e Outbound1.3.3.1 Process Settings and Customizing for CT-e Outbound1.3.3.2 Digital Signature Configuration for CT-e Outbound1.3.3.3 Setup of System Communication from and to SAP NFE for CT-es1.3.3.4 Activating Services for UI Display of CT-e Monitors (Outbound)1.3.3.5 CT-e Batch Processing in Core Application (Outbound)1.3.3.6 CT-e Batch Job Planning (Outbound)1.3.3.7 User Roles and Authorizations for CT-e (Outbound)1.3.3.8 CT-e Configuration1.3.3.9 SAP NW PI Configuration for CT-e (Outbound)1.3.3.9.1 Creating CT-e Configuration Scenarios from Integration Scenarios1.3.3.9.1.1 Integration Scenarios for CT-e Configuration (Outbound)1.3.3.9.2 Configuration Object Definition for CT-e Configuration Scenarios1.3.3.9.2.1 CT-e Communication with Authority Systems (Outbound)1.3.3.9.2.2 Communicating with CT-e B2B Partners1.3.3.9.3 Completing CT-e Configuration Scenario Settings (Outbound)1.3.3.9.4 Configuration for NFE on AEX (Java-only PI)1.3.4 Configuration of NF-e/CT-e Inbound1.3.4.1 Configuring SAP Nota Fiscal Eletrônica (Inbound)1.3.4.1.1 Technical Settings for NF-e/CT-e Inbound1.3.4.1.2 Configuration for Digital Signature Validation1.3.4.1.3 Activating Services for UI Display of Monitors (Inbound)1.3.4.1.4 Configuring and Personalizing Workplaces (Inbound)1.3.4.1.5 Process Settings and Customizing (Inbound)1.3.4.1.6 Vendor Notification1.3.4.1.6.1 NF-e Rejection Notification1.3.4.1.6.2 CT-e Rejection Notification1.3.4.1.6.3 NF-e Acceptance Notification1.3.4.1.6.4 CT-e Acceptance Notification1.3.4.1.7 NF-e from National Environment: Batch Job Planning1.3.4.1.8 User Roles and Authorizations (Inbound)1.3.4.2 SAP NetWeaver PI Configuration for SAP NF-e/CT-e (Inbound)1.3.4.2.1 Creating Configuration Scenarios from Integration Scenarios (Inb1.3.4.2.1.1 Integration Scenarios for Configuration (Inbound)1.3.4.2.2 Configuration Object Definition for Configuration Scenarios (Inb1.3.4.2.2.1 Communication with Authority Systems (Inbound)1.3.4.2.3 Completing Configuration Scenario Settings (Inbound)1.3.4.2.4 Configuration for NFE on AEX (Java-only PI)1.3.4.2.5 Additional Workplace Configuration (Inbound)1.3.4.2.6 NF-e Alert Configuration1.3.5 Configuration of Events1.3.5.1 Event Batch Job Planning1.3.5.2 Activating Services for UI Display of Event Monitors1.3.5.3 User Roles and Authorizations for Events1.3.5.4 Configuration for Digital Signature Validation1.3.6 Related Configuration in SAP ERP1.4 Outbound1.4.1 NF-e Outbound for XML Layout 2.001.4.1.1 Communication Flow for Sending NF-es with Layout 2.001.4.1.2 NF-e Outbound Monitoring1.4.1.2.1 Document Monitoring in SAP ERP1.4.1.2.2 NF-e Communication Process Monitoring (Outbound) for Layout 2.001.4.1.2.2.1 NF-e Monitor (Outbound) for Layout 2.001.4.1.2.2.2 NF-e Batch Monitor (Outbound) for Layout 2.001.4.1.2.2.3 Stop NF-e Batch Processing1.4.1.2.2.4 NF-e Service Status Monitor (Outbound) for Layout 2.00

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 2 of 174

1.4.1.2.2.5 NF-e Technical Monitoring1.4.1.2.2.6 B2B Monitoring of Inbound Messages1.4.1.2.3 Monitor SAP NetWeaver PI1.4.1.3 BAdIs for Outbound NF-e1.4.2 NF-e Outbound for XML-Layout 3.10+1.4.2.1 Communication Flow for Sending NF-es with Layout 3.10+1.4.2.2 NF-e Processing (Outbound) for Layout 3.10+1.4.2.3 NF-e Batch Processing for Layout 3.10+1.4.2.4 Monitor NF-e Outbound for Layout 3.10+1.4.2.4.1 NF-e Monitor (Outbound) for Layout 3.10+1.4.2.4.2 NF-e Batch Monitor (Outbound) for Layout 3.10+1.4.2.4.3 NF-e Service Status Monitor (Outbound) for Layout 3.10+1.4.2.4.4 Monitor SAP NetWeaver PI for NF-e Layout 3.10+1.4.2.5 BAdIs for Outbound NF-e for Layout 3.10+1.4.3 CT-e Outbound1.4.3.1 Communication Flow for Sending CT-es1.4.3.2 Monitor CT-e Outbound1.4.3.2.1 CT-e Communication Process Monitoring (Outbound)1.4.3.2.1.1 CT-e Processing (Outbound)1.4.3.2.1.2 CT-e Monitor (Outbound)1.4.3.2.1.3 CT-e Batch Monitor (Outbound)1.4.3.2.1.4 CT-e Service Status Monitoring (Outbound)1.4.3.2.2 Monitor SAP NetWeaver PI (CT-e)1.4.3.3 BAdIs for Outbound CT-e1.5 Inbound1.5.1 Business Roles1.5.2 NF-e Inbound1.5.2.1 Business Process Determination and Position Types1.5.2.2 NF-e Processing Step Automation1.5.2.3 Processing Inbound NF-es1.5.2.3.1 NF-e Process Normal Purchasing1.5.2.3.1.1 Processing in SAP ERP: Normal Purchasing1.5.2.3.2 NF-e Contingency Process1.5.2.3.2.1 Processing in SAP ERP: Contingency1.5.2.3.3 NF-e Cancellation Process1.5.2.3.3.1 Processing in SAP ERP: Cancellation1.5.2.3.4 Other Processes for NF-es1.5.2.3.4.1 Processing in SAP ERP: Other Processes for NF-e1.5.2.3.5 NF-e Stock Transfer Process1.5.2.3.5.1 Processing in SAP ERP: Stock Transfer1.5.2.3.6 NF-e Process Customer-Specific Business Process with DANFE1.5.2.3.7 NF-e Subcontracting Overview1.5.2.3.7.1 NF-e Subcontracting Process1.5.2.3.7.1.1 Processing in SAP ERP: NF-e for Subcontracting (SUBCON1A)1.5.2.3.7.2 NF-e for Symbolic Returns1.5.2.3.7.2.1 Processing in SAP ERP: NF-e for Symbolic Returns (SUBCON2C)1.5.2.3.7.3 NF-e for Returns of Components1.5.2.3.7.3.1 Processing in SAP ERP: NF-e for Return of Components (SUBCON2D)1.5.2.3.8 NF-e Future Delivery Overview1.5.2.3.8.1 NF-e Invoice Receipt Future Delivery Process1.5.2.3.8.1.1 Processing in SAP ERP: Future Delivery Invoice1.5.2.3.8.2 NF-e Goods Receipt Future Delivery Process1.5.2.3.8.2.1 Processing in SAP ERP: Future Delivery Goods Receipt1.5.2.3.9 NF-e Consignment Overview1.5.2.3.9.1 NF-e Goods Receipt Consignment Process1.5.2.3.9.1.1 Processing in SAP ERP: Consignment Goods Receipt1.5.2.3.9.2 NF-e Invoice Consignment Process1.5.2.3.9.2.1 Processing in SAP ERP: Consignment Invoice1.5.2.3.10 Returnable Packaging for NF-e Processes1.5.2.3.10.1 Processing in SAP ERP: Returnable Packaging with Purchased Goods1.5.2.4 BAdIs for Inbound NF-es1.5.2.5 NF-e Fiscal Workplace1.5.2.5.1 NF-e Fiscal Workplace: Assignment1.5.2.5.1.1 Assignment for Normal Purchasing and Future Delivery Invoice1.5.2.5.1.2 Assignment for NF-e for Subcontracting (SUBCON1A)1.5.2.5.1.3 Assignment for NF-e for Symbolic Returns (SUBCON2C)1.5.2.5.1.4 Assignment for Future Delivery Goods Receipt (FUTDELGR)1.5.2.5.2 NF-e Fiscal Workplace: Simulating NF-es1.5.2.5.3 NF-e Fiscal Workplace: Recording DANFEs1.5.2.5.4 NF-e Fiscal Workplace: Checking Goods Receipt Quantities

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 3 of 174

1 SAP Nota Fiscal Eletrônica (SAP Electronic Invoicing forBrazil)

Product InformationProduct SAP Nota Fiscal Eletrônica (SAP Electronic Invoicing for Brazil)Release 10.0 SP16Based on SAP NetWeaver 7.02 SP06Documentation published February 2014

SAP Nota Fiscal Eletrônica (SAP NFE; SAP Electronic Invoicing for Brazil) helps companies comply with the Brazilian legal requirementsfor electronic invoicing.

Companies selling products in Brazil must send each invoice electronically to the government for validation before shipping theirgoods.Companies purchasing goods in Brazil must check the electronic invoice at the government before receiving the goods.

The brazilian government wants to be sure that all due tax revenue is collected. Companies need to handle these activities with anautomated solution that can scale to high volumes of invoices and meet their business process requirements: SAP Nota FiscalEletrônica (SAP NFE; SAP Electronic Invoicing for Brazil) is that solution.

1.1 Overview of SAP Nota Fiscal Eletrônica SAP Nota Fiscal Eletrônica (SAP NFE, SAP Electronic Invoicing for Brazil) helps companies comply with the Brazilian requirements forelectronic invoicing. The Brazilian government requires that companies submit an electronic invoice – nota fiscal eletrônica (NF-e) – anda freight document – conhecimento do transporte eletrônico (CT-e) – for every planned goods movement. Further, the authorities areactively involved in the invoicing process, which includes issuing real-time authorization orders for companies' canceled or out-of-sequence invoices. In addition, SEFAZ has introduced the option to add a document to an NF-e/CT-e to provide information. Thisadditional document is an Event and carries additional information for the main document (NF-e/CT-e).

NFE DocumentsNF-e: Nota Fiscal EletrônicaAn NF-e is a document that accompanies the delivery of goods and contains tax and logistical information. Every delivery of goods inBrazil must be accompanied by a nota fiscal.CT-e: Conhecimento do transporte eletrônicoA CT-e is an electronic invoice for billing freight costs and their associated taxes. It can be linked to other CT-es and 1 or more NF-es.Event: A messageA CT-e is an electronic invoice for billing freight costs and their associated taxes. It can be linked to other CT-es and 1 or more NF-es.DANFEDocumento Auxiliar da Nota Fiscal Eletrônica is the printout of an NF-e to accompany the shipment.DACTEDocumento Auxiliar Conhecimento do transporte eletrônico is the printout of a CT-e.

The NFE application covers the following scenarios:Sending NF-es (Outbound)Receiving NF-es (Inbound).Sending CT-es (Outbound)Receiving CT-es (Inbound).Sending Events (Outbound)Receiving Events (Inbound).

OutboundSAP NFE provides integration between company and government systems, following the government-specified execution processesfor sending NF-es.

Sending notas fiscais eletrônicas (NF-es)You can send NF-es to the government system providing that you observe the authority's requirements about file size and format.Canceling of NF-esIf you need to cancel a billing document, you must notify the authorities by a cancellation request.Skipping NF-esIf you reject an NF-e, subsequent NF-es appear to be out of sequence. You must inform the government system about the numbersof all skipped NF-es.Sending NF-es to customersYou can send NF-es (with their corresponding status) from the authorities to your customers (the recipients of goods movements).

InboundYou can use SAP NFE to completely automate the processing of incoming NF-es from your business partners – NF-e receipt, signature

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 4 of 174

validation, and authorization check, to invoice creation in the back-end system. You can access this capability through the NF-e FiscalWorkplace and the NF-e Logistics Workplace. You can find incoming NF-es, including NF-es and NF-e cancellation notices fromsuppliers, in these workplaces, where you can manually or automatically create and post documents in SAP ERP according to yourbusiness process.Due to the fact that it relies on an integrated approach, SAP NFE is a centralized data store for all messages communicated betweenyour company and the government system, as well as for messages between your company and other companies' systems in B2Bscenarios. It also is the central platform for storing the exchanged files as required by law and provides interfaces for easy access tothese documents.

IntegrationTo raise revenue principally in the form of taxes on goods movements, the Brazilian government has implemented an XML-basedelectronic billing system known as Nota Fiscal Eletrônica, which comprises both business-to-government (B2G) communication as wellas business-to-business (B2B) communication. The government provides the forms and stipulates the rules for electroniccommunication that the majority of companies must use and follow in order to do business in Brazil.SAP’s solution is composed of two deployment units: NFE and the ERP core component. Each of the parts is an independent solution.Both parts complement each other for automation of the integrated end-to-end scenarios. An overview of the NF-e processing is shownin the following diagram:

Overview

More InformationFor more information about NFE business processes and functions in SAP ERP, see Electronic Nota Fiscal (NF-e) in the SAP Libraryunder SAP Solutions SAP ERP SAP ERP Central Component <Release> SAP ERP Central Component Logistics CountryVersions Americas Brazil Cross-Application Components Nota Fiscal .

1.2 Architecture of SAP Nota Fiscal Eletrônica SAP Nota Fiscal Eletrônica (SAP NFE; SAP Electronic Invoicing for Brazil) utilizes different components to meet governmentrequirements, all while enabling a high degree of flexibility to ensure your business benefits. The following graphic shows all thecomponents included in the NFE application-shipment that you need in addition to the business processes in SAP ERP.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 5 of 174

Architecture of SAP Nota Fiscal Eletrônica

SAP Nota Fiscal EletrônicaThe NFE application contains the administration and monitor workplaces for the outbound scenario, and the fiscal and logisticworkplace for the inbound scenario.SAP NetWeaver Process Integration (SAP NetWeaver PI)If you already use SAP NetWeaver PI to communicate between different systems, you can easily implement the additional contentrequired to communicate with the authorities without changing your existing setup. SAP NetWeaver PI offers you all the technologicaland messaging capabilities you need to send NF-es and all other NF-e related messages in a compliant manner (including HTTPSand SOAP).

IntegrationInbound and Outbound IntegrationBased on your existing system landscape, you can connect one or several logistics systems as back-end systems to send and receiveNF-es for SAP NFE, and to use SAP NFE as the central communication platform for your NF-e processes. The back-end systems canbe either SAP ERP or any legacy system that provides the billing data and tax-related information that the authorities require. Theinterface implementation necessary to connect SAP ERP to NFE is part of the standard delivery.

More InformationFor information about the message flow between the different instances of NFE and the authorities, see

Communication Flow for Sending NF-esCommunication Flow for Sending NF-es with Layout 3.10+Communication Flow for Sending CT-es

1.3 Configure SAP Nota Fiscal Eletrônica To configure SAP Nota Fiscal Eletrônica (SAP NFE; SAP Electronic Invoicing for Brazil), you must perform activities in all relevantsoftware components (described in Architecture of SAP Nota Fiscal Eletrônica).This section distinguishes between the general connection settings that are required to connect all systems to one another, and thespecific settings that are required to set up communication and related processes in each of the systems. It is therefore divided into thefollowing subsections:

Setup of System Communication from and to SAP NFE for NF-es and Setup of System Communication from and to SAP NFE for CT-es.This section describes the settings that you need for system connections between the different instances in the communicationprocess for electronic notas fiscais (NF-es).Configuration of NF-e (Outbound), Configuration of CT-e (Outbound), Configuration of NF-e/CT-e (Inbound), and Configuration ofEvents.This section describes the process control settings for outbound and inbound scenarios.Configure SAP NetWeaver PI for NF-e (Outbound) , SAP NW PI Configuration for CT-e (Outbound), and Configure SAP NetWeaver PIfor NF-e/CT-e (Inbound).

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 6 of 174

This section describes the settings for the NFE application in SAP NetWeaver PI. These settings ensure, for example, that youaddress the correct authority system and that you use the correct file format.

IntegrationFor more information about Customizing settings that have to be made in your SAP ERP, see Related Configuration in SAP ERP.

1.3.1 General Settings for SAP Nota Fiscal Eletrônica

ProcedureThe setting Maintain Own Tax Numbers (CNPJ) is found in Customizing under Nota Fiscal Eletrônica General Settings . Youenter your company's tax numbers, as well as an appropriate description.The setting Maintain Version of Message Types is found in Customizing under Nota Fiscal Eletrônica General Settings . Youhave the option of changing the default XML version of the various message types used for communicating with authorities,dependent on the region. The default versions are saved in system table /XNFE/TXMLVERS and apply to all regions.Create an entry for each message type whose version differs from the version delivered in the standard system. To do so, you haveto specify the following:

The XML version used by the authorities (such as 006)The message type in XML (such as SITNFE)The region of the NF-e issuerThe system environment (test or live)The issue type (such as Normal or SCAN)

In the field XML Version, enter the version that you want to use for communicating with the authorities' system.

1.3.2 Configuration of NF-e Outbound

Configuration of NF-e (Outbound)Technical Settings for NF-e OutboundDigital Signature Configuration for NF-e OutboundSetup of System Communication from and to SAP NFE for NF-esActivating Services for UI Display of NF-e Monitors (Outbound)Process Settings and Customizing (Outbound)Settings for NF-e Batch Processing (Outbound)NF-e Batch Job Planning (Outbound)User Roles and Authorizations for NF-e OutboundSAP NetWeaver PI Configuration for NF-e (Outbound)Creating NF-e Configuration Scenarios from Integration Scenarios (Outbound)Integration Scenarios for NF-e Configuration (Outbound)Configuration Object Definition for NF-e Configuration ScenariosNF-e Communication with Authority Systems (Outbound)Communicating with NF-e B2B PartnersCompleting NF-e Configuration Scenario Settings (Outbound)Configuration for NFE on AEX (Java-only PI)NF-e Alert Configuration

1.3.2.1 Configuration of NF-e (Outbound) The core application of SAP Nota Fiscal Eletrônica (SAP NFE) contains the process logic used to communicate with governmentauthorities. For this process, the NFE application links a feeder system such as SAP ERP to SAP NetWeaver Process Integration (SAPNetWeaver PI). You must configure the NFE core application in order to control system behavior and to specify process setup. Thenecessary settings are divided into basic technical settings and process-related settings:

Basic technical settingsBasic technical settings enable you to make decisions about electronic communication with your business partners. For example, youcan include activities such as specify in Customizing how the system responds to different process statuses.Process-related settingsProcess-related settings control batch creation and monitoring options.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 7 of 174

Process1. You define basic technical settings such as the following (see Technical Settings for NF-e (Outbound)):

System environments and storage locations for digital-signature certificatesService status settings, for example, request a frequency or status check for the system environment of a certain region in BrazilStatus codes of the authorities, based on which the system controls follow-up activitiesBusiness partners taking part in the electronic exchange of notas fiscais (NF-es)Number ranges for batches that group notas fiscais eletrônicas (NF-es)Services for user interface displays

2. You define the following process-related settings (see Settings for NF-e Batch Processing in Core Application (Outbound)) accordingto your requirements:

Batch settings, for example, maximum size and time between batch creationMonitoring settings for optimized process observation

3. You plan batch jobs (see NF-e Batch Job Planning) for regular tasks.4. You define user roles and authorizations (see User Roles and Authorizations for NF-e (Outbound)) by tax number.

1.3.2.1.1 Technical Settings for NF-e Outbound You specify technical settings in order to control system behavior and responses.

FeaturesNumber Range for Batches

Batches that package NF-es require a number range both to identify and to monitor the batches in process. In the batch monitor of thecore application, you can use this number range to access all NF-es that the system has combined into one batch.Use transaction code SNUM to create the number range for the object /XNFE/BAID, and create interval 01 with a length of 15 digits.You must activate the screen display for the monitors by activating the respective services.For more information, see Activating Services for UI Display of NF-e Monitors (Outbound).

1.3.2.1.2 Digital Signature Configuration for NF-e Outbound

Internal SignatureIf you want to use an internal signature in SAP NetWeaver, you must define the following settings:

SSF: Define ApplicationYou receive an overview of existing Secure Store and Forward (SSF) applications and you must create entries for each of your taxnumbers.SSF:Trust ManagerFor each SSF application, you must import the certificates that you have purchased from the authorities. This is done in the TrustManager.Configure System Response by Tax NumberMaintain the name of the SSF application for each CNPJ where you saved the purchased certificates that you must use to sign theNF-es.

For more information, see NF-e/CT-e Administrator.

External SignatureTo carry out an external signature creation, you must implement the Business Add-In BAdI: Sign Outbound NF-es, in Customizing under

Nota Fiscal Eletrônica Outbound Business Add-Ins for Outbound NF-es .Configure System Response by Tax NumberMaintain the Keystore view and Keystore element for each CNPJ in the same location where you saved the certificate that youpurchased from the authorities and that you use to sign the NF-es. This information is a parameter of the BAdI interface.

For more information, see NF-e/CT-e Administrator.

1.3.2.1.3 Setup of System Communication from and to SAPNFE for NF-es

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 8 of 174

The communication process with SAP Nota Fiscal Eletronica (SAP NFE) is triggered by the feeder system SAP ERP. It is thenprocessed in SAP NFE, and uses SAP NetWeaver Process Integration (SAP NetWeaver PI) as the communication engine tocommunicate with the authorities and business partners through specific Process Integration (PI) content for SAP NFE. To set up thecommunication process, you must define the system connection between the different instances.

The setup of the system connection from SAP NetWeaver PI to the necessary systems is part of the configuration process in SAPNetWeaver PI. For more information, see the specific descriptions in SAP NetWeaver PI Configuration for NF-e (Outbound).

PrerequisitesYou have defined and assigned the logical systems in SAP ERP and the core application of SAP NFE. For more information, seeSetting Up Logical Systems in SAP NetWeaver Library under Functional View SAP NetWeaver by Key Capability Security Identity Management .The communication between the feeder system and the SAP NFE application is based on Remote Function Call (RFC) technology.You have defined an RFC user in SAP NFE, each relevant feeder system that you must assign in the system connection setup, andSAP NetWeaver PI.

FeaturesThe following system connections are necessary for the communication process:

From SAP ERP to the core application of SAP NFEThe business process for invoicing in SAP ERP triggers the electronic communication to the authorities by sending the data forelectronic notas fiscais (NF-es) to the core application of SAP NFE. There the system processes the messages according to the legalrequirements. For the transfer of the document data, you must set up the system connection from SAP ERP to the core application ofSAP NFE. Based on your existing system landscape, you can connect one or several logistics systems as feeder systems to thecore application of SAP NFE.

The feeder systems provide the billing data and tax-related information that the authorities require, and can either be SAP ERP orany other legacy system.

From the core application of SAP NFE to SAP ERPYou need to connect SAP NFE to SAP ERP to synchronize the status information you receive from the government. This statusinformation influences the invoicing and follow-on processes, for example, continuing the logistics process based on authorized NF-es, or initiating the contingency process for notas fiscais in SAP ERP. You must set up a connection to each of the feeder systems inyour system landscape that requires status updates after electronic communication with the authorities.From the core application of SAP NFE to SAP NetWeaver PIYou define this system connection to transfer messages between the SAP NFE core application and SAP NetWeaver PI for furtherprocessing. This is a prerequisite for routing the messages to their respective destinations, such as to the authorities' systems, to theWeb service for a digital signature, or to a business partner in business-to-business scenarios.

ActivitiesPerform the following Customizing activities found under Nota Fiscal Eletrônica Communication to ERP Backend System :

From SAP ERP to core application of SAP NFEYou must define the RFC destination for SAP NFE by using transaction code SM59 in the feeder system. This requires the ABAPConnection connection type.In addition to the technical data for the system location, you must enter the logon data for the RFC user that you created in the coreapplication of SAP NFE on the tab page Logon/Security.

From the core application of SAP NFE to SAP ERPYou must define the RFC destination for SAP NFE by using transaction code SM59 in the feeder system. This requires the ABAPConnection connection type.In addition to the technical data for the system location, you must enter the logon data for the RFC user that you created in therelevant SAP ERP system on the tab page Logon/Security.You must also maintain the relationship between the RFC destination and the logical system. You can do this by using transactioncode BD97. Under Standard BAPI destination assign the RFC destination to the logical system.

You can access the Communication to ERP Backend System Customizing activity and respective description by entering SPRO andexecuting the appropriate activity after choosing Nota Fiscal Eletrônica Communication to ERP Backend System .From the core application of SAP NFE to SAP NetWeaver PI

You must define the RFC destination for SAP NFE by using transaction code SM59 in the feeder system. This needs the connectiontype HTTP Connection to ABAP System.In addition to the technical data for the system location, you must enter the logon data for the RFC user that you created in SAPNetWeaver PI on tab page Logon/Security.

1.3.2.1.4 Activating Services for UI Display of NF-e Monitors

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 9 of 174

1.3.2.1.4 Activating Services for UI Display of NF-e Monitors(Outbound) You must activate the relevant UI services for master data maintenance and for monitoring of central messaging.

Procedure1. Enter transaction code SICF and choose Execute.2. Select the following entries in the navigation tree for the Virtual Hosts/Services under default_host sap bc webdynpro xnfe .3. Activate the service for displaying the user interfaces for each of the following entries by using the context menu and selecting

Activate Service.NF-e Layout 2.001. nfe_monitor_new for NF-e Monitor2. batch_monitor_new for NF-e Batch Monitor3. master_batch for Batch Processing Settings4. status_monitor_new for Service Status Monitor5. nfe_monitor_arch for NF-e Monitor for Archived NF-es6. incoming_monitor for Incoming B2B NF-es7. ssf maintenance for SSF maintenanceNF-e Layout 3.10 and Higher1. nfe_outb_monitor for NF-e Monitor2. nfe_batch_monitor for NF-e Batch Monitor3. nfe_servsta_monitor for Service Status Monitor4. nfe_outb_monitor_arch for NF-e Monitor for Archived NF-es5. ssf maintenance for SSF maintenance

4. In addition, you must activate the following basic services in the navigation tree for the Virtual Hosts/Services under default_host sap public bc :1. ur for Unified Rendering2. icons for SAP Icons3. icons_rtl for Icons RTL4. pictograms for Pictograms5. webdynpro for Web Dynpro MIME Handling

1.3.2.1.5 Process Settings and Customizing (Outbound)

ProcedureThe following settings are found in Customizing under Nota Fiscal Eletrônica Outbound .You can access the Customizing activities and the detailed documentation by entering SPRO and executing the appropriate activityafter choosing Nota Fiscal Eletrônica Outbound . The documentation below only offers a brief description of the Customizingactivities, you find the full documentation in the Customizing section of your NFE system.

Settings for all Layout VersionsMaintain System Response for Own Tax NumbersYou use the tax number of your company to define the storage location of the certificate that you must use for digital signatures, andwhether or not you use the productive or test system environment for communication. In this Customizing activity, you configure thesystem behavior and the storage location for your digital signature for each tax number at your company.Define Authority's Status CodeIn this Customizing activity, you define the codes and their descriptions that the authorities can use as answers to an electronicmessage in communication for handling notas fiscais. You receive this list from your responsible tax authorities. Based on thisdefinition, you can see in the application how official code affects the status of the NF-e. The assignment of a code to a cleardescription makes it easier for you to initiate follow-on activities.Maintain Control Parameters for Process FlowIn this activity, you can make the settings for the process steps for further processing of a document (NF-e, CT-e, events). Theprocess steps are derived from the business process that is assigned to the document. The process flow for this business process iscontained in table /XNFE/PROCFLOW. In this activity, you can influence the handling of the process flow, This is possible, dependingon the sender's and/or recipient's CNPJ number in the document. The Control Settings field lets you influence automatic processing ofa process step.Activate B2B Scenarios for Business PartnersIn this Customizing activity, you determine which persons you want to exchange documents with electronically (NF-e and CT-e).Activate B2B Scenarios for Natural PersonsIn this Customizing activity, you determine which natural persons you want to exchange documents with electronically (NF-e and CT-e).

Settings for NF-e Layout 2.00The following settings must be executed if you want to send NF-es with layout 2.00.

NF-e 2.00: Define Query for Service Status of Authority (SEFAZ)In this Customizing activity, you configure the settings that the system needs for the automatic query of system availability for the

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 10 of 174

In this Customizing activity, you configure the settings that the system needs for the automatic query of system availability for theSEFAZ and SCAN systems. You are required to query this status and can control the status query dependent on your batch planningor document volume.

Settings for NF-e Layout 3.10+The following settings must be executed if you want to send NF-es with layout 3.10 or higher.

NF-e: Maintain Connected Government SystemsIn this Customizing activity, you configure the settings that the system needs for deciding to which government system your messagesare to be sent.NF-e: Maintain Version of Message TypesIn this Customizing activity, you determine which XML version is used for individual message types when communicating withauthorities. In Customizing activity NF-e: Define Connected Government Systems, you have defined the government system youwant to communicate with.NF-e: Define Query for Service Status for Authority (SEFAZ)In this Customizing activity, you configure the settings that the system needs for the automatic query of system availability for NF-e ofthe SEFAZ system and the responsible contingency system. You are required to query this status and can control the status querydependent on your batch planning or document volume.NF-e: Maintain Batch ParametersIn this Customizing activity, you define the parameters for collecting NF-es in batches and perform the batch request for each regionused in your company.

These parameters have a high influence on the CPU usage, disk usage, and overall performance of SAP NFE. Therefore, changethe parameters according to your business needs and try to create the batches with the highest NF-e number in an acceptabletime. Be aware that using small values for Max. Collecting Time, Max. Batch Size or Max. Number of NF-es increases the numberof batches. This can provoke processing performance problems. The creation of NF-e batches is also influenced by the way youscheduled the job for the batch report. For more information about batch jobs, see NF-e Batch Job Planning (Outbound).

1.3.2.1.6 Settings for NF-e Batch Processing (Outbound) Brazilian authorities require that NF-es be sent in batches. The system sends other messages (such as for skipping or cancellation)individually. You can define the criteria that the system considers for batch creation and subsequent batch status requests. When thecreation criteria are fulfilled, the system closes the batch and creates a new batch for sending NF-es. The process-related settings helpyou optimize the communication process through batch creation and subsequent monitoring of these batches.For more information, see NF-e/CT-e Administrator.

1.3.2.1.7 NF-e Batch Job Planning (Outbound) You must define batch jobs for communication processes in SAP Nota Fiscal Eletrônica (SAP NFE) that require regular processing.

NF-e Layout 2.00You need batch jobs for the following regular tasks:

For NF-e Layout 2.00 you can use the service status check (technical name: /XNFE/CHECK_SRV_STATUS, only support forSCAN, displayed via the NF-e Service Status Monitor (Outbound) for Layout 2.00), or the new service status check (technical name:/XNFE/NFE_CHECK_SRV_STATUS, support for SCAN and SVC, displayed via the NF-e Service Status Monitor (Outbound) forLayout 3.10+.You are required to periodically check the availability of the government systems that host the web services for filing your NF-es orrelated messages. You have defined the time intervals for sending the status requests to the authorities in Customizing under NotaFiscal Eletrônica General Settings Maintain Own Tax Numbers (CNPJ) . (For more information, see Technical Settings for NF-eOutbound). It is possible to schedule the Service Status Check job for all regions at once, or for various regions (one or severalregions). In order to check different regions, you create variants for the existing regions and schedule them separately in different timeintervals. No overlapping of intervals of regions is allowed. Overlapping intervals could lead to a cancellation of the current job run.During this job, the system sends the service status requests to the relevant regional systems based on the interval you set inCustomizing and during job scheduling.

In Customizing, define the period values for your batch job according to the region with the shortest time interval requirement forstatus requests.

Sending NF-e Batch and NF-e Batch Status Request (technical name: /XNFE/PROCESS_REPORTS)

Note

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 11 of 174

This report never stops, and therefore blocks one batch process.

Even though this report is programmed to run continuously, we recommend to schedule the background job in intervals of 30 minutes.In case of a system shutdown, restart, or system dump, the program restarts automatically. You can stop the batch job by usingtransaction code SM50 only.This report starts the following processes:

Sending the batch with packaged NF-esSending the batch status request for the NF-e statuses that the authorities set for each NF-e.Optional: Collecting acknowledgments from SAP NetWeaver Process Integration (SAP NetWeaver Process Integration)The NFE application collects the technical processing information from SAP NetWeaver Process Integration that allows you to usethe NFE application as a single point of entry for monitoring the communication process with the authorities.

For the best possible performance, we strongly recommend to collect the acknowledgments from SAP NetWeaver ProcessIntegration by scheduling the report /XNFE/GET_ACKNOWLEDGMENT in a separate background job. In this case, you candeactivate the Note Acknowledgements checkbox.

Collecting acknowledgments from SAP NetWeaver Process Integration (technical name: /XNFE/GET_ACKNOWLEDGMENT)The NFE application collects the technical processing information from SAP NetWeaver Process Integration that allows you to use theNFE application as a single point of entry for monitoring the communication process with the authorities.Automatic Status Retransmission to ERP (technical name: /XNFE/UPDATE_ERP_STATUS)If SAP ERP cannot process an NF-e status from SAP NFE due to a temporary error – such as a locked document – the NF-e statuswill be sent again according to your scheduling of this job.

NF-e Layout 3.10+You must define batch jobs for communication processes in SAP Nota Fiscal Eletrônica (SAP NFE) that require regular processing. Youneed batch jobs for the following periodic tasks:

To collect and send NF-e batches to the authorities (technical name /XNFE/NFE_BATCH_PROCESS,/XNFE/NFE_BATCH_CREATE, /XNFE/NFE_BATCH_REQUEST): Report XNFE/NFE_BATCH_CREATE creates batches andsends these batches to authorities. Report /XNFE/NFE_BATCH_REQUEST requests the batch status at the authorities. Report/XNFE/NFE_BATCH_PROCESS perform all 3 steps together.

There are two ways to schedule the jobs for sending batches to authorities. One is to just schedule report/XNFE/NFE_BATCH_PROCESS. The other is to schedule report /XNFE/NFE_BATCH_CREATE and/XNFE/NFE_BATCH_REQUEST in parallel. This can speed up batch processing for scenarios where many NF-es created in avery short time period.All three reports provide the selection parameter to run the report in an endless loop. When using this parameter, you can set thewaiting time between each loop via parameter “Wait Time Until Next Call”

If you schedule the reports for collecting NF-es into batches and sending batches and for requesting batches to run continuouslythey use one batch process each.

Even if you decided to run the reports continuously, you can schedule these reports to run periodically. In case of a systemshutdown, restart, or system dump, the reports restart automatically.If you schedule the reports to run continuously you can stop the batch jobs by using transaction code SM50.

Send Skipping requests to the authorities (technical name: /XNFE/NFE_SKIP_SEND): this report collects all skipping requests, whichare ready for sending and send them to authority. It can be scheduled for different selection parameters (Code of Brazilian State(CUF), CNPJ of Issuer, System Environment and Issuing Type). If you use the provided selection parameters, make sure that youschedule a job for all combinations that can occur in your company.Send NF-es to B2B Partner (technical name: /XNFE/NFE_B2B_SEND): this report collects all NF-es, which are ready for sendingand send them to B2B Partner. It can be scheduled for different selection parameters (CNPJ of Recipient, CNPJ of Transporter). If youuse the provided selection parameters, make sure that you schedule a job for all combinations that can occur in your company.Service Status Check (technical name: /XNFE/NFE_CHECK_SRV_STATUS): you are required to periodically check the availabilityof the government systems that host the Web services for filing your NF-es or related messages. It is possible to schedule theService Status Check job for all regions at once, or for various regions (one or several regions). In order to check different regions,you create variants for the existing regions and schedule them separately in different time intervals. No overlapping of intervals ofregions is allowed. Overlapping intervals could lead to a cancellation of the current job run.You are required to periodically check the availability of the government systems that host the web services for filing your NF-es orrelated messages. You have defined the time intervals for sending the status requests to the authorities in Customizing under NotaFiscal Eletrônica General Settings Maintain Own Tax Numbers (CNPJ) . (For more information, see Technical Settings for NF-eOutbound). It is possible to schedule the Service Status Check job for all regions at once, or for various regions (one or severalregions). In order to check different regions, you create variants for the existing regions and schedule them separately in different timeintervals. No overlapping of intervals of regions is allowed. Overlapping intervals could lead to a cancellation of the current job run.During this job, the system sends the service status requests to the relevant regional systems based on the interval you set inCustomizing and during job scheduling.

In Customizing, define the period values for your batch job according to the region with the shortest time interval requirement forstatus requests.

Caution

Caution

Caution

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 12 of 174

Restart all failed NF-es (technical name: /XNFE/NFE_CONTINUE_PROCESS): this report collects all failed NF-es with a temporaryerror and tries resend them. This situation can occur during transferring the status information to the backend system, thenautomatically resend is needed.Collecting acknowledgments from SAP NetWeaver Process Integration (technical name: /XNFE/GET_ACKNOWLEDGMENT): theNFE application collects the technical processing information from SAP NetWeaver Process Integration that allows you to use theNFE application as a single point of entry for monitoring the communication process with the authorities.

In case sending NF-e Batch and NF-e Batch Status Request still occurs via the report /XNFE/PROCESS_REPORTS. We stronglyrecommend collecting the acknowledgments from SAP NetWeaver Process Integration by scheduling the report/XNFE/GET_ACKNOWLEDGMENT in a separate background job. In this case, you can deactivate the Note Acknowledgementscheckbox.

ActivitiesFor creating a batch job, use transaction code SM36. Define the parameters for the period. To schedule the tasks separately use thefollowing reports:/XNFE/NFE_BATCH_PROCESS (or XNFE/NFE_BATCH_CREATE and /XNFE/NFE_BATCH_REQUEST)/XNFE/NFE_SKIP_SEND/XNFE/NFE_B2B_SEND/XNFE/NFE_CHECK_SRV_STATUS/XNFE/NFE_CONTINUE_PROCESS/XNFE/GET_ACKNOWLEDGMENT

1.3.2.1.8 User Roles and Authorizations for NF-e (Outbound) The core application in SAP Nota Fiscal Eletrônica (SAP NFE) contains the following roles with their relevant authorization objects. Youcan copy the roles as templates and assign them to users according to your company's needs.User Roles/XNFE/WP_NFE_OUT_MONITORThis role is does not contain authorizations and is therefore only meant to create and set up the user menu for the NF-e OutboundMonitor. You can copy this role to adjust the user menu according to your requirements. This role can be combined with other roles ina composite role./XNFE/WP_NFE_ADMINThis role is intended for the NFE Administrator. It does not contain authorizations and is therefore only meant to create and set up theuser menu. You can copy this role to adjust the user menu according to your requirements. This role can be combined with other rolesin a composite role.

AuthorizationsFor information concerning authorizations, refer to the security guide of SAP Nota Fiscal Eletrônica (http://help.sap.com/nfe).

1.3.2.2 SAP NetWeaver PI Configuration for NF-e (Outbound) SAP NetWeaver Process Integration (SAP NetWeaver PI) serves as middleware that routes messages between SAP NFEcomponents, government authorities, and business partners. It also changes to SOAP when communicating with the authorities, or wheninteracting with any other protocol used for business-to-business communication. When messages must be adapted, SAP NetWeaverPI also provides the bridging through integration processes in cross-component business process management that function likeworkflows, for example:

Switching from asynchronous mode used between the SAP NFE core application and SAP NetWeaver PI to synchronous messagetransfer, which is used to communicate between SAP NetWeaver PI and the authorities.Multimapping for message merges that the system must perform for correct record-keeping in the SAP NFE core application. Thesystem performs message merges, for example, to combine an NF-e sent to the authorities with the authorities' response containingthe planned time when the NF-e status will be available. SAP NetWeaver PI sends the compiled information in one message to thecore application.

PrerequisitesYou must maintain the system and component information in the system landscape directory (SLD).You must install Java Web Start before you can use the Integration Builder for configuration activities in SAP NetWeaver PI.

The settings below are described to assist a trained SAP NetWeaver PI consultant with the necessary configuration activities.

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 13 of 174

ProcessFor configuring SAP NetWeaver PI for SAP NFE, you can use the following general steps for an inside-out approach. This will allow youto easily complete your configuration scenarios based on pre-defined configuration objects.1. Create configuration scenarios in the Integration Directory based on the integration scenarios from theIIntegration Repository. The

integration scenarios group all possible entities for a specific communication situation based on government requirements. (SeeCreating NF-e Configuration Scenarios from Integration Scenarios (Outbound))

2. Define configuration objects that can be reused across different integration scenarios. (See Configuration Object Definition for NF-eConfiguration Scenarios (Outbound)).Configuration objects include communication partners and communication channels to those partners. By defining these objects atthe beginning, you can increase the efficiency of the scenario configuration.

3. Complete the scenario configuration by assigning centrally-defined settings and defining specific parameters. (See Completing NF-eConfiguration Scenario Settings (Outbound).

4. Configure the alerts that SAP NetWeaver PI provides if you want the system to notify responsible persons about communicationfailures. (See NF-e Alert Configuration).

You should obtain a copy of the Brazilian authorities’ Taxpayers' Integration Guide, which contains the official technical standardsand requirements for electronic communication. The guide also lists the URLs of the Web services for the individual regions to whichyou need to connect using SAP NetWeaver PI.

More InformationEach outbound message needs to be signed using a government-issued certificate with a private key. SAP NFE includes the signatureservice in the message handling of SAP NetWeaver PI. For more information, see Digital Signature Configuration for NF-e Outbound.

1.3.2.2.1 Creating NF-e Configuration Scenarios fromIntegration Scenarios (Outbound) You can use the delivered integration scenarios as templates for your configuration scenarios to ensure a complete configuration ofyour communication with the authorities. For more information about the available integration scenarios and their dependencies, seeIntegration Scenarios for NF-e Configuration (Outbound).

Creating the configuration scenarios first helps familiarize you with the NF-e naming conventions that you can use when you createconfiguration objects. This ensures that naming is consistent.

Procedure1. In your SAP NetWeaver Process Integration (SAP NetWeaver PI) system, enter SXMB_IFR to start the Exchange Infrastructure tools

to set up configuration scenarios.2. Open Integration Builder: Configuration by choosing Integration Directory.3. In the menu bar, choose Tools Transfer Integration Scenario from the Integration Repository . Taking into account the software

component version of SAP NFE that you have installed, create a configuration scenario for each integration scenario.1. The input help for the integration scenario names lists all available scenarios from that you can select. After making the selection,

choose Ok.2. Choose Continue to create the configuration scenario based on the delivered integration scenario and adapt the name to your

needs.

Use a prefix when copying the integration scenarios as templates for your configuration project. Although the system sorts theintegration scenarios in the Integration Builder design environment by software component, it sorts the configuration scenariosalphabetically. You can group all SAP NFE configuration scenarios in the configuration environment by using the same prefix.

4. To save the configuration scenarios, choose Finish.

Recommendation

Note

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 14 of 174

1.3.2.2.1.1 Integration Scenarios for NF-e Configuration(Outbound) To support you in implementing SAP NFE, SAP NetWeaver PI contains integration scenarios that group all dependent objects of acommunication process. You can use these integration scenarios to complete configure electronic communication during theimplementation process.All integration scenarios are defined in the development namespace for a specific version of a government system. They use objectsfrom this system version namespace as well as from the common namespace. The common namespace groups all objects such asstructures or mappings that are not dependent on a government system.

Be aware that you have to configure every integration scenario individually for every NF-e layout version that you need. Forexample, if you use the BATCH_WebAS_Outbound_Batch integration to send NF-e batches in layout 2.00 and now want to sendNF-e batches in layout 3.10 or higher, you also have to configure the BATCH_WebAS_Outbound_Batch integration scenario forNF-e layout 3.10 or higher.

The technical names in SAP NetWeaver PI for SAP Nota Fiscal Eletrônica refer to the core application as WebAS.

Integration Scenarios for NF-e Layout 2.00From Namespace: http://sap.com/xi/NFE/006. The following integration scenarios are part of SAP NetWeaver PI contentdelivery for SAP NFE:BATCH_WebAS_Outbound_BatchThis integration scenario contains all objects relevant to configuring the batch sending of signed NF-es to the authorities.BATSR_WebAS_Outbound_BatchStatusRequestThis integration scenario contains all objects relevant to configuring the collection of NF-e statuses from the authorities This occursafter the expiration of the time period that you received from the authorities in the above integration scenario. The logistics processcan only continue after receiving this message with an authorizing status code from the authorities.NFESC_WebAS_Outbound_NFeStatusCheckThis integration scenario contains the objects relevant to configuring the retrieval of status information about a NF-e from theauthorities. This scenario is necessary for checking the status of all NF-es sent to the authorities in batches for which you cannotretrieve the status information with the batch status check. The government is required to keep NF-e statuses only for a specificperiod. If you cannot collect the status due to system downtime, you must request the NF-e status for each NF-e individually by usingthis integration scenario. You also need this scenario to check the status of NF-es that you receive from your business partners.NTB2B_WebAS_Outbound_B2B_NFeThis integration scenario contains the objects relevant to configuring the sending of NF-es to defined business partners. There are twoviews available in the integration scenario:NTB2B_WebAS_Outbound_B2B_NFe_NamespaceEnhancedNTB2B_WebAS_Outbound_B2B_NFe

We recommend to use NTB2B_WebAS_Outbound_B2B_NFe_NamespaceEnhanced. The viewNTB2B_WebAS_Outbound_B2B_NFe should no longer be used.SKIPR_WebAS_Outbound_SkippingRequestBrazilian authorities require that NF-es be numbered in consecutive order. After an NF-e is rejected, the number of this NF-e is usedup and cannot be used again. Whenever an NF-e is rejected, you must inform the authorities about the gap in the sequence bysending a request to skip the used number. This integration scenario contains all objects relevant to configuring the sending a skippingrequest to the authorities and the receipt of the authorities’ response.SRVSC_WebAS_Outbound_ServiceStatusCheckThis integration scenario contains all objects relevant to configuring the checking of the availability of the authorities' system at aspecific interval. Every company is required to regularly check government system availability.ETB2B_WebAS_Outbound_B2B_EventThis integration scenario contains all objects relevant to configuring the sending of authorized events to B2B partners.EFB2B_WebAS_Inbound_B2B_EventThis integration scenario contains all objects relevant to configuring the receiving of events from B2B partners.EVENT_WebAS_Outbound_EventReceiptThis integration scenario contains all objects relevant to configuring the sending of event requests to the authorities and the receipt ofthe authorities’ response to those requests. This scenario is used for the issuing of a CCe.EVENT_CANCR_WebAS_Outbound_EventCancellationRequestThis integration scenario contains all objects relevant for configuring the sending of cancellation requests in the form of events to theauthorities and the receipt of the authorities’ response to those requests.EVENT_OPPRG_WebAS_Outbound_EventOperationProgressRequestThis integration scenario contains all objects relevant for configuring the sending of event requests from the operation progress group,such as the Operation Confirmation event to the authorities and the receipt of the authorities’ response to these requests.

Integration Scenarios for NF-e Layout 3.10 and HigherFrom Namespace: http://sap.com/xi/NFE/008. The following integration scenarios are part of SAP NetWeaver PI contentdelivery for SAP NFE:BATCH_WebAS_Outbound_Batch

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 15 of 174

This integration scenario contains all objects relevant to configuring the batch sending of signed NF-es to the authorities.BATSR_WebAS_Outbound_BatchStatusRequestThis integration scenario contains all objects relevant to configuring the collection of NF-e statuses from the authorities This occursafter the expiration of the time period that you received from the authorities in the above integration scenario. The logistics processcan only continue after receiving this message with an authorizing status code from the authorities.NFESC_WebAS_Outbound_NFeStatusCheckThis integration scenario contains the objects relevant to configuring the retrieval of status information about a NF-e from theauthorities. This scenario is necessary for checking the status of all NF-es sent to the authorities in batches for which you cannotretrieve the status information with the batch status check. The government is required to keep NF-e statuses only for a specificperiod. If you cannot collect the status due to system downtime, you must request the NF-e status for each NF-e individually by usingthis integration scenario. You also need this scenario to check the status of NF-es that you receive from your business partners.NTB2B_WebAS_Outbound_B2B_NFeThis integration scenario contains the objects relevant to configuring the sending of NF-es to defined business partners. There are twoviews available in the integration scenario:NTB2B_WebAS_Outbound_B2B_NFe_NamespaceEnhancedNTB2B_WebAS_Outbound_B2B_NFe

We recommend to use NTB2B_WebAS_Outbound_B2B_NFe_NamespaceEnhanced. The viewNTB2B_WebAS_Outbound_B2B_NFe should no longer be used.SKIPR_WebAS_Outbound_SkippingRequestBrazilian authorities require that NF-es be numbered in consecutive order. After an NF-e is rejected, the number of this NF-e is usedup and cannot be used again. Whenever an NF-e is rejected, you must inform the authorities about the gap in the sequence bysending a request to skip the used number. This integration scenario contains all objects relevant to configuring the sending a skippingrequest to the authorities and the receipt of the authorities’ response.SRVSC_WebAS_Outbound_ServiceStatusCheckThis integration scenario contains all objects relevant to configuring the checking of the availability of the authorities' system at aspecific interval. Every company is required to regularly check government system availability.ETB2B_WebAS_Outbound_B2B_EventThis integration scenario contains all objects relevant to configuring the sending of authorized events to B2B partners.EFB2B_WebAS_Inbound_B2B_EventThis integration scenario contains all objects relevant to configuring the receiving of events from B2B partners.EVENT_WebAS_Outbound_EventReceiptThis integration scenario contains all objects relevant for configuring the sending of events to the authorities and the receipt of theauthorities’ response for these requests. Examples for NF-e events are the cancellation request or the correction letter.

Scenarios in the Communication Process for Sending NF-es to the Authorities

StructureYou can identify the dependent objects of an integration scenario by checking the first five digits in the technical name. If you use theintegration scenarios as templates for your configuration scenarios, the objects are already grouped. Adhere to the naming conventionswhen creating objects to keep consistent object names.The list below contains examples of the naming conventions:BATCH, BATSRObjects starting with BAT always belong to scenarios for communicating with the authorities about batched NF-es.BATCH: The objects with the BATCH prefix are for sending NF-es to the authorities in batches.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 16 of 174

BATSR: The characters SR stand for status request, in which your system collects the status from the authorities' system for all NF-e sent with a certain batch.

CANCR, CTB2B: All objects starting with C are used in cancellation scenarios.CANCR: Without any further identification in the name, this is a cancellation request for a regular NF-e to the authoritiesCTB2B: The additional specification within the name refers to a B2B scenario. This is a cancellation sent to a business partner..

NTB2BSimilar to the explanations above, objects starting with these prefixes are also used in the B2B scenarios. NTB2B is for sending a NF-e to the business partner.NFESCObjects that begin with this prefix are necessary in specific NF-e communication processes.You need these objects to check the status of all NF-es sent to the authorities in batches for which you cannot retrieve the statusinformation with the batch status check. You also need these objects in a B2B scenario to check the current status in the authorities'system of a NF-e or a cancellation that you received from a business partner before. The last two characters SC stand for statuscheck.SKIPRObjects with this prefix depend on the skipping scenario, represented by SKIP for skipping and R for request.SRVSCThis prefix stands for service (SRV) status (S) check (C) and combines all objects that the system needs to check the authorities'system availability.EVENTThe prefix E is used in Event scenarios, the main scenario using the word EVENT itself.ETB2BThe prefix E is used in Event scenarios, T stands for TO, B2B means B2B partner.

ExampleThe integration scenario BATSR_WebAS_Outbound_BatchStatusRequest for the batch status request, represented by theprefix BATSR, contains the following dependent objects:

Integration Scenario: BATSR_WebAS_Outbound_BatchStatusRequestIntegration Process: BATSR_BatchStatusRequestProcessInterface: BATSR_nfeRetRecepcao_SYNCAction: BATSR_SendBatchStatusRequest

1.3.2.2.2 Configuration Object Definition for NF-e ConfigurationScenarios (Outbound) You need to use generic objects that are specific to your system landscape and company on multiple occasions in the configurationscenarios. You can define these objects centrally to reuse them when completing the individual configuration scenarios during the nextstep.

FeaturesYou can centrally define the following generic objects (grouped by object type):

Communication PartnersA wizard leads you through the process of creating communication partners as configuration objects. You must specify the connectionparameters, such as target URLs. Required entries include:

Your company as internal partyFor your own company, you must define a business service without a communication channel. This entry is mandatory, although itremains empty.Government systemsYou must create a separate partner entry for each regional authority because of their distributed responsibilities and associatedsystem information. You can define the conditions for determining the recipient within a specific configuration scenario, SAPNetWeaver Process Integration (SAP NetWeaver PI) then determines the correct recipient by analyzing the payload in the XMLs sentby the NFE core application.

If the authorities of a region provide communication with different system environments that you want to use, you must create twodifferent Business Services: one for the productive system environment and the other for the homologation (test) environment forthe communication partner representing that regional authority.For each configuration scenario representing an interface to the authorities in a specific process, the authorities use a special Webservice to respond to requests. Web services can differ between different regions. For each available Web service, you mustcreate a Communication Channel as a SOAP receiver channel within a business service for a region.

Business partners for business-to-business (B2B) scenariosYou must create a partner entry for each business partner with which you agree to exchange NF-es and NF-e cancellation notices.

You must create separate Business Services if you want to send NF-es to a business partner.You must create separate Communication Channels for sending NF-es and for sending cancellation notices.The adapter type for your communication channels depends on the agreement with your business partners, for example, FTP orother file adapter.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 17 of 174

Services Without PartiesYou must define a service for internal communication with each component within the delivery of SAP NFE so that SAP NetWeaver PIcan connect to these components in the communication process. This involves the following::

Assignment of Business System to NFE core applicationYou must assign the system on which your core application runs. The system administrator for SAP NetWeaver PI maintains thesystem information in the system landscape directory (SLD) at the beginning of your configuration project.

You must create a receiver Communication Channel for the adapter type PI adapter that uses the ABAP proxies.The communication channel of the PI adapter type for the sender is implicitly defined, and thus requires no configuration action.

Creation of Integration ProcessesAn integration process is required for each bridging activity within SAP NetWeaver PI, for example, when the system changes anasynchronous communication from the NFE core application to SAP NetWeaver PI to a synchronous one for communicating with theauthorities. The delivery of SAP NFE contains all required integration processes. You can reuse these scenarios by selecting theintegration process from the repository list in the creation wizard.

ActivitiesTo open the Integration Directory in the Integration Builder for Configuration, follow the instructions under Creating NF-e ConfigurationScenarios from Integration Scenarios (Outbound).In the navigation section, you can choose the Objects tab page to assign or create the required objects and use the wizardsprovided.

1.3.2.2.2.1 NF-e Communication with Authority Systems(Outbound)

ProcedureConfiguration scenarios with prefixes BATCH, BATSR, CANCR, EVENT, NFESC, SKIPR, and SRVSC connect to authority systems.They require special settings in the SOAP communication channels, per the the steps outlined below:1. Enter the URLs of authority systems, which can be found on the SEFAZ Web site.2. Import certificates into the J2EE keystore.

To import certificates for client authentication in the SOAP adapter configuration, refer to SAP NetWeaver J2EE documentation.

You should import the certificate, including the CA chain, as one single PFX file as described in SAP Note 1524196.

3. Enable certificate-based authentication and select your relevant certificate (Keystore View / Keystore Entry). For more informationabout the import of certificates into the keystore, refer to NF-e/CT-e Administrator.

4. The entries in SOAP action field must correspond to the release version of the authorities' Web services.5. Enable Do Not Use SOAP Envelope under Conversion Parameters due to the fact that the SOAP Envelope is created during the

mapping process.6. In the tabstrip of the module of the communication channels add the following Local Enterprise Bean for all SOAP communication

channels connected to SEFAZ systems twice: localejbs/AF_Modules/MessageTransformBeanThis bean has to be the first and the last entry in your processing sequence. Please choose a self-defined module key for each entry.

Set the first module key to:Parameter Name: Transform.ContentTypeParameter Value: application/soap+xml; charset=utf-8Set the last module key to:Parameter Name: Transform.ContentTypeParameter Value: text/xml; charset=utf-8

A template called GOV_006_SOAP_RCV_TMPL is provided with the PI content of this release for your reference.

1.3.2.2.2.2 Communicating with NF-e B2B Partners

Procedure

The technical names in SAP NetWeaver Process Integration (SAP NetWeaver PI) refer to the core application of SAP Nota FiscalEletrônica (SAP NFE) as WebAS.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 18 of 174

SAP NetWeaver PI offers an array of possibilities for communicating with B2B partners. A new, more flexible configuration approach forthe NTB2B_WebAS_Outbound_B2B_NFe and the CTB2B_WebAS_Outbound_B2B_Cancellation integration scenarios hasbeen implemented.The NTB2B_WebAS_Outbound_B2B_NFe scenario offers two options to configure your partner communication:

Option 1 (recommended): This scenario verifies that the government namespace will be used on the NF-e tag level.Option 2 (for customer-specific developments): This scenario is for customer-specific developments. The government namespace willnot be verified on the NFe tag level.

The SAP NFE system populates the receiver service in the XI message header with the CNPJ code (pattern CNPJ <cnpjcode> ) ofyour business partner (buyer or carrier). This additional information gives you several options to configure the receiver determination inyour PI system:

You can use the predefined Service as Identifier: This straightforward approach uses the Integration Scenario Configurator. Createone generic party or a several parties for your B2B partners and use their respective CNPJs to determine the receiver service. In thereceiver determination, set Service to Receiver Service.

In the generated receiver determinations, the Party and Service fields under Receiver must be set as * (asterisk).

The receiver determination now contains your own defined Party object, but also accepts the Receiver Service already populatedfrom the SAP NFE WebAS. Create the interface determinations and corresponding Receiver Agreements for each receiver todetermine the communication direction within the relevant communication channel.You can use extended receiver determination to translate the receiver-service-CNPJ into specific partners: If you already createdyour B2B partners in XI and want to re-use them, message mapping reads the Receiver parameter from the message headers. Youcan then use a value mapping of your choice to match the CNPJ numbers with your target B2B partners. Receiver determinations areno longer necessary, and you can re-use existing Interface Determinations and Receiver Agreements. The approach described inSAP Note 1525562 (with minor enhancements) can be applied to this scenario.You can use generic receivers: You can use the receiver-service-CNPJs to determine the mail address by using the SAP PI LookupAPI and the Dynamic Adapter Configuration. ,You can also implement the Business Add-In /XNFE/EMAIL_B2B to add the e-mail address in SAP NFE as an attachment to the XImessage. You can extract this e-mail address in your PI system via adapter module (PI 7.0) or Message/Java mapping (PI 7.1 andhigher).

1.3.2.2.3 Completing NF-e Configuration Scenario Settings(Outbound) SAP NetWeaver Process Integration (SAP NetWeaver PI) provides a wizard for configuring scenarios. If you create the configurationobjects before you start configuring the scenarios, you can avoid inconsistent settings, and you can assign these configuration objects indifferent scenarios, while only defining them once. If you create configuration scenarios based on the delivered integration scenarios,you can easily complete the configuration process.

PrerequisitesYou must have already created configuration scenarios (see Creating NF-e Configuration Scenarios from Integration Scenarios(Outbound)) and defined configuration objects (see Configuration Object Definition for NF-e Configuration Scenarios (Outbound)).

Procedure

To use the Integration Builder for configuration, follow the instructions for Creating NF-e Configuration Scenarios from IntegrationScenarios (Outbound)

1. Select a configuration scenario in the navigation structure for scenarios.2. For the selected configuration scenario, choose the icon with the quick info Integration Scenario Configurator from the function menu.3. The system opens a wizard that contains all objects for this scenario. The settings that you defined in a previous step have already

been applied. Follow the instructions of the Integration Scenario Configurator, which leads you through the configuration process.The component view for each configuration scenario provides an overview of the involved business partners and objects that youmust consider in the configuration steps.1. Choose Assign Services.

You can navigate between the different settings by switching between the relevant parties. To do so, use the forward and backarrows with the quick info links Next Role or Previous Role.You can use the different tab pages for each object assigned to one role. If you need to involve a business partner, the authorities,or a particular Web service for the digital signature, for example, you can assign the services that you defined in a previous step.

2. Choose Configure Connections and define or assign the relevant settings by navigating between the relevant parties and objectsusing the arrows or the tab pages.

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 19 of 174

Because of government requirements for electronic messages, SAP NetWeaver PI content for SAP NFE uses the authorities’XML schema names for the message interfaces, and adds only control data.

3. Choose Generate. The system creates all dependent entries for the configuration scenario based on the template information inthe integration scenario.

4. To ensure that messages are routed to the correct target, you must configure content-based routing for all Receiver Determinationsin government processes, for example, in the configuration scenario NFE_NFESC_WebAS_Outbound_NFeStatusCheck. Youconfigure this routing by defining conditions (the values in specific XML fields) for each recipient government system.tpAmb = 2 indicates a homologation systemtpAmb = 1 indicates a productive system

The cUF field in the XML payload contains the state number. The tpEmis field determines the issuing type to indicate if acontingency environment is used. For SVC, check technical note 2013/007 to find the relevant SVC server for your state:tpEmis Authorization1 SEFAZ (normal operation)2 SEFAZ (Contingency, FS)3 SCAN (Sefaz Contingência Ambiente Nacional)4 SEFAZ (DPEC)5 SEFAZ (Contingency, FS-DA)6 SVC-AN (Sefaz Virtual de Contingência Ambiente Nacional)7 SVC-RS (Sefaz Virtual de Contingência Rio Grande do Sul)

Using the combination of the cUF entry and tpAmb and tpEmis, the system can identify the correct receiving government systemand your routing rules have to ensure that, for example, the following targets are reached:tpEmis cUF tpAmb Target1 43 1 RS Production1 35 2 SP Homologation3 any 2 SCAN Homologation6 any 1 SVC-AN Production7 any 2 SVC-RS Homologation

Remember that the contingency event service for the cancellation event is always available for the NF-e authorized in thecontingency system. However, other events, such as CC-e, are not available.The configuration of SVC is not possible for the SKIPR_WebAS_Outbound_SkippingRequest scenario. The skippingrequest of an unused NF-e has to be transferred to a SEFAZ system.

5. You can check your settings for a configuration scenario by choosing Tools Test Configuration in the menu bar.

1.3.4.2.4 Configuration for NFE on AEX (Java-only PI) With the release of SAP NetWeaver Process Integration (PI) 7.31, it is possible to run the system as an AEX (Advanced Adapter EngineExtended /Java-only / single stack) installation. To configure the PI content of SAP NFE on such an installation, you have to use theintegration scenarios containing the infix AEX. The other scenarios can contain ccBPM processes that are not supported on a singlestack installation since they are based on ABAP.The configuration matches with the approach described in the previous sections. The following additional steps have to be carried out:

For a more detailed overview, see SAP Note 1743455.

Process1. NWA Destination Configuration in PI

Open NWA ( http://<host>:<port>/nwa Configuration Infrastructure Destinations ) and maintain the HTTP destinationGRC_NFE_WAS with the following URL:http://<host>:<port>//sap/xi/engine?type=entry&sap-client=<client>&sap-language=ENReplace host, port and client values with the values of your SAP NFE backend. For the event that you have multiple SAP NFEbackends, you need to define separate destinations (destination name is arbitrary) for every individual backend.

2. Communication Channels in PIWhen the integration scenarios are generated as an Integrated Configuration it is necessary to use the delivered CommunicationChannel templates. These templates contain the adapter modules in the correct order. The adapter modules replace the ccBPMlogic.In the SOAP Sender Channel that receives messages from your SAP NFE system populate the HTTP Destination field of theAcknowledgement Handling Tab with your created Destination in point 1.

3. Post-generation Step in PI

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 20 of 174

After generating the objects, copy the generated Integrated Configuration for the Response message from the authorities (SEFAZ issender) to the SAP NFE sender system of the request message as a virtual receiver of the response message. Delete thegenerated Integrated Configuration without the Virtual Receiver.The B2B scenarios from the SAP NFE system to your B2B partner (NTB2B, ETB2B for NF-e and CTB2B, CancCTB2B for CT-e)have to have a virtual receiver with the asterisk (*), because the receiver is already populated with the CNPJ number in the SAP NFEsystem.

A detailed explanation and examples are provided in SAP Note 1743455.

4. SAP NFE Backend SettingsThe ABAP proxy communication needs to call the AEX (Java-only) directly. This is described in SAP Help under ProcessIntegration Advanced Adapter Engine Extended (AEX) .

1.3.4.2.6 NF-e Alert Configuration For a correct error handling, it is essential to send negative acknowledgments from PI to NFE if a communication problem occurs (Dueto the fact that the outbound scenario relies on asynchronous messages from NFE to PI). For PI double-stack installations, the alertcategory NFE_ALRT_CAT has to be created using transaction ALRTCATDEF (see SAP Note 1741486). This is not required for AEX(Java-only) PI installations.You can also use the alerts function in SAP NetWeaver Process Integration (SAP NetWeaver PI) to send e-mail notifications to theresponsible persons in your company about possible communication problems. The e-mail relays the error status message. You canspecify the e-mail notification recipients for each integration scenario.For more information about configuring alerts in SAP NetWeaver PI, see Alert Configuration in the SAP Library under Functional View SAP NetWeaver by Key Capability Process Integration by Key Capability SAP NetWeaver Exchange Infrastructure Runtime

Central Monitoring .

ActivitiesTo configure alerts, use transaction code ALRTCATDEF and create the alert category NFE_ALRT_CAT.Define your alert rules according to the alert configuration descriptions in SAP Library for SAP NetWeaver PI.

1.3.3 Configuration of CT-e Outbound The core application of SAP Nota Fiscal Eletrônica (SAP NFE) contains the process logic used to communicate with governmentauthorities. For this process, the NFE application links a feeder system such as SAP ERP to SAP NetWeaver Process Integration (SAPNetWeaver PI). You must configure the NFE application to control system behavior and to specify process setup. The necessarysettings are divided into basic technical settings and process-related settings:

Basic technical settingsBasic technical settings enable you to make decisions about electronic communication with your business partners. For example, youcan include activities such as specify in Customizing how the system responds to different process statuses.Process-related settingsProcess-related settings control batch creation and monitoring options.

Process1. You define basic technical settings such as the following (see Process Settings and Customizing for CT-e Outbound:

System environments and storage locations for digital-signature certificatesStatus codes of the authorities, based on which the system controls follow-up activitiesNumber ranges for batches that group CT-esServices for user interface displays

2. You define the following process-related settings (see CT-e Batch Processing in Core Application (Outbound) according to yourrequirements:

Monitoring settings for optimized process observation3. You plan batch jobs (see CT-e Batch Job Planning (Outbound)) for regular tasks.4. You define user roles and authorizations (see User Roles and Authorizations for CT-e (Outbound) by tax number.

More InformationDigital Signature Configuration for CT-e OutboundSetup of System Communication from and to Core Application for CT-eActivating Services for UI Display of CT-e Monitors (Outbound)

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 21 of 174

CT-e ConfigurationSAP NW PI Configuration for CT-e (Outbound)Creating CT-e Configuration Scenarios from Integration ScenariosIntegration Scenarios for CT-e Configuration (Outbound)Configuration Object Definition for CT-e Configuration ScenariosCT-e Communication with Authority Systems (Outbound)Completing CT-e Configuration Scenario Settings (Outbound)Configuration for NFE on AEX (Java-only PI)

1.3.3.1 Process Settings and Customizing for CT-e Outbound You specify technical settings to control system behavior and responses.

FeaturesThe following settings are found in Customizing under Nota Fiscal Eletrônica Outbound .

Maintain System Response for Own Tax Numbers (CNPJ)You use the tax number of your company to define the storage location of the certificate that you must use for digital signatures.

Depending on the responsible region’s ability to support electronic communication, the government can require companies orindustry branches to operate electronic communication in their productive environment. Companies for which the electroniccommunication of notas fiscais is still optional can prepare their infrastructure and processes in an offline test environment tofacilitate switching to electronic communication later on.

CT-e: Maintain Connected Government SystemsIn this Customizing activity, you configure the settings that the system needs for deciding to which government system yourmessages are to be sent.ActivitiesSelect the desired logical system and enter your tax number (CNPJ). Then select the region of the government system you want tocommunicate with, and determine whether you want to use the live system or the test system.CT-e: Maintain Version of Message TypesIn this Customizing activity, you determine which XML version is used for individual message types when communicating withauthorities.RequirementsIn Customizing activity "CT-e: Define Connected Government Systems", you have defined the government system you want tocommunicate with.ActivitiesEnter your logical system and your tax number. A blank tax number is also permitted. To achieve this, you can either delete the taxnumber after selecting the default values, or you can manually enter the logical system. Then select the document type, themessage type, and the desired XML version. To determine the XML version, the system first searches an entry for the respectivetax number. If no such entry is found, the system uses the entry with a blank tax number. If no such entry can be determined, thesystem stops the process and returns the error ("D" - discrepancy; resend from ERP) to the ERP system. The following documenttypes must be defined for each tax number you use:

CTE for CT-eEV2 for CT-e event

Document Type CT-eSending of CT-es requires an XML version for the generic layout (attribute 'versao' in tag "infCte") as well as another version for thetransport mode-dependent layout that was used (attribute 'versaoModal' in tag "infModal". For example, if you want to use the newlayout 2.00 for sending CT-es with transport mode 'rodo', you need to maintain two entries: one for message type 'CTE' and one formessage type 'RODOCTE'.

CTE --> Generic layoutAEREOCTE --> CT-e: Transport mode Air (only relevant from version 2.00 and higher)AQUAVCTE --> CT-e: Transport mode Ship (only relevant from version 2.00 and higher)DUTOCTE --> CT-e: Transport mode Pipeline (only relevant from version 2.00 and higher)FERROVCTE --> CT-e: Transport mode Rail (only relevant from version 2.00 and higher)RODOCTE --> CT-e: Transport mode Road (only relevant from version 2.00 and higher)MULTMODCTE --> CT-e: Transport mode Multimodal (only relevant from version 2.00 and higher)

To send other messages for a CT-e, maintain the XML versions for the following message types:INUTCTE --> SkippingSITCTE --> CT-e status querySTASERVCTE --> Service status query

Document type CT-e EventSending of CT-e events requires an XML version for the generic layout (attribute 'versao' in tag "eventoCte") as well as anotherversion for the event type-dependent layout that was used (attribute 'versaoEvento' in tag detEvento"). For example, if you want touse the new layout 2.00 for sending CT-e events with type 'cancellation', you need to maintain two entries: one for messsage type'EVENTO' and one for message type '110111'.

EVENTO --> Issue Event (only relevant from version 2.00 and higher)

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 22 of 174

110110 --> Correction Letter (only relevant from version 2.00 and higher)110160 --> CT-e Multimodal (only relevant from version 2.00 and higher)110111 --> Cancellation (only relevant from version 2.00 and higher)110113 --> EPEC (only relevant from version 2.00 and higher)

CT-e: Define Query for Service Status for Authority (SEFAZ)In this Customizing activity, you configure the settings that the system needs for the automatic query of system availability for CT-eof the SEFAZ system and the responsible contingency (SVC) system. You are required to query this status and can control thestatus query dependent on your batch planning or document volume. To do so, you can use the following parameters for eachcombination of Brazilian region and system environment: :

Frequency of status query in secondsVersion for XML data for the CT-eTime zoneTesting of the SVC system: The following options are available here ->

SEFAZ has priority, contingency system is also checked: The system availability of the SEFAZ system is tested first; if SEFAZis unavailable, the responsible SVC system is tested. If both systems are available, the CT-es are sent to SEFAZ.SEFAZ has priority, contingency system is not checked: The system availability of the SEFAZ system is tested first; theresponsible SVC system is not tested. If the SEFAZ system is unavailable, the CT-es cannot be sent to the SVC system.Contingency system has priority, SEFAZ is also checked: The system availability of the SVC system is tested first; if the SVCsystem is unavailable, SEFAZ is tested. If both systems are available, the CT-es are sent to the SVC system.

If the status query reports that the system is available, SAP Nota Fiscal Eletronica (SAP NFE) continues the electroniccommunication process. If the system is unavailable, you can continue the process manually in the application monitor.Definition of the responsible SVC system:

43 Rio Grande do Sul (RS, tpemis = 7)35 Sao Paulo (SP, tpemis = 8)

You can access the Customizing activities and their descriptions by entering SPRO and executing the appropriate activity afterchoosing Nota Fiscal Eletrônica Outbound .Other ActivitiesBatches that package CT-es require a number range both to identify and to monitor the batches in process. In the batch monitor of thecore application, you can use this number range to access all CT-es that the system has combined into one batch.Use transaction code SNUM to create the number range for the object /XNFE/CTBT, and create interval 01 with a length of 15 digits.You must activate the screen display for the monitors by activating the respective services.For more information, see Activating Services for UI Display of CT-e Monitors (Outbound).

1.3.3.2 Digital Signature Configuration for CT-e Outbound

Internal SignatureIf you want to use an internal signature in SAP NetWeaver, you must define the following settings:

SSF: Define ApplicationYou receive an overview of existing Secure Store and Forward (SSF) applications and you must create entries for each of your taxnumbers.SSF:Trust ManagerFor each SSF application, you must import the certificates that you have purchased from the authorities. This is done in the TrustManager.Configure System Response by Tax NumberMaintain the name of the SSF application for each CNPJ where you saved the purchased certificates that you must use to sign theCT-es.

For more information, see NF-e/CT-e Administrator.

External SignatureTo carry out an external signature creation, you must implement the Business Add-In BAdI: Sign Outbound NF-es, in Customizing under

Nota Fiscal Eletrônica Outbound Business Add-Ins for Outbound NF-es .Configure System Response by Tax NumberMaintain the Keystore view and Keystore element for each CNPJ in the same location where you saved the certificate that youpurchased from the authorities and that you use to sign the CT-es. This information is a parameter of the BAdI interface.

For more information, see NF-e/Ct-e Administrator.

1.3.3.3 Setup of System Communication from and to SAP NFEfor CT-es The communication process with SAP Nota Fiscal Eletrônica (SAP NFE) is triggered by the feeder system SAP ERP. It is thenprocessed in SAP NFE, and uses SAP NetWeaver Process Integration (SAP NetWeaver PI) as the communication engine to

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 23 of 174

communicate with the authorities and business partners through specific Process Integration (PI) content for SAP NFE. To set up thecommunication process, you must define the system connection between the different instances.

The setup of the system connection from SAP NetWeaver PI to the necessary systems is part of the configuration process in SAPNetWeaver PI. For more information, see the specific descriptions in SAP NW PI Configuration for CT-e (Outbound).

PrerequisitesYou have defined and assigned the logical systems in SAP ERP and the core application of SAP NFE. For more information, seeSetting Up Logical Systems in SAP NetWeaver Library under Functional View SAP NetWeaver by Key Capability Security Identity Management .The communication between the feeder system and the SAP NFE application is based on Remote Function Call (RFC) technology.You have defined an RFC user in SAP NFE, each relevant feeder system that you must assign in the system connection setup, andSAP NetWeaver PI.

FeaturesThe following system connections are necessary for the communication process:

From SAP ERP to the core application of SAP NFEThe business process for invoicing in SAP ERP triggers the electronic communication to the authorities by sending the data for theelectronic fiscal documents (CT-es) to the core application of SAP NFE. There the system processes the messages according to thelegal requirements. For the transfer of the document data, you must set up the system connection from SAP ERP to the coreapplication of SAP NFE. Based on your existing system landscape, you can connect one or several logistics systems as feedersystems to the core application of SAP NFE.

The feeder systems provide the billing data and tax-related information that the authorities require, and can either be SAP ERP orany other legacy system.

From the core application of SAP NFE to SAP ERPYou need to connect SAP NFE to SAP ERP to synchronize the status information you receive from the government. This statusinformation influences the invoicing and follow-on processes, for example, continuing the logistics process based on authorized CT-es, or initiating the contingency process for electronic fiscal documents in SAP ERP. You must set up a connection to each of thefeeder systems in your system landscape that requires status updates after electronic communication with the authorities.From the core application of SAP NFE to SAP NetWeaver PIYou define this system connection to transfer messages between the SAP NFE core application and SAP NetWeaver PI for furtherprocessing. This is a prerequisite for routing the messages to their respective destinations, such as to the authorities' systems, to theWeb service for a digital signature, or to a business partner in business-to-business scenarios.

ActivitiesPerform the following Customizing activities found under Nota Fiscal Eletrônica Communication to ERP Backend System :

From SAP ERP to core application of SAP NFEYou must define the RFC destination for SAP NFE by using transaction code SM59 in the feeder system. This requires the ABAPConnection connection type.In addition to the technical data for the system location, you must enter the logon data for the RFC user that you created in the coreapplication of SAP NFE on the tab page Logon/Security.

From the core application of SAP NFE to SAP ERPYou must define the RFC destination for SAP NFE by using transaction code SM59 in the feeder system. This requires the ABAPConnection connection type.In addition to the technical data for the system location, you must enter the logon data for the RFC user that you created in therelevant SAP ERP system on the tab page Logon/Security.You must also maintain the relationship between the RFC destination and the logical system. You can do this by using transactioncode BD97. Under Standard BAPI destination assign the RFC destination to the logical system.

You can access the Communication to ERP Backend System Customizing activity and respective description by entering SPRO andexecuting the appropriate activity after choosing Nota Fiscal Eletrônica Communication to ERP Backend System .From the core application of SAP NFE to SAP NetWeaver PI

You must define the RFC destination for SAP NFE by using transaction code SM59 in the feeder system. This needs the connectiontype HTTP Connection to ABAP System.In addition to the technical data for the system location, you must enter the logon data for the RFC user that you created in SAPNetWeaver PI on tab page Logon/Security.

1.3.3.4 Activating Services for UI Display of CT-e Monitors(Outbound)

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 24 of 174

You must activate the relevant UI services for master data maintenance and for monitoring of central messaging.

Procedure1. Enter transaction code SICF and choose Execute.2. Select the following entries in the navigation tree for the Virtual Hosts/Services under default_host sap bc webdynpro xnfe .3. Activate the service for displaying the user interfaces for each of the following entries by using the context menu and selecting

Activate Service:cte_monitor for CT-e Monitorcte_monitor_arch for CT-e Monitor for Archived CT-escte_batch_monitor for CT-e Batch Monitorcte_servsta_monitor for CT-e Service Status Monitorssf maintenance for SSF maintenance

4. In addition, you must activate the following basic services in the navigation tree for the Virtual Hosts/Services under default_host sap public bc :ur for Unified Renderingicons for SAP Iconsicons_rtl for Icons RTLpictograms for Pictogramswebdynpro for Web Dynpro MIME Handling

1.3.3.5 CT-e Batch Processing in Core Application (Outbound) Brazilian authorities require that CT-es are sent in batches. The system sends other messages (such as for skipping or cancellation)individually. When the creation criteria are fulfilled, the system closes the batch and creates a new batch for sending CT-es.

1.3.3.6 CT-e Batch Job Planning (Outbound) You must define batch jobs for communication processes in SAP Nota Fiscal Eletrônica (SAP NFE) that require regular processing.

FeaturesYou need batch jobs for the following periodic tasks:

Collect CT-es into batchesSend batches to the authoritiesSend batch status requests to the authoritiesSend Cancellation requests to the authoritiesSend Skipping requests to the authoritiesService Status Check: You are required to periodically check the availability of the government systems that host the Web servicesfor filing your CT-es or related messages.Retransmit all failed communications to ERP.

Every task presents one report that can be scheduled separately. There are two ways to schedule these tasks.1. Schedule one periodic batch job that calls all listed tasks one after another2. Schedule each task (respectively report) separately. For all reports (except report for creating batches), you have the opportunity to

schedule the report for different selection parameters (for example, region, CNPJ code)

If the reports for collecting CT-es into batches, for sending batches and for requesting batches, are scheduled separately, then theyrun continuously and use one batch process each.

Even though these reports are programmed to run continuously, You can schedule these reports to run in intervals. In case of asystem shutdown, restart, or system dump, the reports restart automatically.You can stop the batch jobs by using transaction code SM50.

ActivitiesFor creating a batch job, use transaction code SM36.

Define the parameters for the period.If you want to create a periodic batch job that calls all listed tasks one after another use program /XNFE/CTE_PROCESSIf you want to schedule the tasks separately use the following reports:/XNFE/CTE_BATCH_CREATE

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 25 of 174

/XNFE/CTE_BATCH_SEND/XNFE/CTE_BATCH_REQUEST/XNFE/CTE_CANCEL_SEND/XNFE/CTE_SKIP_SEND/XNFE/CTE_CHECK_SRV_STATUS/XNFE/UPDATE_ERP_STATUS

In report /XNFE/CTE_BATCH_CREATE you can define the maximum collection time per batch via parameter.All reports (except /XNFE/CTE_BATCH_CREATE) can be scheduled for different regions or a different CNPJ code. If you use theprovided selection parameters, make sure that you schedule a job for all combinations that can occur in your company.

You can run the Batch Send and the Batch Request report in parallel. That means you can schedule several jobs for report/XNFE/CTE_BATCH_SEND and /XNFE/CTE_BATCH_REQUEST with the same selection parameters (region and CNPJ code).This can speed up batch processing for scenarios where many CT-es for the same region and with same CNPJ code are created ina very short time period.

1.3.3.7 User Roles and Authorizations for CT-e (Outbound) The core application in SAP Nota Fiscal Eletrônica (SAP NFE) contains the following roles with their relevant authorization objects. Youcan copy the roles as templates and assign them to users according to your company's needs.User Roles/XNFE/WP_NFE_OUT_MONITORThis role is does not contain authorizations and is therefore only meant to create and set up the user menu for the NF-e/CT-eOutbound Monitor. You can copy this role to adjust the user menu according to your requirements. This role can be combined withother roles in a composite role./XNFE/WP_NFE_ADMINThis role is intended for the NFE Administrator. It does not contain authorizations and is therefore only meant to create and set up theuser menu. You can copy this role to adjust the user menu according to your requirements. This role can be combined with other rolesin a composite role.

AuthorizationsFor information concerning authorizations, refer to the security guide of SAP Nota Fiscal Eletrônica (http://help.sap.com/nfe).

1.3.3.8 CT-e Configuration

ProcedureThis section offers information how to configure SAP Nota Fiscal Eletrônica for CT-e usage.Transferring CT-e Data from the Backend: Function Module /XNFE/CTE_CREATEThis RFC function module is called synchronously and accepts data for an individual CT-e, for example, from ERP or TM. If an erroroccurs, the function module returns an error status and one or more error text using a BAPIRET2 table.The function module performs the following actions:

ValidationTransformationSignature checkArchiving on database

The interface offers generic table parameters with the fields Row ID and Sequence Number for regularly used data fragments:Addresses (with additional partner data) IT_CTE_PARTNERTaxesIT_CTE_TAXTexts IT_CTE_TEXTValues IT_CTE_VALUE

These table parameters are referenced by the input parameters via the Row ID of the generic table. If the input value is a table type,then this means that a Row ID can appear multiple times (with successive sequence number) in the generic table.In nested tables, a reference (in the superordinate table) points to the Row ID of the subordinate table, which can also appear multipletimes (with successive sequence number)In the structure parameterIS_CTE_PARTNER_IDS, references to the generic partner table are collected that are not of characteristictable type.The structure parameter IS_CTE_HEADER contains the following fields:VERSION (The version of the interface for every incompatible change of the XML version of SEFAZ. The value of the current version

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 26 of 174

is 0001 and is valid for XML version 1.04b. This value of the version correlates not necessarily with an XML version. Interface version0001 is possibly valid for several XML versions (for example 1.04b and 1.05a).)DOCNUM (CT-e document number)ACCESSKEY (44-digit access keyLOGSYS (Logical system)

1.3.3.9 SAP NW PI Configuration for CT-e (Outbound) SAP NetWeaver Process Integration (SAP NetWeaver PI) serves as middleware that routes messages between SAP NFEcomponents, government authorities, and business partners. It also changes to SOAP when communicating with the authorities, or wheninteracting with any other protocol used for business-to-business communication. The message communication with the authorities iscarried out synchronously.

PrerequisitesYou must maintain the system and component information in the system landscape directory (SLD).You must install Java Web Start before you can use the Integration Builder for configuration activities in SAP NetWeaver PI.

The settings below are described to assist a trained SAP NetWeaver PI consultant with the necessary configuration activities.

ProcessFor configuring SAP NetWeaver PI for SAP NFE, you can use the following general steps for an inside-out approach. This enables you toeasily complete your configuration scenarios based on predefined configuration objects.1. Create configuration scenarios in the Integration Directory based on the integration scenarios from theIntegration Repository. The

integration scenarios group all possible entities for a specific communication situation based on government requirements. (SeeCreating CT-e Configuration Scenarios from Integration Scenarios )

2. Define configuration objects that can be reused across different integration scenarios. (See Configuration Object Definition for CT-eConfiguration Scenarios).Configuration objects include communication partners and communication channels to those partners. By defining these objects atthe beginning, you can increase the efficiency of the scenario configuration.

3. Complete the scenario configuration by assigning centrally-defined settings and defining specific parameters. (See Completing CT-eConfiguration Scenario Settings (Outbound).

You should obtain a copy of the Brazilian authorities’ Taxpayers' Integration Guide, which contains the official technical standardsand requirements for electronic communication. The guide also lists the URLs of the Web services for the individual regions to whichyou need to connect using SAP NetWeaver PI.

More InformationEach outbound message needs to be signed using a government-issued certificate with a private key. SAP NFE includes the signatureservice in the message handling of SAP NetWeaver PI. For more information, see Digital Signature Configuration for CT-e Outbound.

1.3.3.9.1 Creating CT-e Configuration Scenarios fromIntegration Scenarios (Outbound) You can use the delivered integration scenarios as templates for your configuration scenarios to ensure a complete configuration ofyour communication with the authorities. For more information about the available integration scenarios and their dependencies, seeIntegration Scenarios for CT-e Configuration (Outbound).

Creating the configuration scenarios first helps familiarize you with the NF-e naming conventions that you can use when you createconfiguration objects. This ensures that naming is consistent.

Note

Recommendation

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 27 of 174

Procedure1. In your SAP NetWeaver Process Integration (SAP NetWeaver PI) system, enter SXMB_IFR to start the Exchange Infrastructure tools

to set up configuration scenarios.2. Open Integration Builder: Configuration by choosing Integration Directory.3. In the menu bar, choose Tools Transfer Integration Scenario from the Integration Repository . Taking into account the software

component version of SAP NFE that you have installed, create a configuration scenario for each integration scenario.1. The input help for the integration scenario names lists all available scenarios from that you can select. After making the selection,

choose Ok.2. Choose Continue to create the configuration scenario based on the delivered integration scenario and adapt the name to your

needs.

Use a prefix when copying the integration scenarios as templates for your configuration project. Although the system sorts theintegration scenarios in the Integration Builder design environment by software component, it sorts the configuration scenariosalphabetically. You can group all SAP NFE configuration scenarios in the configuration environment by using the same prefix.

4. To save the configuration scenarios, choose Finish.

1.3.3.9.1.1 Integration Scenarios for CT-e Configuration(Outbound) To support you in implementing SAP NFE, SAP NetWeaver PI contains integration scenarios that group all dependent objects of acommunication process. You can use these integration scenarios to complete configure electronic communication during theimplementation process.All integration scenarios are defined in the development namespace for a specific version of a government system. They use objectsfrom this system version namespace as well as from the common namespace. The common namespace groups all objects such asstructures or mappings that are not dependent on a government system.The following integration scenarios are part of SAP NetWeaver PI content delivery for SAP NFE, listed in alphabetical order.

The technical names in SAP NetWeaver PI for SAP Nota Fiscal Eletrônica refer to the core application as WebAS.

CTEBATCH_WebAS_Outbound_CTeBatch_SYNCThis integration scenario contains all objects relevant to configuring the batch sending of signed CT-es to the authorities.CTEBATSR_WebAS_Outbound_CTeBatchStatusRequest_SYNCThis integration scenario contains all objects relevant to configuring the collection of CT-e statuses from the authorities. This occursafter the expiration of the time period that you received from the authorities in the above integration scenario. The logistics processcan only continue after receiving this message with an authorizing status code from the authorities.CTECANCR_WebAS_Outbound_CTeCancellationRequest_SYNCThis integration scenario contains all objects relevant to configuring the sending of cancellation requests to the authorities and thereceipt of the authorities’ response to those requests.

This scenario is only relevant for CT-e release 1.04. From CT-e release 2.00, the Cancellation Event has to be used.

CTESKIPR_WebAS_Outbound_CTeSkippingRequest_SYNCBrazilian authorities require that CT-es are numbered in consecutive order. After a CT-e is rejected, the number of this CT-e is used upand cannot be used again. Whenever a CT-e is rejected, you must inform the authorities about the gap in the sequence by sending arequest to skip the used number. This integration scenario contains all objects relevant to configuring the sending a skipping request tothe authorities and the receipt of the authorities’ response.CTESC_WebAS_Outbound_CTeStatusCheckThe CT-e status check is executed asynchronously. Ensure that the configuration is based on the integration scenarioCTESC_WebAS_Outbound_CTeStatusCheck from namespace http://sap.com/xi/CTE/104.CancCTB2B_WebAS_Outbound_B2B_Cancellation (Cancellation (relevant for CT-release 1.04 only))This integration scenario contains the objects relevant for configuring the sending of cancellation messages to a business partner afterpreviously sending a CT-e to the partner.CTB2B_WebAS_Outbound_B2B_Cte (relevant for CT-e release 1.4 and 2.00)This integration scenario contains the objects relevant for configuring the sending of CT-es to defined business partners.

Improvements in CT-e Version 2.00The CT-e release 2.00 ships with an event that is contained in the PI content from SP15 onwards. It is necessary to configure thefollowing scenario for events:CTEEV_WebAS_Outbound_CTeEvent_SYNCThis integration scenario contains all objects relevant for configuring the sending of events to the authorities and the receipt of theauthorities’ response for these requests. Examples for CT-e events are the cancellation request or the correction letter. This scenario

Recommendation

Note

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 28 of 174

replaces the cancellation request scenario CTECANCR_WebAS_Outbound_CTeCancellationRequest_SYNC in CT-erelease 2.00.ETB2B_WebAS_Outbound_B2B_EventThis integration scenario contains all objects relevant for configuring the sending of authorized events to B2B partners.

StructureYou can identify the dependent objects of an integration scenario by checking the first characters in the technical name. If you use theintegration scenarios as templates for your configuration scenarios, the objects are already grouped. Adhere to the naming conventionswhen creating objects to keep consistent object names.The list below contains examples of the naming conventions:CTEBATCH, CTEBATSRObjects starting with CTEBAT always belong to scenarios for communicating with the authorities about batched CT-es.CTEBATCH: The objects with the CTEBATCH prefix are for sending CT-es to the authorities in batches.CTEBATSR: The characters SR stand for status request, in which your system collects the status from the authorities' system for allCT-e sent with a certain batch.

CTECANCRAll objects that contain CANCR are used in cancellation scenarios.CTECANCR: This is a cancellation request for a regular CT-e to the authorities

CTESKIPRObjects with this prefix depend on the CT-e skipping scenario, represented by SKIP for skipping and R for request.CTEEVObjects with this prefix are used in event scenarios.

ExampleThe integration scenario CTEBATSR_WebAS_Outbound_CTeBatchStatusRequest_SYNC for the batch status request,represented by the prefix CTEBATSR, contains the following dependent objects:

Integration Scenario: CTEBATSR_WebAS_Outbound_CTeBatchStatusRequest_SYNCInterfaces: CTEBATSR_cteRetRecepcaocte_SYNC_OB and CTEBATSR_cteRetRecepcaocteSoapIn_SYNC_IBActions: CTEBATSR_SendBatchStatusRequest_SYNC and CTEBATSR_ReceiveBatchStatusRequest

1.3.3.9.2 Configuration Object Definition for CT-e ConfigurationScenarios (Outbound) You need to use generic objects that are specific to your system landscape and company on multiple occasions in the configurationscenarios. You can define these objects centrally to reuse them when completing the individual configuration scenarios during the nextstep.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 29 of 174

FeaturesYou can centrally define the following generic objects (grouped by object type):

Communication PartnersA wizard leads you through the process of creating communication partners as configuration objects. You must specify the connectionparameters, such as target URLs. Required entries include:

Your company as internal partyFor your own company, you must define a business service without a communication channel. This entry is mandatory, although itremains empty.Government systemsYou must create a separate partner entry for each regional authority because of their distributed responsibilities and associatedsystem information. You can define the conditions for determining the recipient within a specific configuration scenario, SAPNetWeaver Process Integration (SAP NetWeaver PI) then determines the correct recipient by analyzing the payload in the XMLs sentby the NFE core application.

If the authorities of a region provide communication with different system environments that you want to use, you must create twodifferent Business Services: one for the productive system environment and the other for the homologation (test) environment forthe communication partner representing that regional authority.For each configuration scenario representing an interface to the authorities in a specific process, the authorities use a special Webservice to respond to requests. Web services can differ between different regions. For each available Web service, you mustcreate a Communication Channel as a SOAP receiver channel within a business service for a region.

Services Without PartiesYou must define a service for internal communication with each component within the delivery of SAP NFE so that SAP NetWeaver PIcan connect to these components in the communication process. This involves the following::

Assignment of Business System to NFE core applicationYou must assign the system on which your core application runs. The system administrator for SAP NetWeaver PI maintains thesystem information in the system landscape directory (SLD) at the beginning of your configuration project.

You must create a receiver Communication Channel for the adapter type PI adapter that uses the ABAP proxies.The communication channel of the PI adapter type for the sender is implicitly defined, and thus requires no configuration action.

ActivitiesTo open the Integration Directory in the Integration Builder for Configuration, follow the instructions under Creating CT-e ConfigurationScenarios from Integration Scenarios.In the navigation section, you can choose the Objects tab page to assign or create the required objects and use the wizardsprovided.

1.3.3.9.2.1 CT-e Communication with Authority Systems(Outbound)

ProcedureConfiguration scenarios with prefixes CTEBATCH, CTEBATSR, CTECANCR, and CTESKIPR connect to authority systems. They requirespecial settings in the SOAP communication channels, follow the steps outlined below:1. Enter the URLs of authority systems, which can be found on the SEFAZ Web site.2. Import certificates into the J2EE keystore.

To import certificates for client authentication in the SOAP adapter configuration, refer to SAP NetWeaver J2EE documentation.

You should import the certificate, including the CA chain, as one single PFX file as described in SAP Note 1524196.

3. Enable certificate-based authentication and select your relevant certificate (Keystore View / Keystore Entry). For more informationabout the import of certificates into the keystore, refer to NF-e/CT-e Administrator.

4. The entries in SOAP action field must correspond to the release version of the authorities' Web services.5. Enable Do Not Use SOAP Envelope under Conversion Parameters due to the fact that the SOAP Envelope is created during the

mapping process.6. In the tabstrip of the module of the communication channels add the following Local Enterprise Bean for all SOAP communication

channels connected to SEFAZ systems twice: localejbs/AF_Modules/MessageTransformBeanThis bean has to be the first and the last entry in your processing sequence. Choose a self-defined module key for each entry.

Set the first module key to:Parameter Name: Transform.ContentTypeParameter Value: application/soap+xml; charset=utf-8Set the last module key to:Parameter Name: Transform.ContentTypeParameter Value: text/xml; charset=utf-8

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 30 of 174

A template called GOV_104_SOAP_RCV_TMPL is provided with the PI content of this release for your reference.

1.3.3.9.2.2 Communicating with CT-e B2B Partners

Procedure

The technical names in SAP NetWeaver Process Integration (SAP NetWeaver PI) refer to the core application of SAP Nota FiscalEletrônica (SAP NFE) as WebAS.

SAP NetWeaver PI offers an array of possibilities for communicating with B2B partners. A new, more flexible configuration approach forthe CTB2B_WebAS_Outbound_B2B_Cte and the CancCTB2B_WebAS_Outbound_B2B_Cancellation (for 1.04) orETB2B_WebAS_Outbound_B2B_Event (for 2.00) integration scenarios has been implemented.The SAP NFE system populates the receiver service in the XI message header with the CNPJ code (pattern CNPJ <cnpjcode> ) ofyour business partner (buyer or carrier). This additional information gives you several options to configure the receiver determination inyour PI system:

You can use the predefined Service as Identifier: This straightforward approach uses the Integration Scenario Configurator. Createone generic party or a several parties for your B2B partners and use their respective CNPJs to determine the receiver service. In thereceiver determination, set Service to Receiver Service.

In the generated receiver determinations, the Party and Service fields under Receiver must be set as * (asterisk).

The receiver determination now contains your own defined Party object, but also accepts the Receiver Service already populatedfrom the SAP NFE WebAS. Create the interface determinations and corresponding Receiver Agreements for each receiver todetermine the communication direction within the relevant communication channel.You can use extended receiver determination to translate the receiver-service-CNPJ into specific partners: If you already createdyour B2B partners in XI and want to re-use them, message mapping reads the Receiver parameter from the message headers. Youcan then use a value mapping of your choice to match the CNPJ numbers with your target B2B partners. Receiver determinations areno longer necessary, and you can re-use existing Interface Determinations and Receiver Agreements. The approach described inSAP Note 1525562 (with minor enhancements) can be applied to this scenario.You can use generic receivers: You can use the receiver-service-CNPJs to determine the mail address by using the SAP PI LookupAPI and the Dynamic Adapter Configuration. ,You can also implement the Business Add-In /XNFE/EMAIL_B2B to add the e-mail address in SAP NFE as an attachment to the XImessage. You can extract this e-mail address in your PI system via adapter module (PI 7.0) or Message/Java mapping (PI 7.1 andhigher).

1.3.3.9.3 Completing CT-e Configuration Scenario Settings(Outbound) SAP NetWeaver Process Integration (SAP NetWeaver PI) provides a wizard for configuring scenarios. If you create the configurationobjects before you start configuring the scenarios, you can avoid inconsistent settings, and you can assign these configuration objects indifferent scenarios, while only defining them once. If you create configuration scenarios based on the delivered integration scenarios,you can easily complete the configuration process.

PrerequisitesYou must have already created configuration scenarios (see Creating CT-e Configuration Scenarios from Integration Scenarios) anddefined configuration objects (see Configuration Object Definition for CT-e Configuration Scenarios).

Procedure

To use the Integration Builder for configuration, follow the instructions for Creating CT-e Configuration Scenarios from IntegrationScenarios

1. Select a configuration scenario in the navigation structure for scenarios.2. For the selected configuration scenario, choose the icon with the quick info Integration Scenario Configurator from the function menu.

Note

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 31 of 174

3. The system opens a wizard that contains all objects for this scenario. The settings that you defined in a previous step have alreadybeen applied. Follow the instructions of the Integration Scenario Configurator, which leads you through the configuration process.The component view for each configuration scenario provides an overview of the involved business partners and objects that youmust consider in the configuration steps.1. Choose Assign Services.

You can navigate between the different settings by switching between the relevant parties. To do so, use the forward and backarrows with the quick info links Next Role or Previous Role.You can use the different tab pages for each object assigned to one role. If you need to involve a business partner, the authorities,or a particular Web service for the digital signature, for example, you can assign the services that you defined in a previous step.

2. Choose Configure Connections and define or assign the relevant settings by navigating between the relevant parties and objectsusing the arrows or the tab pages.

Due to government requirements for electronic messages, SAP NetWeaver PI content for SAP NFE uses the authorities’ XMLschema names for the message interfaces, and adds only control data.

3. Choose Generate. The system creates all dependent entries for the configuration scenario based on the template information inthe integration scenario.

4. To ensure that messages are routed to the correct target, you must configure content-based routing for all Receiver Determinationsin government processes, for example, in the configuration scenario CTEBATCH_WebAS_Outbound_CTeBatch_SYNC. Youconfigure this routing by defining conditions (the values in specific XML fields) for each recipient government systemtpAmb = 2 indicates a homologation systemtpAmb = 1 indicates a productive system

The cUF field in the XML payload contains the state number.The tpEmis field determines if a contingency environment is used.

To use SEFAZ VIRTUAL DE CONTINGÊNCIA (SVC) set tpEmis = 7 for SVRS or tpEmis = 8 for SVSP and for normaloperation: tpEmis ≠ 7 or ≠ 8, depending on the used SVC system. All CT-es with tpEmis = 1 and tpEmis = 5 have to betransferred to the standard (non-contingency) SEFAZ system. Check technical note 2012/003 to find the relevant SVC region.The configuration of SVC is not possible for the CTESKIPR_WebAS_Outbound_CTeSkippingRequest_SYNC scenario.The skipping request of an unused CT-e has to be transferred to a SEFAZ system.

Using the combination of the cUF entry and tpAmb and tpEmis, the system can identify the correct recipient government system.5. You can check your settings for a configuration scenario by choosing Tools Test Configuration in the menu bar.

From Support Package 12 onwards, the CT-e status check is executed asynchronously. Ensure that the configuration is based on theintegration scenario CTESC_WebAS_Outbound_CTeStatusCheck from namespace http://sap.com/xi/CTE/104.

1.3.4.2.4 Configuration for NFE on AEX (Java-only PI) With the release of SAP NetWeaver Process Integration (PI) 7.31, it is possible to run the system as an AEX (Advanced Adapter EngineExtended /Java-only / single stack) installation. To configure the PI content of SAP NFE on such an installation, you have to use theintegration scenarios containing the infix AEX. The other scenarios can contain ccBPM processes that are not supported on a singlestack installation since they are based on ABAP.The configuration matches with the approach described in the previous sections. The following additional steps have to be carried out:

For a more detailed overview, see SAP Note 1743455.

Process1. NWA Destination Configuration in PI

Open NWA ( http://<host>:<port>/nwa Configuration Infrastructure Destinations ) and maintain the HTTP destinationGRC_NFE_WAS with the following URL:http://<host>:<port>//sap/xi/engine?type=entry&sap-client=<client>&sap-language=ENReplace host, port and client values with the values of your SAP NFE backend. For the event that you have multiple SAP NFEbackends, you need to define separate destinations (destination name is arbitrary) for every individual backend.

2. Communication Channels in PIWhen the integration scenarios are generated as an Integrated Configuration it is necessary to use the delivered CommunicationChannel templates. These templates contain the adapter modules in the correct order. The adapter modules replace the ccBPMlogic.

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 32 of 174

In the SOAP Sender Channel that receives messages from your SAP NFE system populate the HTTP Destination field of theAcknowledgement Handling Tab with your created Destination in point 1.

3. Post-generation Step in PIAfter generating the objects, copy the generated Integrated Configuration for the Response message from the authorities (SEFAZ issender) to the SAP NFE sender system of the request message as a virtual receiver of the response message. Delete thegenerated Integrated Configuration without the Virtual Receiver.The B2B scenarios from the SAP NFE system to your B2B partner (NTB2B, ETB2B for NF-e and CTB2B, CancCTB2B for CT-e)have to have a virtual receiver with the asterisk (*), because the receiver is already populated with the CNPJ number in the SAP NFEsystem.

A detailed explanation and examples are provided in SAP Note 1743455.

4. SAP NFE Backend SettingsThe ABAP proxy communication needs to call the AEX (Java-only) directly. This is described in SAP Help under ProcessIntegration Advanced Adapter Engine Extended (AEX) .

1.3.4 Configuration of NF-e/CT-e Inbound

Configuring SAP Nota Fiscal Eletrônica (Inbound)Technical Settings for NF-e InboundConfiguration for Digital Signature ValidationActivating Services for UI Display of Monitors (Inbound)Configuring and Personalizing Workplaces (Inbound)Process Settings and Customizing (Inbound)Vendor NotificationNF-e Rejection NotificationCT-e Rejection NotificationNF-e Acceptance NotificationCT-e Acceptance NotificationNF-e from National Environment: Batch Job PlanningUser Roles and Authorizations (Inbound)SAP NetWeaver PI Configuration for SAP NF-e/CT-e (Inbound)Creating Configuration Scenarios from Integration Scenarios (Inbound)Integration Scenarios for Configuration (Inbound)Configuration Object Definition for Configuration Scenarios (Inbound)Communication with Authority Systems (Inbound)Completing Configuration Scenario Settings (Inbound)Configuration for NFE on AEX (Java-only PI)Additional Workplace Configuration (Inbound)NF-e Alert Configuration

1.3.4.1 Configuring SAP Nota Fiscal Eletrônica (Inbound) The core application of SAP Nota Fiscal Eletrônica (SAP NFE) contains the logic used to communicate with the authorities and toprocess incoming NF-es. For these communication processes, SAP NFE links a feeder system such as SAP ERP to SAP NetWeaverProcess Integration (SAP NetWeaver PI). You must configure the core application to control system behavior and to specify the processsetup.The necessary settings are divided into basic technical settings and process-related settings.

Basic technical settingsBasic technical settings enable you to make decisions about electronic communication with your business partners. For example, youcan specify in Customizing how the system responds to different process statuses.Process-related settingsProcess-related settings include, for example, control of the fiscal and logistics workplaces.

Process1. Define basic technical settings, including:

Incoming NF-es and Configuration for Digital Signature ValidationAuthorization checks for NF-es and communication with SEFAZ (see Process Settings and Customizing (Inbound)).Communication with ERPProcess steps for assigned business processes

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 33 of 174

Defining services for user interfaces and workplacesFor more information, see Technical Settings in SAP NFE Core Application (Inbound).

2. Define process-related customizing settings for:Process stepsMonitoring processes

3. Define user roles and authorizations (see User Roles and Authorizations (Inbound)).

1.3.4.1.1 Technical Settings for NF-e/CT-e Inbound You must carry out technical settings for the following areas of the SAP NFE core application:

SignatureMaintain System Security InformationYou define and monitor the personal security environments (PSEs) in the SAP system that are used for digital signatures andencryption in SAP systems. For more information, see the documentation in Customizing under Nota Fiscal Eletrônica SignatureMaintain System Security Information .

Maintain Application-Dependent SSF InformationYou specify the application-independent parameters for using SSF (secure store and forward) functions. The applications that usethe SSF functions do not all have to use the same security environment or products. For more information, see the documentationin Customizing under Nota Fiscal Eletrônica Signature Maintain Application-Dependent SSF Information and Configurationfor Digital Signature Validation.

Communication to ERP Back End SystemName the Logical SystemYou define your back-end (ERP) system to enable it to establish a connection with SAP Nota Fiscal Eletronica (NFE). For moreinformation, see the documentation in Customizing under Nota Fiscal Eletrônica Communication to ERP Back End System Name the Logical System .Create RFC DestinationsYou define the technical parameters for the RFC (Remote Function Call) destinations, which must be maintained to define an RFCport. The name of the RFC destination should match the name of the corresponding logical system. For more information, see thedocumentation in Customizing under Nota Fiscal Eletrônica Communication to ERP Back End System Create RFCDestinations .Determine RFC Destinations for Method CallsYou define the RFC destinations that are used for synchronous BAPI calls and for calling dialog methods in other logical systems.1. Assign the RFC destinations to the logical systems using a tree graphic. All the logical systems in the SAP system group are

displayed in the tree, with the assigned RFC destination appearing beneath each logical system.2. Select a logical system and assign to it a standard destination for BAPIs, or dialogs or a destination for specific methods. For

more information, see the documention in Customizing under Nota Fiscal Eletrônica Communication to ERP Back EndSystem Determine RFC Destinations for Method Calls

You cannot assign RFC destinations to your own logical system because it is called without an RFC destination.

1.3.5.4 Configuration for Digital Signature Validation To validate a digital signature in SAP NetWeaver, you need to define the following settings:

SSF: Trust ManagerExecute transaction STRUST. For the SSF application NFE_IN, you must import the public CA certificates from your businesspartners. When the signing certificate of your business partner is issued by Certisign, you have to import the public CA certificatefrom Certisign. If another business partners has SERASA as issuer; then you have to import the public CA certificate fromSERASA, too. Do this for all other certificate providers of your business partners. For more information, see SAP Note 1524196,attachment NFE_Digital_Signature_Guide.pdf, and NF-e/CT-e Administrator.Define Control Parameter for Signature ValidationTo overcome the problem that the certificate of an authorized document has expired during the sending to the business partner, youcan set a customizable switch to reference validation. This validation (together with the authorization check) also prevents fraud andis independent of the sender’s certificate expiration date. During the reference validation, the message digest is calculated andchecked against the persisted digest after the authorization step. Set the Value field of the IMG activity Define Control Parameters forProcess Steps to blank (= Signature Validation), or 1 (= Reference Validation) for the relevant CNPJ, process type and step.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 34 of 174

1.3.4.1.3 Activating Services for UI Display of Monitors(Inbound) You must activate the relevant UI services for master data maintenance and for monitoring of central messaging.

Procedure1. Enter transaction code SICF and choose Execute.2. Select the following entries in the navigation tree for the Virtual Hosts/Services under default_host sap bc webdynpro xnfe .3. Activate the service for displaying the user interfaces for each of the following entries by using the context menu and selecting

Activate Service:General/cross-document applicationsssf maintenance for SSF maintenancedownload_mass_xml for Download XML of NF-es / CT-esgatekeeper_workplace for DF-e Gate Monitor

NF-e specific servicesnfe_fiscal_workplace for Fiscal Workplace for NF-enfe_fisc_workplace_arch for NF-e Fiscal Workplace for Archived NF-esnfe_log_workplace for Logistics Workplace for NF-enfe_receiver_ack_wp for NF-e Receiver Acknowledgment Workplacenfe_list_monitor for NF-e List and Download Monitornfe_liststa_monitor for Status Monitor for NF-e Listnfe_analytics for Reports for NF-e Sendersinnfe_dab for Graphical Overview for Incoming NF-es

CT-e specific servicescte_fisc_workplace for CT-e Inbound Fiscal Workplacecte_fisc_workplace_arch for CT-e Inbound Fiscal Workplace for Archived CT-es

4. In addition, you must activate the following basic services in the navigation tree for the Virtual Hosts/Services under default_host sap public bc :ur for Unified Renderingicons for SAP Iconsicons_rtl for Icons RTLpictograms for Pictogramswebdynpro for Web Dynpro MIME Handling

1.3.4.1.4 Configuring and Personalizing Workplaces (Inbound)

ProcedureYou can use your Personal Object Work List (POWL) and the Floorplan Manager to configure and personalize workplaces, as follows:

POWL FrameworkThe Personal Object Work List/ Power List provides central, personalized access to your worklist items. You can define (andoptionally store) queries via portal-based interfaces similar to selection screen variants in SAP systems.Floorplan ManagerFloorplan Manager is a framework that you can use to create and configure Web Dynpro applications in Web Dynpro ABAP. You canuse the Floorplan Manager configuration editor to combine application-specific views of one or more business applications with anew Floorplan Manager application. For more information, see the documentation for Floorplan Manager for Web Dynpro ABAP inSAP Library under: SAP NetWeaver 7.0 EHP1 Application Platform by Key Capability ABAP Technology UI Technology WebUI Technology .

1.3.4.1.5 Process Settings and Customizing (Inbound)

ProcedureMaintain Logical System for Own Tax Numbers

UseWhen inbound NF-es are processed, process steps can be carried out that require communication with an ERP system. Thecorresponding ERP system is determined using the recipient's CNPJ number from the incoming NF-e. In this Customizing activity, youdefine the assignment of the recipient’s CNPJ number to the corresponding ERP system. To determine the logical system, the systemchecks whether it can find an entry for the CNPJ number of the recipient of an incoming NF-e.Requirements

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 35 of 174

You have maintained a logical system for each ERP system (see the corresponding Customizing activity).ActivitiesDefine the assignment of the recipient’s CNPJ number to the corresponding ERP system.Example

Recipient's CNPJ1234567890Logical SystemABCCLNT400

If an NF-e is received for CNPJ number 1234567890, system ABCCLNT400 is determined.NF-e: Maintain Business Process Determination for Inbound NF-es

UseIn this Customizing activity, you assign specific business processes to incoming NF-es for further processing. The business processesare determined based on the CFOP codes that are assigned to the NF-e items. If the CFOP code does not enable identification of aunique business process, the NF-e is not assigned.RequirementsEvery CFOP code that is to be used must be assigned a business process. Wildcard entries are not supported. This means if a valuesuch as * or blank is entered for the CFOP code, the business process is not determined.ActivitiesEnter the CFOP codes you want to use to determine business processes and assign the corresponding business processes to them.For more information, see the documentation in Customizing under Nota Fiscal Eletronica Inbound Maintain Business ProcessDetermination for Incoming NF-es .

Maintain Control Parameter for Process FlowUseIn this Customizing activity, you perform certain steps to further process an incoming document (NF-e, CT-e, or Event). These processsteps are determined from the business process to which the NF-e was assigned based on the CFOP codes of its items (This is onlytrue for NF-es; for CT-es and events, the CFOP code is not used for business process determination). The process flow for thisbusiness process is contained in table /XNFE/PROCFLOW. You can determine how the process flow is handled, dependent uponthe sender's and/or recipient's CNPJ number in the incoming document. The Control Settings field lets you control theprocessing of a process step. It has the following options:

Manual = The process step is not processed automatically during the process. The automatic process stops at this process step.The user performs this step manually.Automatic = The process step is performed automatically during the process - that is, without user interaction. If processing issuccessful, the step status is set to OK and the process is continued.You can use the following options in the Inactive field to deactivate a process step:

" " = The process step is active and can be executed automatically or manually, depending on the settings in the Control Settingsfield."X" = The process step is deactivated: The process step is not carried out, but the status of this step is set to OK and theprocess continues to the next step.

RequirementsYou can maintain a blank entry for CNPJ codes. The system uses the following search sequence to determine the valid entry:

Search with both CNPJ numbers to find an entrySearch with the recipient's CNPJ number to find an entrySearch with the sender's CNPJ number to find an entrySearch with two blank CNPJ numbers to find an entry

Make sure that at least the generic entry (blank CNPJ field) is present for each process step.Standard settingsSteps that are essential to the process flow cannot be deactivated.ActivitiesDefine the process type and process step that you want to influence. Enter the CNPJ numbers in accordance with the criteria listedbefore, taking the search sequence into account. Define the suitable control options.NF-e: Maintain Assignment of Item Category to CFOP Code

UseIn this Customizing activity, you can maintain the assignment of item categories to CFOP codes. This assignment is relevant fordetermining the correct business process. The item categories represent the meanings of the CFOP codes. They have differentpriorities in the determination of the business processes. If an NF-e contains both main items and other item categories, then only themain items are used to determine the business process.

ActivitiesMaintain the assignment of item categories to CFOP codes. If no entry is created for a CFOP code, then the item category for thatCFOP code is Blank, which means it is a main item.ExampleIn subcontracting cases, the NF-e can contain a final product (= main item) and the subcontracting components (= symbolic return). Todetermine the correct business process, the entries must be maintained for the final product and the subcontracting components, toenable assignment of the corresponding item categories:CFOP Item Category5124 Main Item5902 Symbolic return of subcontracting component

Define Control Parameters for Process StepsUseIn this Customizing activity, you can define various activities for a specific process step. These process steps are determined fromthe business process to which the NF-e was assigned based on the CFOP codes of its items. The process flow for this businessprocess is contained in table /XNFE/PROCFLOW.Your own tax number (CNPJ) is also used to distinguish the entry at a higher level. You can use these activities to influence theoutcome of the selected process flow.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 36 of 174

The Activity field describes the available activity that is assigned to the feasible process steps in the table /XNFE/PROCACT. TheValue field can have various values and meanings, depending on which activity is chosen.RequirementsIf no activity is defined in table /XNFE/PROCCTRL for your own tax number or for a process step, the system automatically uses thestandard value for the respective process step.Likewise, the system also uses the standard settings when the Value field is blank for a given activity.

ActivitiesDefine the process type and process step that you want to influence. Reduce your selection by the tax number (CNPJ).ExampleIn this way, for example, three variants for entering goods receipt quantities are available:

Include Default Values (the fields for the received quantity and unit are filled with the quantities and units from the NF-e)Exclude Default Values (the fields for the received quantity and unit are not filled)Exclude Default Values, quantities from the NF-e are not displayed

CT-e: Maintain Business Process Determination for Inbound CT-esUseIn this Customizing activity, you assign specific business processes to incoming CT-es for further processing. Determination of thebusiness process is carried out using the CNPJ of the service taker (Field CNPJ_DERIVED_TOM in table /XNFE/INCTEHD) andthe indicator for the service taker (Field TOMA in table/XNFE/INCTEHD).

ActivitiesAssign a process type to the combination of CNPJ (number of the service taker) plus indicator of the service taker. Permitted values forthe indicator of the service taker are:

'0' = goods sender'3' = goods receiver

You can also use a blank entry for the CNPJ number. During business process determination, a matching entry for the relevant CNPJnumber is searched first. If no matching entry is found, then the blank entry is used.ExampleCNPJ (service taker) TOMA (indicator for service taker) Process TypeBlank 3 A74.544.297/0004-35 0 B

If the service taker with CNPJ 74.544.297/0004-35 acts as goods sender (TOMA = 0), then process type B is determined for theincoming CT-e. If a service taker with a differing CNPJ acts as goods receiver (TOMA = 3), then process type A is determined for theincoming CT-e.Control Parameters for process-independent Actions

UseIn this Customizing activity, you can define parameters for process-independent actions. You can define the parameters dependingon your own tax number (CNPJ). The available action can be selected with the corresponding parameter. Various values areavailable for the parameter.

RequirementsIf no value is defined for an own tax number and an action, the system automatically uses a default value. Likewise, the system alsouses the standard settings when the Value field is blank for a given activity.ActivitiesDefine the action you want to influence. You can limit your selection by the tax number (CNPJ). You can define a blank entry for theCNPJ codes. The system always searches an entry with the CNPJ number first. If none is found, the system searches an entry with ablank CNPJ number.ExampleIf an NF-e or CT-e is received more than once, you can choose the following values:

Exception; Visible as an application error in PIThis is the default setting. The corresponding XML message is displayed in the PI message monitor with an application error.Ignore; Entry in history table.The corresponding XML message is displayed in the PI message monitor as successfully processed. Only an entry in the documenthistory indicates that the document was received several times.

If an NF-e is received with a receiver-CNPJ that is not maintained in Customizing as an own CNPJ, you can choose the following values:Book in NF-e without assigning a business processException; Visible as an application error in PI

NF-e: Define Reasons for Rejection; Assign to EventsUseIn this Customizing activity, you specify the reasons for rejecting processing for incoming NF-es. Only the texts defined in this activitycan be selected as reasons for rejection. If vendor notification is active (in the rejection case), the selected rejection text can be sentto the business partner as part of an e-mail.

ActivitiesEnter the abbreviation for a rejection and enter a descriptive text.ExampleRejection Rejection TextAUTHORIZ The NF-e is not authorizedSIGNATUR The signature is not valid

CT-e: Define Reasons for RejectionUseIn this Customizing activity, you specify the reasons for rejecting the processing of inbound CT-es. Only the texts defined in this activitycan be selected as reasons for rejection. The selected rejection text can be sent to the business partner as part of an e-mail.

ActivitiesEnter the abbreviation for a rejection and enter a descriptive text.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 37 of 174

ExampleRejection Rejection TextAUTHORIZ The NF-e is not authorizedSIGNATUR The signature is not valid

Maintain Mail Sender Parameters for Own Tax NumbersUseIn this Customizing activity, you assign an e-mail address to incoming NF-es for your own tax number (CNPJ). This e-mail address isused as the sender address for e-mail communication. If you do not define this entry, the system tries to use the e-mail address of thecurrently active user. You can enter the e-mail text with the rejection in the Rejection Text Name field. You can enter the e-mail textwith the acceptance in the Acceptance Text Name field. You can maintain these texts using transaction code SO10; the text ID mustbe NFE. You can use the following fields from structure /XNFE/NFE_COM_TEXT to create the texts:NFEID - Access keyTYPE - NF-e typeFINNFE - Issue functionCNPJ_EMIT - CNPJ number of the NF-e issuerC_XNOME - Company name of the NF-e issuerCNPJ_DEST - CNPJ/CPF number of the NF-e recipientE_XNOME - Company name of the NF-e recipientSERIE - SeriesNNF - NF-e numberNOTIFICATION - Rejection text

ActivitiesEnter a valid e-mail address as sender address for your tax number. Optional: Use transaction code SO10 to enter a user-definedrejection text for your tax number.ExampleYour tax number Sender mail address Rejection text name Acceptance text name74544297000435 [email protected] NFE_REJECTION_TEXT NFE_ACCEPTANCE_TEXT

Maintain Communication Parameters for Partner Tax NumbersUseIn this Customizing activity, you define the communication parameters for a business partner. The business partner tax number mustbe entered. Optional: You can also enter your own tax number and link it with the business partner tax number. The recipient e-mailaddress determines where notifications are sent during e-mail communication. If no recipient e-mail address is entered for a businesspartner tax number, then e-mail notification is not possible for that business partner.Required-entry fields:

Business partner tax numberRecipient e-mail address (rejection or acceptance, depending on the scenario used)Your own tax number (optional)

ActivitiesEnter a recipient e-mail address for a business partner tax number (CNPJ) for communication purposes.ExampleBusiness partner tax number Own tax number Recipient e-mail address for

rejection/acceptance74544297000192 34274233026675 [email protected]

1.3.4.1.6 Vendor Notification You can notify your business partners by e-mail when NF-es/CT-es are accepted or rejected by performing the activities in Customizingunder Nota Fiscal Eletrônica Inbound Communication to Business Partner .The following activities are available:

Enter the e-mail parameters for your own tax number in Customizing under Nota Fiscal Eletrônica Inbound Communication toBusiness Partner Maintain Mail Sender Parameters for Own Tax Numbers .Define a new e-mail address for your own tax number.

If you are using the vendor notification feature, then this e-mail address is used as the sender address. If you do not define an e-mailaddress, then the address of the logged-on user, if available, becomes the vendor address. You can use the vendor notification only ifyou enter a valid e-mail address, either via this Customizing activity, or in the user master data.

Define SAP Standard TextsUsing transaction code SO10, enter appropriate texts to use for your acceptance rejection e-mail notifications. If you do not enter atext, a default text is used. For more information, see the documentation for this Customizing activity.Assign e-mail addresses to business partners’ tax numbersVendor notification by e-mail is possible only if you assign an e-mail address to the corresponding business partner’s tax number.Optionally, you can enter your own tax number.Refer to the documentation of this activity for more information. You find this activity under the following path: Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Communication Parameters for Partner Tax Numbers .

For more information, see:

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 38 of 174

NF-e Rejection NotificationCT-e Rejection NotificationNF-e Acceptance NotificationCT-e Acceptance Notification

1.3.4.1.6.1 NF-e Rejection Notification You have the option of notifying the relevant business partner by e-mail when an NF-e is rejected. (See Vendor Notification) To configurethe communication, make the following entries in Customizing under Nota Fiscal Eletrônica Inbound Communication to BusinessPartner NF-e: Define Reasons for Rejection; Assign to Events

Reason for rejectionText for rejection

You must enter values for this table if you want to be able to reject NF-es in the NF-e Fiscal Workplace.

Enter E-Mail Parameters of Sender for Own Tax NumberYou can define a SAP standard text (via transaction code SO10) for the e-mail body of the rejection. If you do not enter a text, adefault text is used.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Mail Sender Parameters for own Tax Numbers .Maintain Communication Parameters for Partner Tax NumbersYou can assign an e-mail address of a business partner to the tax number of the same business partner. Optionally, you can enteryour own tax number.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Communication Parameters for Partner Tax Numbers .

The vendor notification via e-mail is only possible if you assign the vendor's e-mail to the vendor's tax number.

1.3.4.1.6.2 CT-e Rejection Notification You have the option of notifying the relevant business partner by e-mail when a CT-e is rejected. (See Vendor Notification) To configurethe communication, make the following entries in Customizing under Nota Fiscal Eletrônica Inbound Communication to BusinessPartner CT-e: Define Reasons for Rejection

Reason for rejectionText for rejection

You must enter values for this table if you want to be able to reject CT-es in the CT-e Fiscal Workplace.

Enter E-Mail Parameters of Sender for Own Tax NumberYou can define a SAP standard text (via transaction code SO10) for the e-mail body of the rejection. If you do not enter a text, adefault text is used.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Mail Sender Parameters for own Tax Numbers .Maintain Communication Parameters for Partner Tax NumbersYou can assign an e-mail address of a business partner to the tax number of the same business partner. Optionally, you can enteryour own tax number.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Communication Parameters for Partner Tax Numbers .

The vendor notification via e-mail is only possible if you assign the vendor's e-mail to the vendor's tax number.

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 39 of 174

1.3.4.1.6.3 NF-e Acceptance Notification You have the option of notifying your business partner by e-mail when an NF-e is accepted. (See Vendor Notification) To configure thecommunication, make the following entries in Customizing under Nota Fiscal Eletrônica Inbound Communication to BusinessPartner

Maintain Mail Sender Parameters for Own Tax NumberYou can define a SAP standard text (via transaction code SO10) for the e-mail body of the acceptance. If you do not enter a text, adefault text is used.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Mail Sender Parameters for Own Tax Number .Maintain Communication Parameters for Partner Tax NumbersYou can assign an e-mail address of a business partner to the tax number of the same business partner. Optionally, you can enteryour own tax number.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Communication Parameters for Partner Tax Numbers .

Vendor notification via e-mail is only possible if the vendor's e-mail address is assigned to the vendor's tax number.

1.3.4.1.6.4 CT-e Acceptance Notification You have the option of notifying your business partner by e-mail when a CT-e is accepted. (See Vendor Notification) To configure thecommunication, make the following entries in Customizing under Nota Fiscal Eletrônica Inbound Communication to BusinessPartner

Maintain Mail Sender Parameters for Own Tax NumberYou can define a SAP standard text (via transaction code SO10) for the e-mail body of the acceptance. If you do not enter a text, adefault text is used.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Mail Sender Parameters for Own Tax Number .Maintain Communication Parameters for Partner Tax NumbersYou can assign an e-mail address of a business partner to the tax number of the same business partner. Optionally, you can enteryour own tax number.Refer to the documentation of this activity for more information. You find this activity under Nota Fiscal Eletrônica Inbound Communication to Business Partner Maintain Communication Parameters for Partner Tax Numbers .

Vendor notification via e-mail is only possible if the vendor's e-mail address is assigned to the vendor's tax number.

1.3.4.1.7 NF-e from National Environment: Batch Job Planning You must define this batch job to communicate with the national environment.ConfigurationYou need two batch jobs for the following regular tasks:

Request information from the National Environment for all documents that were issued for an own tax number (CNPJ). This request(depending on the expected NF-es) should be issued daily.Create the batch job for the request by using the program /XNFE/COLLECT_DOCUMENTS. You can limit your selection according toCNPJ. If you do not specify a limitation, all own tax numbers specified in Customizing are used as tax numbers.At the end of the program, a status update (as described below) is executed.Update the process status of the documents received by batch job /XNFE/COLLECT_DOCUMENTS. This update compares thestatus of the List and Download Monitor with the document status in the NFE system (For example: NF-e XML/NF-e Cancel Eventhave arrived via B2B since the last update). This update should be executed more regularly than the request batch job.Create the batch job for the update by using the program /XNFE/INNFELIST_UPDATE_STATUS. You can limit your selectionaccording to CNPJ. If you do not specify a limitation, all own tax numbers specified in Customizing are used as tax numbers.

Make sure to use the program /XNFE/INNFELIST_UPDATE_STATUS for updating the status and not the program/XNFE/COLLECT_DOCUMENTS. Therefore, the status update should be executed more regularly than the request for new

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 40 of 174

documents.

Download XML Documents from the AuthoritiesThe download is executed in batches of up to 10 NF-e access keys.Create a number range interval via transaction SNUM for the object /XNFE/NFDL. Create interval 01 with a length of 15 digits.

1.3.4.1.8 User Roles and Authorizations (Inbound) User Roles/XNFE/WP_NFE_ADMINThis role is intended for the NFE administrator. It does not contain authorizations and is therefore only meant to create and set up theuser menu. You can copy this role to adjust the user menu according to your requirements. This role can be combined with other rolesin a composite role./XNFE/WP_NFE_IN_FISCALThis role is intended for the user of inbound monitors and workplaces for NF-e and CT-e, for example, Fiscal Workplace for NF-e andFiscal Workplace for CT-e. It does not contain authorizations and is therefore only meant to create and set up the user menu. Youcan copy this role to adjust the user menu according to your requirements. This role can be combined with other roles in a compositerole./XNFE/WP_NFE_IN_LOGISTICThis role is intended for the user of the NF-e Logistics Workplace. It does not contain authorizations and is therefore only meant tocreate and set up the user menu. You can copy this role to adjust the user menu according to your requirements. This role can becombined with other roles in a composite role./XNFE/WP_NFE_IN_REPORTSThis role is intended for the user who wants to run an analysis of various NF-e processing situations. It does not contain authorizationsand is therefore only meant to create and set up the user menu. You can copy this role to adjust the user menu according to yourrequirements. This role can be combined with other roles in a composite role./XNFE/WP_NFE_IN_GATEKEEPERThis role is intended for the user of the DF-e Gate Monitor (DF-e = NF-e and CT-e) at the company gate to scan the barcodes of ashipment (Example: truck arrives with several DACTE and DANFE). It does not contain authorizations and is therefore only meant tocreate and set up the user menu. You can copy this role to adjust the user menu according to your requirements. This role can becombined with other roles in a composite role.

AuthorizationsFor information concerning authorizations, refer to the security guide of SAP Nota Fiscal Eletrônica (http://help.sap.com/nfe).

1.3.4.2 SAP NetWeaver PI Configuration for SAP NF-e/CT-e(Inbound) SAP NetWeaver Process Integration (SAP NetWeaver PI) serves as middleware that routes messages between SAP NFEcomponents, government authorities, and business partners. It also changes the protocol to SOAP when communicating with theauthorities or when any other protocol is used for business-to-business communication. When messages must be adapted, SAPNetWeaver PI also provides the bridging through integration processes in cross-component business process management thatfunction like workflows, for example:

Switching from asynchronous mode used between the SAP NFE core application and SAP NetWeaver PI to synchronous messagetransfer, which is used to communicate between SAP NetWeaver PI and the authorities.Multimapping for message merges that the system must perform for correct record-keeping in the SAP NFE core application. Thesystem performs message merges, for example, to combine an NF-e or CT-e sent to the authorities with the authorities' responsecontaining the planned time when the NF-e or CT-e status will be available. SAP NetWeaver PI sends the compiled information in onemessage to the core application.

You must maintain the system and component information in the system landscape directory (SLD).You must install Java Web Start before you can use the Integration Builder for configuration activities in SAP NetWeaver PI.

Process

The settings below are described to assist a trained SAP NetWeaver PI consultant with the necessary configuration.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 41 of 174

To configure SAP NetWeaver PI for SAP NFE, you can use the following general steps for an inside-out approach, which allows you toeasily complete your configuration scenarios based on pre-defined configuration objects.1. Create configuration scenarios in the Integration Directory based on the integration scenarios from the Integration Repository. These

integration scenarios group all possible entities for a specific communication situation based on government requirements. For moreinformation, see Creating Configuration Scenarios from Integration Scenario (Inbound).

2. Define configuration objects that can be reused across different integration scenarios. Configuration objects include communicationpartners and communication channels to those partners. By defining these objects at the beginning, you can increase the efficiency ofthe scenario configuration. For more information, see Configuration Object Definition for Configuration Scenarios (Inbound).

3. Complete the scenario configuration by assigning the centrally defined settings and define the specific parameters. For moreinformation, see Completing Configuration Scenario Settings (Inbound).

4. Configure the alerts that SAP NetWeaver PI provides if you want the system to notify responsible persons about communicationfailures. (See NF-e Alert Configuration).

You should obtain a copy of the Brazilian authorities’ Taxpayers' Integration Guide, which contains the official technical standardsand requirements for electronic communication. The guide also lists the URLs of the Web services for the individual regions to whichyou need to connect using SAP NetWeaver PI.

1.3.4.2.1 Creating Configuration Scenarios from IntegrationScenarios (Inbound) You can use the delivered integration scenarios as templates for your configuration scenarios to ensure a complete configuration ofyour communication with the authorities. For more information about the available integration scenarios and their dependencies, seeIntegration Scenarios for Configuration (Inbound).

Creating the configuration scenarios first helps familiarize you with the NF-e naming conventions that you can use when you createconfiguration objects. This ensures that naming is consistent.

Procedure1. In your SAP NetWeaver PI system, enter SXMB_IFR to acess the SAP NetWeaver Exchange Infrastructure tools to set up

configuration scenarios.2. Open Integration Builder: Configuration by choosing Integration Directory.3. In the menu bar, choose Tools Transfer Integration Scenario from the Integration Repository . Taking into account the software

component version of SAP NFE that you have installed, create a configuration scenario for each integration scenario.1. The input help for the integration scenario lists all the available scenarios that you can select. After making a selection, choose Ok.2. Choose Continue to create the configuration scenario based on the delivered integration scenario you selected, and adapt the

name to your needs.

Use a prefix when copying the integration scenarios as templates for your configuration project. Although the system sorts theintegration scenarios in the Integration Builder design environment by software component, it sorts the configuration scenariosalphabetically. You can group all SAP NFE configuration scenarios in the configuration environment by using the same prefix.

4. To save the configuration scenarios, choose Finish.

1.3.4.2.1.1 Integration Scenarios for Configuration (Inbound) To support you in implementing SAP NFE, SAP NetWeaver PI contains integration scenarios that group all dependent objects of acommunication process. You can use these integration scenarios to complete configure electronic communication during theimplementation process.All integration scenarios are defined in the development namespace for a specific version of a government system. They use objectsfrom this system version namespace as well as from the common namespace. The common namespace groups all objects such asstructures or mappings that are not dependent on a government system.The following integration scenarios are part of SAP NetWeaver PI content delivery for SAP NFE.

Recommendation

Note

Recommendation

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 42 of 174

The technical names in SAP NetWeaver PI for SAP NFE refer to the core application as WebAS.

Be aware that you have to configure every integration scenario individually for every NF-e layout version that you need. Forexample, if you use the NFB2B_WebAS_Inbound_B2B_NFe integration to receive NF-es in layout 2.00 and now you need toreceive NF-es in layout 3.10 or higher, you also have to configure the NFB2B_WebAS_Inbound_B2B_NFe integration scenariofor NF-e layout 3.10 or higher.

NF-e Scenarios for NF-e Layout 2.00From namespace: http://sap.com/xi/NFE/006.NFB2B_WebAS_Inbound_B2B_NFeThis integration scenario contains the objects relevant to configuring the reception of NF-es from defined business partners.NFESC_WebAS_Outbound_NFeStatusCheckThis integration scenario contains the objects relevant to configuring the retrieval of status information about a NF-e from theauthorities. This scenario is necessary for checking the status of all NF-es sent to the authorities in batches for which you cannotretrieve the status information with the batch status check. The government is required to keep the NF-e statuses only for a specificperiod. If you cannot collect the status due to system downtime, you must request the NF-e status for each NF-e individually by usingthis integration scenario. You also need this scenario to check the status of NF-es that you receive from your business partners.EFB2B_WebAS_Inbound_B2B_EventThis integration scenario contains all objects relevant to configuring the receiving of events from B2B partners.ETB2B_WebAS_Outbound_B2B_EventThis integration scenario contains all objects relevant for configuring the sending of authorized events to B2B partners.EVENT_OPPRG_WebAS_Outbound_EventOperationProgressRequestThis integration scenario contains all objects relevant for configuring the sending of event requests from the operation progress group,such as the Operation Confirmation event to the authorities and the receipt of the authorities’ response to these requests. In theInbound case event requests from the operation progress group will be issued to national authority system, see CompletingConfiguration Scenario Settings (Inbound).

NF-e Scenarios for NF-e Layout 3.10 or HigherFrom namespace: http://sap.com/xi/NFE/008.NFB2B_WebAS_Inbound_B2B_NFeThis integration scenario contains the objects relevant to configuring the reception of NF-es from defined business partners.NFESC_WebAS_Outbound_NFeStatusCheckThis integration scenario contains the objects relevant to configuring the retrieval of status information about a NF-e from theauthorities. This scenario is necessary for checking the status of all NF-es sent to the authorities in batches for which you cannotretrieve the status information with the batch status check. The government is required to keep the NF-e statuses only for a specificperiod. If you cannot collect the status due to system downtime, you must request the NF-e status for each NF-e individually by usingthis integration scenario. You also need this scenario to check the status of NF-es that you receive from your business partners.EFB2B_WebAS_Inbound_B2B_EventThis integration scenario contains all objects relevant to configuring the receiving of events from B2B partners.ETB2B_WebAS_Outbound_B2B_EventThis integration scenario contains all objects relevant for configuring the sending of authorized events to B2B partners.EVENT_WebAS_Outbound_EventReceiptThis integration scenario contains all objects relevant for configuring the sending of event requests from the operation progress group(in the inbound case), such as the Operation Confirmation event to the authorities and the receipt of the authorities’ response to theserequests. Event requests from the operation progress group will be issued to national authority system, see Completing ConfigurationScenario Settings (Inbound) for more information.

Example for NFESC_WebAS_Outbound_NFeStatusCheck

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 43 of 174

CT-e ScenariosCancCFB2B_WebAS_Inbound_B2B_Cancellation (relevant for CT-release 1.04 only)This integration scenario contains the objects relevant to configuring the reception of cancellation messages from a business partnerafter previously having received a CT-e from the partner.CFB2B_WebAS_Inbound_B2B_CTe (relevant for CT-e 1.4 and 2.00 releases)This integration scenario contains the objects relevant to configuring the reception of CT-es from defined business partners.EFB2B_WebAS_Inbound_B2B_CTe (relevant for CT-e release 2.00 only)This integration scenario contains the objects relevant for configuring the reception of CT-es from defined business partners.CTESC_WebAS_Outbound_CTeStatusCheck (relevant for CT-e 1.4 and 2.00 releases)This integration scenario contains the objects relevant to configuring the reception of status information from the authorities about aCT-e that you received from a business partner.

NF-e StructureYou can identify the dependent objects of an integration scenario by checking the first five digits in the technical name. If you use theintegration scenarios as templates for your configuration scenarios, the objects are already grouped. Adhere to the naming conventionswhen creating objects to keep consistent object names.CFB2BObjects beginning with a C are used in cancellation scenarios. The F stands for from, and the B2B refers to a B2B scenario. Objectsstarting with this prefix belong to a cancellation from a business partner.NFB2BSimilar to the explanations above, objects starting with these prefixes are also used in the B2B scenarios. NFB2B is for receiving aNF-e from the business partner.NFESCYou need these objects in a B2B scenario to check the current status in the authorities' system of a NF-e or a cancellation that youreceived from a business partner before. The last two characters SC stand for “status check”.EFB2BThe prefix E is used in Event scenarios, F stands for FROM, B2B means B2B partner.

CT-e StructureCancCFB2BIn CT-e scenarios, the prefix Canc is used to identify objects that belong to the cancellation scenario. The C stands for CT-e, the F forfrom, and the B2B refers to a B2B scenario. Objects starting with this prefix belong to a cancellation from a business partner.CFB2BSimilar to the explanations above, objects starting with these prefixes are also used in the B2B scenarios. CFB2B is for receiving aCT-e from the business partner.CTESCYou need these objects in a B2B scenario to check the current status in the authorities' system of a CT-e or a cancellation that youreceived from a business partner before. The last two characters SC stand for “status check”.

ExampleThe integration scenario NFESC_WebAS_Outbound_NFeStatusCheck for the NF-e status check, represented by the prefixNFESC, contains, among others, the following dependent objects:

Integration Scenario: NFESC_WebAS_Outbound_NFeStatusCheck

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 44 of 174

Integration process: NFESC_NFeStatusCheckProcessInterface: NFESC_nfeConsultaNF_OBAction: NFESC_SendNFe

1.3.4.2.2 Configuration Object Definition for ConfigurationScenarios (Inbound) You need to use generic objects that are specific to your system landscape and company on multiple occasions in the configurationscenarios. You can define these objects centrally to reuse them when completing the individual configuration scenarios during the nextstep.

FeaturesYou can centrally define the following generic objects (grouped by object type):

Communication PartnersA wizard leads you through the creation of communication partners as configuration objects. You must specify the connectionparameters, such as target URLs. Required entries include:

Your company as internal partyFor your own company, you must define a business service without a communication channel. This entry is mandatory, although itremains empty.Government systemsYou must create a separate partner entry for each regional authority because of their distributed responsibilities and associatedsystem information. You can define conditions for determining the recipient within a specific configuration scenario. SAP NetWeaverProcess Integration (SAP Net Weaver PI) then determines the correct receiver by analyzing the payload in the XMLs sent by the NFEcore application.

If the regional authorities provide communication with different system environments that you want to use, you must create twodifferent Business Services: one for the productive system environment and the other for the homologation (test) environment forthe communication partner representing the regional authority.For each configuration scenario, the authorities use a special Web service to respond to sent requests. Web services can differbetween different regions. For each available regional Web service, you must create a Communication Channel as the SOAPreceiver channel within a business service.

Business partners for business-to-business (B2B) scenariosYou must create a partner entry for each business partner with which you agree to exchange NF-es and cancellation notices.

You must create separate Business Services if you want to receive NF-es from a business partner.You must create separate Communication Channels for receiving NF-es, and for receiving cancellation notices.The adapter type for your communication channels depends on the agreement with your business partners, for example, FTP orother file adapter.

Services Without PartiesYou must define a service for internal communication with each component within SAP NFE so that SAP NetWeaver PI can connect tothese components in the communication process. This involves the following processes:

Assignment of Business System of core applicationYou must assign the system on which your core application runs. The system administrator for SAP NetWeaver PI maintains thesystem information in the system landscape directory (SLD) at the beginning of your configuration project.

You must create a receiver Communication Channel for the PI adapter type that uses ABAP proxies.The communication channel of the PI adapter type for the sender is implicitly defined, and thus requires no configuration action.

ActivitiesTo open the Integration Directory in the Integration Builder for Configuration, follow the instructions in Creating ConfigurationScenarios from Integration Scenarios (Inbound).In the navigation section, you can choose the Objects tab page to assign or create the required objects using the wizards provided.

1.3.4.2.2.1 Communication with Authority Systems (Inbound)

ProcedureConfiguration scenarios with prefixes NFESC and CTESC connect to authority systems. They require special settings in SOAPcommunication channels, per the steps outlined below:1. Enter the URLs of authority systems, which can be found on the SEFAZ Web site.2. Enable certificate-based authentication and select the relevant certificates (Keystore View / Keystore Entry). For more information

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 45 of 174

about importing certificates into the keystore, see NF-e/CT-e Administrator.3. The entries in the SOAP action field must correspond to the release of the authorities' Web services.4. Enable Do Not Use SOAP Envelope under Conversion Parameters. The SOAP envelope is created during the mapping process.5. In the tab line of the communication channels module, add the following local enterprise bean for all SOAP communication channels

connected to SEFAZ systems as both the first and last entries in your processing sequence:localejbs/AF_Modules/MessageTransformBean.Choose a self-defined module key for each entry.

The first module key must be set to:Parameter Name: Transform.ContentTypeParameter Value: application/soap+xml; charset=utf-8The last module key be set to:Parameter Name: Transform.ContentTypeParameter Value: text/xml; charset=utf-8

A template called GOV_006_SOAP_RCV_TMPL is provided with the PI content of this release for your reference.

1.3.4.2.3 Completing Configuration Scenario Settings(Inbound) SAP NetWeaver Process Integration (SAP NetWeaver PI) provides a wizard for configuring scenarios. If you create the configurationobjects before you start configuring the scenarios, you can avoid inconsistent settings, and you can assign these configuration objects indifferent scenarios, while only defining them once. If you create configuration scenarios based on the delivered integration scenarios,you can easily complete the configuration process.

PrerequisitesYou must already have created configuration scenarios (see Creating Configuration Scenarios from Integration Scenarios (Inbound))and defined configuration objects (see Configuration Object Definition for Configuration Scenarios (Inbound)).

Procedure

To use the Integration Builder for configuration, follow the instructions for Creating Configuration Scenarios from Integration Scenarios(Inbound)

1. Select a configuration scenario in the navigation structure for scenarios.2. For the selected configuration scenario, choose the icon with the quick info Integration Scenario Configurator from the function menu.3. The system opens a wizard that contains all objects for this scenario. The settings that you defined in a previous step have already

been applied. Follow the instructions of the Integration Scenario Configurator, which leads you through the configuration process.The component view for each configuration scenario provides an overview of the relevant business partners and objects that youmust consider in the configuration steps.1. Choose Assign Services

You can navigate between the different settings by switching between the relevant parties. To do so, use the forward and backarrows with the quick info links Next Role or Previous Role.You can use the different tab pages for each object assigned to one role. If you need to involve a business partner, the authorities,or a particular Web service for the digital signature, for example, you can assign the services that you defined in a previous step.

2. Choose Configure Connections and define or assign the relevant settings by navigating between the involved parties and objectsusing the arrows or the tab pages.

Because of government requirements for electronic messages, SAP NetWeaver PI content for SAP NFE uses the authorities’XML schema names for the message interfaces, and adds only control data.

3. Choose Generate. The system creates all dependent entries for the configuration scenario based on the template information inthe integration scenario.

4. To ensure that messages are routed to the correct target, you must configure content-based routing for all Receiver Determinationsin government processes, for example, in the configuration scenario NFE_NFESC_WebAS_Outbound_NFeStatusCheck. Youconfigure this routing by defining conditions (the values in specific XML fields) for each recipient government system.tpAmb = 2 indicates a homologation systemtpAmb = 1 indicates a productive system

The cUF field in the XML payload contains the state number. The tpEmis field determines the issuing type to indicate if acontingency environment is used. For SVC, refer to technical note 2013/007 to find the relevant SVC server for your state.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 46 of 174

tpEmis Authorization1 SEFAZ (normal operation)2 SEFAZ (Contingency, FS)3 SCAN (Sefaz Contingência Ambiente Nacional)4 SEFAZ (DPEC)5 SEFAZ (Contingency, FS-DA)6 SVC-AN (Sefaz Virtual de Contingência Ambiente Nacional)7 SVC-RS (Sefaz Virtual de Contingência Rio Grande do Sul)

Using the combination of the cUF entry and tpAmb and tpEmis, the system can identify the correct receiving government systemand your routing rules must ensure that, for example, the following targets are reached:tpEmis cUF tpAmb Target1 43 1 RS Production1 35 2 SP Homologation3 any 2 SCAN Homologation6 any 1 SVC-AN Production7 any 2 SVC-RS Homologation

The contingency event service for the inbound scenario is not available in the SVC system.5. You can check your settings for a configuration scenario by choosing Tools Test Configuration in the menu bar.

1.3.4.2.4 Configuration for NFE on AEX (Java-only PI) With the release of SAP NetWeaver Process Integration (PI) 7.31, it is possible to run the system as an AEX (Advanced Adapter EngineExtended /Java-only / single stack) installation. To configure the PI content of SAP NFE on such an installation, you have to use theintegration scenarios containing the infix AEX. The other scenarios can contain ccBPM processes that are not supported on a singlestack installation since they are based on ABAP.The configuration matches with the approach described in the previous sections. The following additional steps have to be carried out:

For a more detailed overview, see SAP Note 1743455.

Process1. NWA Destination Configuration in PI

Open NWA ( http://<host>:<port>/nwa Configuration Infrastructure Destinations ) and maintain the HTTP destinationGRC_NFE_WAS with the following URL:http://<host>:<port>//sap/xi/engine?type=entry&sap-client=<client>&sap-language=ENReplace host, port and client values with the values of your SAP NFE backend. For the event that you have multiple SAP NFEbackends, you need to define separate destinations (destination name is arbitrary) for every individual backend.

2. Communication Channels in PIWhen the integration scenarios are generated as an Integrated Configuration it is necessary to use the delivered CommunicationChannel templates. These templates contain the adapter modules in the correct order. The adapter modules replace the ccBPMlogic.In the SOAP Sender Channel that receives messages from your SAP NFE system populate the HTTP Destination field of theAcknowledgement Handling Tab with your created Destination in point 1.

3. Post-generation Step in PIAfter generating the objects, copy the generated Integrated Configuration for the Response message from the authorities (SEFAZ issender) to the SAP NFE sender system of the request message as a virtual receiver of the response message. Delete thegenerated Integrated Configuration without the Virtual Receiver.The B2B scenarios from the SAP NFE system to your B2B partner (NTB2B, ETB2B for NF-e and CTB2B, CancCTB2B for CT-e)have to have a virtual receiver with the asterisk (*), because the receiver is already populated with the CNPJ number in the SAP NFEsystem.

A detailed explanation and examples are provided in SAP Note 1743455.

4. SAP NFE Backend SettingsThe ABAP proxy communication needs to call the AEX (Java-only) directly. This is described in SAP Help under ProcessIntegration Advanced Adapter Engine Extended (AEX) .

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 47 of 174

1.3.4.2.5 Additional Workplace Configuration (Inbound) If you want to use additional workplaces, you have to configure additional PI scenarios. For the configuration of these integrationscenarios, the same configuration procedure for PI must be applied (described in the previous sections).DF-e Gate MonitorThe following additional integration scenarios need to be configured in Process Integration for the Gatekeeper Workplace, listed inalphabetical order.

CTESC_WebAS_Outbound_CTeStatusCheck_SYNC (Namespace: http://sap.com/xi/CTE/200)This integration scenario contains the objects relevant to configuring the reception of status information from the authorities about aCT-e that you received from a business partner. This synchronous integration scenario is additionally required next to theasynchronous CTESC_WebAS_Outbound_CTeStatusCheck that is used by the CT-e Fiscal Workplace.NFESC_WebAS_Outbound_NFeStatusCheck_SYNC (Namespace: http://sap.com/xi/NFE/006)This integration scenario contains the objects relevant to configuring the retrieval of status information about an NF-e (For Layoutversion 2.00) from the authorities. In this case this scenario checks the status of NF-es that you receive from your business partners.This synchronous integration scenario is additionally required next to the asynchronousNFESC_WebAS_Outbound_NFeStatusCheck that is used by the NF-e Fiscal Workplace.NFESC_WebAS_Outbound_NFeStatusCheck_SYNC (Namespace: http://sap.com/xi/NFE/008)This integration scenario contains the objects relevant to configuring the retrieval of status information about an NF-e (For Layoutversion 3.10+) from the authorities. In this case this scenario checks the status of NF-es that you receive from your businesspartners. This synchronous integration scenario is additionally required next to the asynchronousNFESC_WebAS_Outbound_NFeStatusCheck that is used by the NF-e Fiscal Workplace.

StructureCTESCYou need these objects in a B2B scenario to check the current status in the authorities' system of a CT-e or a cancellation that youreceived from a business partner before. The last two characters SC stand for “status check”.NFESCYou need these objects in a B2B scenario to check the current status in the authorities' system of a NF-e and relevant events that youreceived from a business partner before. The last two characters SC stand for “status check”.

Receiver Acknowledgements WorkplaceThe following additional integration scenarios need to be configured in Process Integration for the Receiver AcknowledgementsWorkplace, listed in alphabetical order.

The integration scenarios for the list download and the XML download can be found in namespacehttp://sap.com/xi/NFE/006. These scenarios support download of NF-es for layout 2.00 and 3.10+.

NFEDL_WebAS_Outbound_NFeDownloadRequestThis integration scenario contains the objects relevant to configuring the download of NF-e XML issued by business partners from theauthorities.NFELI_WebAS_Outbound_NFeListThis integration scenario contains the objects relevant to configuring the service to query issued NF-e’s from your business partners.Structure

NFEDLYou need these objects in to download NF-e’s issued by business partners from the authorities' system. The last two characters DLstand for “download”.NFELIYou need these objects to check NF-e’s issued by your business partners at the authorities’ system. The last two characters LIstand for “list”.

NF-e List and NF-e Download requests have to be configured using the national authorities system (Ambiente Nacional - AN / cUF= 91) only. In the content-based routing, you only need to differentiate between the two environments (tpAmb).

1.3.4.2.6 NF-e Alert Configuration For a correct error handling, it is essential to send negative acknowledgments from PI to NFE if a communication problem occurs (Dueto the fact that the outbound scenario relies on asynchronous messages from NFE to PI). For PI double-stack installations, the alertcategory NFE_ALRT_CAT has to be created using transaction ALRTCATDEF (see SAP Note 1741486). This is not required for AEX(Java-only) PI installations.You can also use the alerts function in SAP NetWeaver Process Integration (SAP NetWeaver PI) to send e-mail notifications to theresponsible persons in your company about possible communication problems. The e-mail relays the error status message. You canspecify the e-mail notification recipients for each integration scenario.

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 48 of 174

For more information about configuring alerts in SAP NetWeaver PI, see Alert Configuration in the SAP Library under Functional View SAP NetWeaver by Key Capability Process Integration by Key Capability SAP NetWeaver Exchange Infrastructure Runtime

Central Monitoring .

ActivitiesTo configure alerts, use transaction code ALRTCATDEF and create the alert category NFE_ALRT_CAT.Define your alert rules according to the alert configuration descriptions in SAP Library for SAP NetWeaver PI.

1.3.5 Configuration of Events

Event Batch Job PlanningActivating Services for UI Display of Event MonitorsUser Roles and Authorizations for EventsConfiguration for Digital Signature Validation

1.3.5.1 Event Batch Job Planning Configuration

NF-e EventsBatches that package events require a number range to identify and to monitor the batches in process. In the Event Batch Monitor,you can use this number range to access all events that the system has pooled in one batch. Use transaction code SNUM to createthe number range for the object /XNFE/EVBT, and create interval 01 with a length of 15 digits.CT-e EventsCT-e events are not authorized in packages. Every event is sent individually and synchronously.

Batch Job PlanningNF-e EventsCreate the batch job for the event batch sending by using the program /XNFE/EVENT_BATCH_SEND.CT-e EventsCreate the batch job for the CT-e event authorization by using the program /XNFE/CTE_EVENT_SEND.

1.3.5.2 Activating Services for UI Display of Event Monitors You must activate the relevant UI services for master data maintenance and for monitoring of central messaging.

Procedure1. Enter transaction code SICF and choose Execute.2. Select the following entries in the navigation tree for the Virtual Hosts/Services under default_host sap bc webdynpro xnfe .3. Activate the service for displaying the user interfaces for each of the following entries by using the context menu and selecting

Activate Service:event_monitor for Event Monitor Outboundevent_monitor_IB for Event Monitor Inboundevent_batch_monitor for Event Batch Monitorssf maintenance for SSF maintenance

4. In addition, you must activate the following basic services in the navigation tree for the Virtual Hosts/Services under default_host sap public bc :ur for Unified Renderingicons for SAP Iconsicons_rtl for Icons RTLpictograms for Pictogramswebdynpro for Web Dynpro MIME Handling

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 49 of 174

1.3.5.3 User Roles and Authorizations for Events The core application in SAP Nota Fiscal Eletrônica (SAP NFE) contains the following roles with their relevant authorization objects. Youcan copy the roles as templates and assign them to users according to your company's needs.User Roles/XNFE/WP_NFE_OUT_MONITORThis role is does not contain authorizations and is therefore only meant to create and set up the user menu for the NF-e OutboundMonitor. You can copy this role to adjust the user menu according to your requirements. This role can be combined with other roles ina composite role./XNFE/WP_NFE_ADMINThis role is intended for the NFE Administrator. It does not contain authorizations and is therefore only meant to create and set up theuser menu. You can copy this role to adjust the user menu according to your requirements. This role can be combined with other rolesin a composite role.

AuthorizationsFor information concerning authorizations, refer to the security guide of SAP Nota Fiscal Eletrônica (http://help.sap.com/nfe).

1.3.5.4 Configuration for Digital Signature Validation To validate a digital signature in SAP NetWeaver, you need to define the following settings:

SSF: Trust ManagerExecute transaction STRUST. For the SSF application NFE_IN, you must import the public CA certificates from your businesspartners. When the signing certificate of your business partner is issued by Certisign, you have to import the public CA certificatefrom Certisign. If another business partners has SERASA as issuer; then you have to import the public CA certificate fromSERASA, too. Do this for all other certificate providers of your business partners. For more information, see SAP Note 1524196,attachment NFE_Digital_Signature_Guide.pdf, and NF-e/CT-e Administrator.Define Control Parameter for Signature ValidationTo overcome the problem that the certificate of an authorized document has expired during the sending to the business partner, youcan set a customizable switch to reference validation. This validation (together with the authorization check) also prevents fraud andis independent of the sender’s certificate expiration date. During the reference validation, the message digest is calculated andchecked against the persisted digest after the authorization step. Set the Value field of the IMG activity Define Control Parameters forProcess Steps to blank (= Signature Validation), or 1 (= Reference Validation) for the relevant CNPJ, process type and step.

1.3.6 Related Configuration in SAP ERP To be able to process electronic fiscal documents (such as NF-e or CT-e) and post the follow-on documents in the SAP ERP system,you must ensure that you have made the necessary Customizing settings in the SAP Customizing Implementation Guide (IMG) in yourSAP ERP system.

Activities

General SettingsIn the IMG of your SAP ERP system, make the necessary settings in Customizing for Cross-Application Components under GeneralApplication Functions Nota Fiscal . For details about the settings to be made, see the documentation for each Customizing activity inthe system.You can find an overview of the necessary Customizing settings in the Application Help for the SAP ERP solution for Brazil on the SAPHelp Portal under http://help.sap.com/ SAP Business Suite SAP ERP SAP ERP Central Component SAP ERP CentralComponent SAP Library SAP ERP Central Component Logistics Country Versions Americas Brazil Cross-ApplicationComponents Nota Fiscal Electronic Fiscal Documents .

Settings Specific to Incoming AutomationIf you use the automated functions for processing incoming NF-e, you must make the corresponding Customizing settings in the IMG ofyour SAP ERP system under Cross-Application Components General Application Functions Nota Fiscal Electronic FiscalDocuments Incoming NF-e Automation . For details about the settings to be made, see the documentation for each Customizingactivity in the system.If you use the automated functions for processing incoming CT-e, you must make the corresponding Customizing settings in the IMG ofyour SAP ERP system under Cross-Application Components General Application Functions Nota Fiscal Electronic FiscalDocuments Incoming CT-e Automation . For details about the settings to be made, see the documentation for each Customizingactivity in the system.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 50 of 174

1.4 Outbound The Outbound of SAP Nota Fiscal Eletrônica has the scope to automate and monitor the authorization with government systems and toissue NF-es, CT-es and Events to business partners.The Outbound of SAP Nota Fiscal Eletrônica consists of the following:

NF-e Outbound for XML Layout 2.00NF-e Outbound for XML-Layout 3.10+CT-e Outbound

1.4.1 NF-e Outbound for XML Layout 2.00 The NF-e outbound for XML layout 2.00 of SAP Nota Fiscal Eletrônica manages the authorization with federal tax systems and issuanceto customers of electronic invoices:

NF-e issuing through Batch and Batch Status RequestEvents for Cancellation and Correction LetterSkippingService Status checkABAP Digital SignatureContingencyBADI for enhancementsMonitors for NFE processes: Batch, NF-e, Events

The NF-e outbound for XML layout 2.00 of SAP Nota Fiscal Eletrônica consists of the following topics:Communication Flow for Sending NF-esNF-e Outbound MonitoringNFE Communication Process MonitoringDocument Monitoring in SAP ERPNF-e MonitorNF-e Batch MonitorStop NF-e Batch ProcessingNF-e Service Status MonitorNF-e Technical MonitoringB2B Monitoring of Inbound MessagesMonitor SAP NetWeaver PIBAdIs for Outbound NF-e

1.4.1.1 Communication Flow for Sending NF-es with Layout2.00 This section provides an overview of the interaction between the different components of the SAP Nota Fiscal Eletrônica (SAP NFE)shipment based on the example process of sending notas fiscais eletrônicas (NF-es). You can apply the explanations for each NF-eprocess step to such secondary processes as canceling or skipping NF-es.

Process

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 51 of 174

Process Overview for Sending NF-es

1. Create an electronic fiscal document in SAP ERPTo create an electronic fiscal document in a logistics process, you need country-specific information contained in an NF-e.For more information about the role and the handling of NF-es in the Brazilian billing process, see SAP Library for SAP ERP under SAP Solutions SAP ERP SAP ERP Central Component <Release> SAP ERP Central Component Logistics Country VersionsAmericas Brazil Sales and Distribution (SD) .

2. Receive NF-e data in the SAP NFE core applicationThe system transfers all required data in a NF-e from the SAP ERP feeder system to the SAP NFE core application, which stores thedata with a common identifier and a reference to the feeder system document.

3. Sign NF-eThe authorities require that each NF-e be signed by using a certificate that they have issued. Each NF-e is signed individually withinthe ABAP stack using the certificate that is stored in the STRUST table.

4. Queue signed NF-esThe core application saves the signed NF-es for later reference and also queues them for the next process step.

5. Create batch in core applicationThe authorities only accept NF-es in batches that cannot exceed a certain size. The system applies all requirements from theauthorities when batching signed NF-es.

6. Send NF-e batch to SAP NetWeaver PIThe SAP NFE system sends the batch asynchronously to SAP NetWeaver PI using the standard PI adapter.

7. Send NF-e batch from SAP NetWeaver PI to authoritiesSAP NetWeaver PI routes the batches to the correct addressee. It also functions as bridge for switching to synchronous messagingor for performing necessary mappings. For communicating with the authorities, an HTTPs connection using the company-specificcertificate from the government via SOAP is required.

8. Receive average timeframe from authorities for status availabilityWhen the authorities receive the batched NF-es, they automatically send a response via SAP NetWeaver PI with the average time(in seconds) that it took to set the NF-e batch status.

9. Prepare request for NF-e status informationAfter SAP NetWeaver PI transmits the authorities' response to the SAP NFE core application, the core application schedules asystem status request message to send to the authorities, based on your settings in Customizing.

10. Set NF-e government status (authorities)The authorities set the status for all NF-es in the batch for which they have provided a time estimate. The status is stored in theauthorities' system until your company retrieves it

Authorities can reject NF-es due to technical problems or other reasons. You can solve this issue if you initiate the skippingprocess by canceling the rejected NF-e in the SAP ERP feeder system. If the authorities return the NF-e with status Denied, thatmeans that a severe credibility problem has occurred.

11. Request status information from authoritiesAfter the time set by the authorities for collecting status data has elapsed, the SAP NFE core application uses the standard PIadapter to send the status request to SAP NetWeaver PI. SAP NetWeaver PI then routes the request via the SOAP adapter to theauthorities.

12. Receive authority status in SAP NFE core applicationThe SAP NFE system receives the government status for the NF-es via SAP NetWeaver PI and updates the status informationaccordingly.

13. Forward NF-e status to SAP ERP

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 52 of 174

The SAP NFE core application sends the government-issued status to SAP ERP.14. Update status of billing document in SAP ERP

The billing process is terminated and changes to goods movement processing.15. Send NF-es to SAP NetWeaver PI

The SAP NFE system uses the standard PI adapter to send the NF-es to SAP NetWeaver PI.16. Send NF-es from SAP NetWeaver PI to B2B receiver

SAP NetWeaver PI routes the NF-es to the correct B2B addressee. An HTTPs connection is required to communicate with the B2Breceiver.

The authorities require the receiving and issuing companies to keep the records of exchanged NF-es and of cancellation requeststhat the authorities authorized or denied. SAP NFE provides business-to-business (B2B) scenarios to automatically transfer andstore XML files. If your company decides to exchange NF-es with its business partners, you must activate this electroniccommunication for the B2B scenarios via Customizing in the SAP NFE core application. The core application then sends the NF-esand routes them to SAP NetWeaver PI for further processing.The adapter you use to send NF-es in SAP NetWeaver PI for B2B scenarios depends on your agreements with the businesspartners. All adapters available with SAP NetWeaver PI are possible.

More InformationSetting up and configuring the individual components required to enable the communication process is described in Configure SAPNota Fiscal Eletrônica.Monitoring the communication process is described in NF-e Outbound Monitoring.

1.4.1.2 NF-e Outbound Monitoring SAP Nota Fiscal Eletrônica (SAP NFE) runs in different components when communicating with regional tax authorities. SAP NFE givesyou access to monitors with differing levels of detail to control the communication process and to solve problems. You can use themonitors in the following systems:

SAP ERP feeder system: see Document Monitoring in SAP ERPSAP NFE core application: see Communication Process Monitoring in the Core ApplicationSAP NetWeaver PI for SAP NFE: see Monitor SAP NetWeaver PI

1.4.1.2.1 Document Monitoring in SAP ERP Invoice processing in SAP ERP is status-oriented. Therefore SAP Nota Fiscal Eletrônica immediately synchronizes all invoice statuschanges with the data in the SAP ERP feeder system. SAP ERP provides a monitor that lists the notas fiscais eletronicas (NF-es) alongwith their statuses.

FeaturesYou can use transaction J1BNFE to access the NF-e monitor in the SAP ERP feeder system.You can open each NF-e to display its details, including the history of document status changes.You can cancel NF-es or start the contingency process for NF-es from this monitor.

More InformationFor more information about processes and process monitoring, see the topic Electronic Nota Fiscal (NF-e) in the SAP Library under SAP Solutions SAP ERP SAP ERP Central Component <Release> SAP ERP Central Component Logistics Country Versions Americas Brazil Cross-Application Components Nota Fiscal .

1.4.1.2.2 NF-e Communication Process Monitoring (Outbound)for Layout 2.00 The monitoring options in the core application of SAP Nota Fiscal Eletrônica (SAP NFE) provide you with a single point-of-entry for

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 53 of 174

tracking the communication statuses of NF-es (both individual and batched), and the communication process between the NFEapplication and the authorities' system. In case of communication failures, the NFE core application monitors allow you to triggerresending and rechecking of NF-es, batches, and related messages.

ProcessThe following monitors are available:

The XI Message Monitoring displays processed XML messages.The NF-e Monitor displays an overview list of all NF-es sent individually to government systems and to business partners, along withall NF-e-related messages. You can also resend certain messages from the filtered lists in this monitor.The NF-e Batch Monitor displays the messages you send to and receive from government systems about the status of NF-e batches.The NF-e Service Status Monitor displays the messages you send to and receive from government systems about government Webservice availability.The B2B Monitor displays the NF-es that you receive from business partners in a B2B scenario (see B2B Monitoring of InboundMessages).NF-e Technical Monitoring: You can use the monitoring functions in SAP NetWeaver to identify technical problems in thecommunication process on a detailed level.

1.4.1.2.2.1 NF-e Monitor (Outbound) for Layout 2.00 The NF-e Monitor is a single point-of-entry for monitoring the document and process status of notas fiscais eletrônicas (NF-es), as wellas for monitoring communication with government systems and with business partners in business-to-business (B2B) scenarios. It allowsyou to download the XML files for NF-es, along with all authorization, cancellation, and skipping messages that you are legally requiredto keep as records. You can also re-send messages from this monitor that your system was unable to send due to technical reasons.

FeaturesBased on your selection criteria, the monitor by default displays the NF-e Overview tab page, and gives you access to other tab pages.

NF-e OverviewThe tab page Overview lists successfully processed NF-es and NF-e sending failures with their main header data and the statusinformation. This includes the overall document status and the status code from the authorities, as well as possible error messagesfrom the authorities.

You can display the invoice details by choosing an NF-e's Access Key column for one list entry or by selecting its line and choosingNF-e Details. The detail view lists both header and item data relevant for the authorities.By choosing a Batch Number , you can navigate to the details display of the NF-e Batch Monitor for the selected NF-e batch.You can continue the process for erroneous NF-es (only for NF-es with the icon ) by selecting one or several lines and choosingContinue Process.

The process does not continue for NF-es with B2B errors or NF-es ready for status check. To restart NF-es with B2B errors, usethe Outbound B2B Errors tab. For the NF-e status check, navigate to the details view or the Status Check tab.

Query EventsTrigger the status update for the selected NF-e to receive all known events from the authorities.

Signature ErrorsThe tab page Signature Errors lists all messages from the overview page that encountered a signature error. This could be caused bythe unavailable Web service for signing NF-es, cancellations, or skipping requests.

The error details are specified in the Error Status column.You can restart the signing process by selecting a signature error line and choosing Restart.

Cancellation ErrorsThe Cancellation Errors tab page displays all NF-es that the system failed to cancel.

The reason for each error is specified in the Error Status column. You can continue to research the problem or solve it based on thestatus information.You can resend a cancellation request by selecting its line and choosing Restart.

Skipping ErrorsThe Skipping Errors tab page displays all NF-es that the system failed to send. The authorities require consecutive numbers for the NF-es in your records. When the authorities reject a NF-e, it uses up a number that cannot be reused again. To inform the authorities aboutthe gap in the consecutive numbering, you must request the skipping of the used number. The skipping request process is initiated bycanceling the NF-e in the ERP feeder system.

The reason for the failed skipping is specified in the Error Status column. You can continue to research or solve the problem based onthe status information.You can resend a skipping request by selecting its line and choosing Restart.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 54 of 174

Outbound B2B ErrorsThe Outbound B2B Errors tab page displays all NF-es for your business partners that the system failed to send.

The reason for the failure is specified in the Error Status column. You can continue to research or solve the problem based on thestatus information.You can resend a NF-e to the business partner by selecting its line and choosing Restart.

ERP Status Update ErrorsThe ERP Status Update Error tab page displays all NF-es that were not processed by the ERP system.

ERP status update error (0)The reason for the failure is specified in the ERP Error column. To see the description of the ERP error, click on the error and open theapplication log popup window. You can continue to research or solve the problem based on the information in the message log.You can resend the NF-e to the ERP system by selecting its line and choosing Update.Deletion of ERP ErrorsIf you still receive an ERP update error (for example, 109) after making sure that the NF-e's ERP status is correct and matches theSAP NFE status (for example, 101–NF-e Cancellation Authorized), you can choose Delete to delete the selected ERP error. Afterdeletion, an application log entry indicates that the deletion was an intentional decision.

Only the ERP error is deleted and not the NF-e. Check the ERP and NFE systems manually to avoid inconsistencies before youdelete an ERP error.

After you manually delete an ERP error, it is no longer possible to update the NF-e status in ERP.

Other ErrorsOn the Other Errors tab page, all NF-es with errors are listed that do not belong in the above categories and cannot be processed in theNF-e Monitor. These remaining errors can either be processed in the NF-e Batch Monitor, or they are sent back to the ERP system.Error Status Description10 Validation Error31–46 Batch Errors57–58 Gap Errors71–75 Errors from Authorities

Status ChecksOn the Status Checks tab page, you can check the SEFAZ status of up to 49 NF-es at once. For individual NF-es, also check StatusRequest in the NF-e Overview above.

NF-e DetailsThe detail view lists both header and item data relevant for the authorities, for example:

Status information such as process status, error status, and status code.Information about the NF-e sender and recipient, including their respective tax identificationsInvoice item data in SAP ERP, including values and quantities on which the tax calculation is based

You can also choose the following functions in the application toolbarHistoryYou can track the overall statuses and error statuses that the system or the authorities have set for an individual NF-e, including thetime that each status was set.XML DownloadYou are required to keep each NF-e and related skipping or cancellation requests in your records. You can also download the XMLfor these messages to save offline.B2B Status HistoryYou can display all statuses and their timestamps for each NF-e or cancellation message that you sent to your business partner.Status QueryIf the system fails to retrieve the status information for NF-es, cancellations, or skipping requests because of technical reasons, youcan manually send a status request to the authorities. The government is required to keep batch-based NF-e statuses only for aspecific period. If you cannot collect the status of NF-es on a batch level, you must request the NF-e status for each NF-e individually.Sending a status request for individual documents is possible only after the time period that you defined in the Customizing haselapsed.As a new function, you can select several NF-es from a list and carry out status checks in the Details of the NFE Monitor. You canalso check the status of individual NF-es with this function.

On the Status Query tab page, you can select up to 49 NF-es and receive the SEFAZ status for several NF-es at once.

Log DisplayExit Skipping

Note

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 55 of 174

If you receive a 256 or 563 rejection from the authorities (SEFAZ), it means that you are requesting a 'second' skip for this ID-numberof this NF-e. This problem happens only if the SKIP request was delivered to SEFAZ and the response from SEFAZ invalid, such as a999 status or communication error.To clarify the SEFAZ status (102) you must set the ERP/NFE status manually. Choose finish skipping in the details view of theskipped NFE and a popup will appear with input fields for the data from the SEFAZ web site:

Protocol numberDate/time of authorization

The protocol number proves that the skipping was successful at SEFAZ. Further, the following entry about the skipping is archived:The protocol data (skip NF-e) was entered manually by the user due to communicationproblems with SEFAZ..Send XML FileYou have the option to send an XML using the Send XML File pushbutton. This button is active if the NF-e or cancellation is authorizedand the B2B scenario for the business partner is activated. You can either choose the normal NF-e or the Cancel NF-e/Cancellationevent to be sent to your business partner (NF-e Recipient or NF-e Carrier). The following situations are supported:

The XML file was not yet sent due to the fact that the B2B scenario for the business partner was not activated. After activation of theB2B scenario and sending, the Process Status , the History, and the B2B Status History will be updated accordingly.The XML file was already sent. After sending, the Process Status, the History , and the B2B Status History remain unchanged.However, the protocol is visible in the Log Display.If the cancellation was sent as an event (NF-e Events: Cancellation Event), then this event is sent to the business partner. Only ahistory entry for the cancellation event is added.The cancellation event can only be sent if the event was authorized during the event processing.

Errors during the initial B2B sending process must be solved in the Outgoing B2B Error tab or in the Event Outbound Monitor (forCancellation Events) and cannot be solved using the Send XML File function.

Accessing the NF-e MonitorYou can access the NF-e Event monitor in the core application of SAP NFE via one of the following options:

You can call up the specific menu NF-e Monitor from the user role /XNFE/WP_NFE_OUT_MONITOR (Outgoing User Menu).You can navigate to the menu option in the navigation structure of the Monitor Outgoing Messages for the SAP NFE core application.You can access this option from the user role by choosing NF-e Monitor .

NF-e EventsThere are three different types of user interfaces: The first UI is for events embedded into the NF-e Monitor and two additional monitorsfor the monitoring of communication processes in the core application, similar to the NF-e outbound and batch monitors.Events in the Fiscal Workplace and the Outbound/Inbound MonitorThe main purpose is to provide information to the Fiscal Clerk about events. The Fiscal Clerk must decide how running processes areaffected. On a tab embedded into the workplace, a list of the current authorized and pending events (both self-issued and others) aredisplayed. The Fiscal Clerk can display all events (also former versions of self-issued events) in a dialog box. By selecting one event,you can display its content depending on its type (that is the free text for CC-es). Then you have to decide if the processing of thecorresponding NF-e is affected. (If yes, this implies an interference of the events with the NF-e status handling)Monitor for the Administrator for Issued Events and BatchesThis monitor is intended to handle occurring technical problems with the sending of events and receiving of replies from the taxauthorities. The status update with ERP should be similarly set up as the update of the NF-e outbound and batch monitor.Events in NF-e MonitoringOn a tray embedded into the NF-e monitor, a list of the current authorized and/or pending events (both self-issued and others) for oneNF-e is displayed. You can check the status of all events of an NF-e at SEFAZ using the button Check Events. This check retrieves newevents for the NF-e and updates the status of current events in the list. There is only one event per type in the list. The Events trayappears below the Result tray after selecting a line in the list of the NF-e Overview tab. In the Events tray the following buttons areenabled after selecting one line of the events list:

You can display the content of one event depending on its type (that is the free text for CC-es) by selecting one line and choosing Select Details Event Details .By choosing Select Details Display Event XML you can open or save the XML document.By choosing Event Status you can display the current and former process steps with status icon, activity, process type, statusdescription, and info text.By choosing Event History you can display the history of an event with status icon, activity, process type, status description, info text,execution date and time, and user.In a dialog box, you can see all other available versions of the selected event by choosing Display Versions.Send XML FileYou have the option to send an event XML using the Send XML File Again pushbutton. This button is active if the event is authorizedand the B2B scenario for the business partner is activated. You can choose to send the event XML to one of your business partners,either the event recipient or NF-e carrier. The following situations are supported:

The XML file was not yet sent due to the fact that the B2B scenario for the business partner was not activated. After activation, theProcess Status of the event process will not be changed, because this step was already marked during processing as not relevantfor the event. A history entry is added.The event XML file was already sent successfully. The Process Status of the event process will not be changed, because this stepwas either already marked during processing as not relevant for the event, or already successfully executed. A history entry isadded.

Errors during the initial B2B sending process must be solved in the Event Outbound Monitor and cannot be solved using the SendXML File function.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 56 of 174

By choosing Refresh the event list is updated to the latest version.Events in B2B Inbound MonitoringOn a tray embedded into the NF-e B2B Inbound Monitor, a list of the current authorized and/or pending events (both self-issued andothers) for one NF-e is displayed. There is only one event per type in the list. The Events tray appears below the Result tray afterselecting a line in the list of the NF-e Overview tab. In the Events tray the following buttons are enabled after selecting one line of theevents list:

You can display the content of one event depending on its type (that is the free text for CC-es) by selecting one line and choosing Select Details Event Details .By choosing Select Details Display Event XML you can open or save the XML document.By choosing Event Status you can display the current and former process steps with status icon, activity, process type, statusdescription, and info text.By choosing Event History you can display the history of an event with status icon, activity, process type, status description, info text,execution date and time, and user.In a dialog box, you can see all other available versions of the selected event by choosing Display Versions.By choosing Refresh the event list is updated to the latest version.

1.4.1.2.2.2 NF-e Batch Monitor (Outbound) for Layout 2.00 The NF-e batch monitor displays the statuses of the NF-es that you have sent in batches to the authorities, along with the results of thebatch status requests that you have sent to the authorities.

FeaturesBased on your selection criteria, the batch monitor displays the following:

The Overview tab page displays the main header data and status information for all batches you have sent (successful or not).You can display the details of a specific batch by choosing its Batch Number or by selecting its line and choosing Batch Details.The details view displays:

Batch header dataA list of the individual NF-es in the batchThe processing status of the batch in both your system and the authorities' system.You can access the details of a specific NF-e in a batch by choosing the corresponding access key or by selecting thecorresponding row and choosing NF-e Details.

You can restart erroneous batches by selecting one ore several rows and choosing Restart.The Batch Send Incorrect tab page displays all the batches for which the sending process failed.

Error details are specified in the Error Status column.You can restart the batch sending process by selecting a line and choosing Restart.

The Batch Status Query Incorrect tab page displays all failed batch status requests.Error details are specified in the Error Status column.You can restart the batch sending process by selecting a line and choosing Restart.

Restart for NF-e Batches with ErrorsYou can select an NF-e batch with an error from the Overview or one of the other tab pages and then check the problem description.After correcting the problem, you can restart the process using the Restart button.Ending NF-e Batch processingYou can select an NF-e batch with an error from the Overview or one of the other tab pages and then check the problem description viathe Batch Details button. If you cannot correct the problem and a restart is not applicable, for example due to technical problems withthe Sefaz system (status code 999), you can end the batch process using the End the Batch Process button on the Overview or one ofthe other tab pages. This finishes the batch process and sets the status of every NF-e withouit SEFAZ status code in the batch to Error.The new status for every individual NF-e of the batch allows you to continue the NF-e process in the error tab of the NF-e monitor. Toreceive a valid status from Sefaz, the NF-e status check requests a status for every individual NF-e.Abandoning the batch process is possible, if the Sefaz status code of the batch is filled and is not 104 (Batch Processed) and an errorstatus of the batch exists, but not 73 (temporary error on the government side, batch is still in process) and not 70 (Error on thegovernment side, NF-es received the status from the batch).

By ending the batch processing, an NF-e status request is only possible via NF-e status check. The NF-e will be set to error andneeds to be manually started in the NF-e Monitor. Resending the NF-e to SEFAZ is no longer possible in the NFE system!

DetailsThis function is intended to enable the user to decide to stop the batch processing. The process continues with an NF-e status checkand the result of the status check is then sent to ERP.

The End function is the same as for CT-e and event processing.The following scenario applies: Batch send did reach SEFAZ (batch statcode filled), but the NF-es have no status yetNew error status: batch was manually endedwasstat remains unchangedStatus code is empty (not from batch). This is due to the fact that a status check is required anyway.The batch history pop-up illustrates the detailsNew status for manually ended batch process is created to illustrate the special situation in the overview and detail tab

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 57 of 174

ActivitiesYou can access the NF-e batch monitor in the core application of SAP Nota Fiscal Eletrônica (SAP NFE) by using one of the followingoptions:

Call up the specific menu NF-e Batch Monitor from the user role /XNFE/USERMENU (NF-e User Menu).Navigate to the menu option in the navigation structure of the NF-e Main Menu in the SAP NFE core application. You can access itfrom the user role by choosing Monitor Batch .

1.4.1.2.2.3 Stop NF-e Batch Processing This function is intended to enable the user to decide to stop the batch processing. The process continues with an NF-e status checkand the result of the status check is then sent to ERP.

This is the same function as for CT-e and Event.Scenario: Batch send did reach SEFAZ (batch statcode filled), but NF-es have no status yetNew error status: 'batch was manually ended'wasstat remains unchangedStatus code is empty (not from batch) because you have to do a status check anywayenhance batch history pop-up to show userNew status for manually ended batch process to illustrate the special situation in overview tab and detail

ProcessAbandoning the batch process is NOT possible, if1. The status code is

empty104 (Batch processed)

2. The error status isempty73 (temporary error on the government side, batch is still in process)70 (Error on the government side, NF-es received the status from the batch)

1.4.1.2.2.4 NF-e Service Status Monitor (Outbound) for Layout2.00 This monitor in SAP Nota Fiscal Eletrônica (SAP NFE) lets you check the results of service status inquiries that the system automaticallyperforms. The service status indicates the authorities' system availability.Each company is required to regularly check the authorities' system availability at a defined interval. You use this status information todetermine if you must start the contingency process in the feeder system SAP ERP manually in order to process your goods movementinvoices in a timely fashion.

You can only use the NF-e Service Status Monitor (Outbound) for Layout 2.00 if you use SCAN as contingency system. If you useSVC as contingency system, you have to use the NF-e Service Status Monitor (Outbound) for Layout 3.10+.

ActivitiesYou can access the NF-e service status monitor in the SAP NFE core application by using one of the following options:

Call up the Service Status menu from the user role /XNFE/USERMENU (NF-e User Menu).Navigate to the menu option in the navigation structure of the NF-e Main Menu, which you can access from the user role by choosing

Monitor Service Status .Status MonitorYou can display the result of the batch job run in the status monitor. For more information how to plan a batch job, see the batch jobService Status Check in NF-e Batch Job Planning (Outbound).Status CheckFor more information, see NF-e/CT-e Administrator.

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 58 of 174

1.4.1.2.2.5 NF-e Technical Monitoring You can use the following SAP NetWeaver monitoring options to detect problems in the communication processes for SAP Nota FiscalEletrônica (SAP NFE):

FeaturesMessage MonitorSystem communication between the SAP NFE core application and SAP NetWeaver Process Integration (SAP NetWeaver PI) usesproxies. In addition to checking for any communication issues via the process monitors of the SAP NFE core application, you can usetransaction SXMB_MONI to access the technical monitors that include the details of all messages sent to and from SAP NetWeaverPI.

If the core application receives a message from SAP NetWeaver PI with a red flag, you can start the message again.If the SAP NFE system sends a message to SAP NetWeaver PI you can look for the error code within the message.

Monitor for Remote Function Calls (RFCs)The system communication between the SAP ERP logistics feeder system and the SAP NFE core application uses synchronousRFCs. You can monitor the result of the RFCs in both the feeder system and in the core application by using transaction RSRFCTRC.

To monitor RFCs in the SAP ERP system, look for functions whose technical names begin with /XNFE/.To monitor RFCs in the NFE core application, look for functions whose technical names begin with J_1BNFE.

Monitor PI QueuesSAP NetWeaver PI uses RFCs to communicate between the integration engine (SAP NFE core application) and the integration server(PI). You can monitor the PI queues and their statuses on both systems or clients.

To track the outbound queue, use transaction SMQ1To track the inbound queue, use transaction SMQ2

Application LogThe system logs all system activities related to the NF-e batch processing for the object /XNFE/BATCH. This includes sending NF-esto the authorities in batches as well as the status information that the authorities set for these NF-es. You can use transaction SLG1 toaccess the application logs for log object /XNFE/BATCH. You can limit the search results by using the batch ID.The application log is integrated with the batch monitor, where you can access the application log by selecting Job Log.

1.4.1.2.2.6 B2B Monitoring of Inbound Messages You can monitor inbound NF-es or cancellation messages by using the optional business-to-business (B2B) scenario for exchanging NF-es and related messages with your business partners. Because the authorities require you to keep records for all B2B NF-es andcancellations, SAP Nota Fiscal Eletrônica (SAP NFE) automatically archives all inbound and outbound messages.

SAP Nota Fiscal Eletrônica 10.0 introduces two work centers for the B2B inbound scenario: the NF-e Fiscal Workplace and the NF-eLogistics Workplace. This means that B2B Monitoring for Inbound Messages is relevant only for the maintenance of older B2Brecords after a version upgrade, such from SAP Nota Fiscal Eletrônica 1.0 to 10.0.

FeaturesBased on your selection criteria, the monitor displays an overview of all incoming messages from the business partner. You can displayand download, for example, NF-e identification and status data.

The status data from your business partner is shown in the Status Code column, and the status data from the authorities is shown inthe Checked Status column.

ActivitiesYou can access the B2B monitor in the SAP NFE core application by using one of the following options:

Call up the specific menu B2B Incoming from the user role /XNFE/USERMENU (NF-e User Menu).Navigate to the menu option in the navigation structure of the NF-e Main Menu, which you can access from the user role by choosing

Monitor B2B Incoming .

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 59 of 174

1.4.1.2.3 Monitor SAP NetWeaver PI You can use the monitoring options in SAP NetWeaver Process Integration (SAP NetWeaver PI). SAP NetWeaver PI to detect problemswith or view the details of many technical process steps.

FeaturesYou can use transaction code SXMB_IFR to access the following Java-based monitors in the SAP PI Runtime Workbench of theIntegration Builder to track communication process steps in SAP NetWeaver PI:

The Component Monitor can help you identify problems in the different components that SAP NetWeaver PI uses during thecommunication process. This includes, for example, monitoring the proxies sent to the core application of SAP Nota FiscalEletrônica, as well as the Integration Engine or the Adapter Engine of the Integration Server.The Message Monitoris the main entry point for retrieving detailed information about individual messages.

For this monitor, use a specific communication process (integration scenario) as the selection criterion.

The Adapter Monitor can help you detect problems in the message flow from the SAP NFE core application to SAP NetWeaver PIcaused by the adapter.Monitoring the adapter is critical if you are trying to find the reason why expected messages from the government are still missingeven when the authorities state that the communication was completed successfully from their side.

An additional monitor is available via transaction SXMB_MONI for tracking individual messages that SAP NetWeaver PI receives orsends to communication partners.If you have configured alerts for SAP Nota Fiscal Eletrônica in SAP NetWeaver PI, the system sends an e-mail notification to thespecified responsible user when it detects a problem in the communication process steps.You can also access the alert monitor in the SAP PI Runtime Workbench of the Integration Builder. For more information, see NF-eAlert Configuration.

More InformationFor more information about the monitoring options in SAP NetWeaver PI, see the topic Central Monitoring in the SAP Library under Functional View SAP NetWeaver by Key Capability Process Integration by Key Capability SAP NetWeaver ExchangeInfrastructure Runtime .

1.4.1.3 BAdIs for Outbound NF-e The following BAdIs (Outbound) are available for SAP Nota Fiscal Eletronica (NFE):

BAdI: Extend NF-e with Feeder System DataWith this BAdI, you accept additional data from the feeder system and integrate the data into the XML for the electronic Nota Fiscal(NF-e). You need this additional data, for example, to report industrial-specific information to the authorities.BAdI: Call Non-SAP System via RFC CommunicationYou use a Business Add-In (BAdI) to control the RFC call. The BAdI lets you control the RFC call for communication with the ERPsystem, to use the electronic communication of notas fiscais with the authorities for non-SAP systems. In the standard settings, thesystem uses the standard SAP modules to call SAP ERP for RFC communication with the ERP system.Two function modules are used to call non-SAP systems, one to report the status of NF-es, and one for events. The implementation ofthe BAdI determines if the standard or the non-SAP function modules are called. Function module /XNFE/XML_IN_TAB reports thestatus of NF-es to non-SAP systems. Tables parameter CH_XMLTAB includes the following important fields:I_DOCNUM (NF-e document number)I_AUTHCODE (Protocol number from SEFAZ)I_CODE (Status code from SEFAZ)I_ID (44-character access key)I_MSGTYP (A code that determines if the NF-e is authorized or not: 1: NF-e authorized, 2: NF-e rejected, 3: NF-e denied, 4:Cancellation authorized, 5: Skipping authorized, 6: Cancellation rejected, 7: Skipping rejected)I_AUTHDATE (NF-e Processing Time – Date from SEFAZ)I_AUTHTIME (NF-e Processing Time – Time from SEFAZ)

Tables parameter CT_BAPIRET2: If an error occurs in the target system, the error status with one or more error texts can bereturned with the help of a BAPIRET2 table.Function module /XNFE/NFE_EVENT_IN reports the status of Events to non-SAP systems. Tables parameter IT_EVENTS includesthe following important fields:DOCNUM (NF-e document number)EXT_EVENT (Type of Event)SEQNUM (Internal Sequence Number)EXT_SEQNUM (SEFAZ Sequence Number)ACCKEY (44-character NF-e access key)AUTHCODE (Protocol Number from SEFAZ)REPLY_TMPL (Events: Registration Timestamp)

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 60 of 174

CODE (Status code from SEFAZ)MSGTYP (A code that determines if the event is authorized or not 1: Event authorized, 2: Event rejected)EXT_REPLY_TMPL (Events: Registration Date/Time)

Tables parameter CT_BAPIRET2: If an error occurs in the target system, the error status with one or more error texts can bereturned with the help of a BAPIRET2 table.BAdI: Sign Outgoing NF-esThe BAdI enables a synchronous proxy call of an external signature service (through external signature hardware, for example, or anexternal Web service), to circumvent the standard signature implementation in ABAP.BAdI: Extend B2B Message with AttachmentYou use this BAdI to control the creation of attachments when sending the NF-e to a business partner (consignee or carrier).

For more information, see the documentation for the BAdIs in Customizing under Nota Fiscal Eletrônica Outbound BusinessAdd-Ins for Outbound NF-es .

1.4.2 NF-e Outbound for XML-Layout 3.10+ The NF-e outbound for XML layout 3.10 and higher of SAP Nota Fiscal Eletrônica manages the authorization with federal tax systemsand issuance to customers of electronic invoices:

NF-e issuing through Batch and Batch Status RequestEvents for Cancellation and Correction LetterSkippingService Status checkABAP Digital SignatureContingencyBADI for enhancementsMonitors for NFE processes: Batch, NF-e, Events

The NF-e outbound for XML-Layout 3.10 and higher of SAP Nota Fiscal Eletrônica consists of the following topics:Communication Flow for Sending NF-es with Layout 3.10+NF-e Processing (Outbound) for Layout 3.10+NF-e Batch Processing for Layout 3.10+Monitor NF-e Outbound for Layout 3.10+NF-e Monitor (Outbound) for Layout 3.10+NF-e Batch Monitor (Outbound) for Layout 3.10+Monitor SAP NetWeaver PI for NF-e Layout 3.10+BAdIs for Outbound NF-e for Layout 3.10+

1.4.2.1 Communication Flow for Sending NF-es with Layout3.10+ This section provides an overview of the interaction between the different components of the SAP Nota Fiscal Eletrônica (SAP NFE)shipment based on the example process of sending an NF-e . You can apply the explanations for each NF-e process step to suchsecondary processes as canceling or skipping NF-es.

Process

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 61 of 174

Communication Flow

1. Create an electronic fiscal document in SAP ERPTo create an electronic fiscal document in a logistics process, you need country-specific information contained in an NF-e.For more information about the role and the handling of electronic fiscal documents (NF-es), see SAP Library for SAP ERP under SAP Solutions SAP ERP SAP ERP Central Component <Release> SAP ERP Central Component Logistics Country VersionsAmericas Brazil Sales and Distribution (SD) .

2. Receive NF-e data in the SAP NFE core applicationThe system transfers all required data in a NF-e from the SAP ERP feeder system to the SAP NFE core application, which stores thedata with a common identifier and a reference to the feeder system document.

3. Sign NF-eThe authorities require that each NF-e be signed by using a certificate that they have issued. Each NF-e is signed individually withinthe ABAP stack using the certificate that is stored in the STRUST table.

4. Queue signed NF-esThe core application saves the signed NF-es for later reference and also queues them for the next process step.

5. Create batch in core applicationThe authorities only accept NF-es in batches that cannot exceed a certain size. The system applies all requirements from theauthorities when batching signed NF-es.

6. Send NF-e batch to SAP NetWeaver PIThe SAP NFE system sends the batch synchronously to SAP NetWeaver PI using the standard PI adapter.

7. Send NF-e batch from SAP NetWeaver PI to authoritiesSAP NetWeaver PI routes the batches to the correct addressee. For communicating with the authorities, an HTTPs connection usingthe company-specific certificate from the government via SOAP is required.

8. Receive average timeframe from authorities for status availabilityWhen the authorities receive the batched NF-es, they automatically send a response via SAP NetWeaver PI with the average time(in seconds) that it took to set the NF-e batch status.

9. Prepare request for NF-e status informationAfter SAP NetWeaver PI transmits the authorities' response to the SAP NFE core application, the core application schedules asystem status request message to send to the authorities.

10. Set NF-e government status (authorities)The authorities set the status for all NF-es in the batch for which they have provided a time estimate. The status is stored in theauthorities' system until your company retrieves it

Authorities can reject NF-es due to technical problems or other reasons. You can solve this issue if you initiate the skippingprocess by canceling the rejected NF-e in the SAP ERP feeder system. If the authorities return the NF-e with status Denied, thatmeans that a severe credibility problem has occurred.

11. Request status information from authoritiesAfter the time set by the authorities for collecting status data has elapsed, the SAP NFE core application uses the standard PIadapter to send the status request to SAP NetWeaver PI. SAP NetWeaver PI then routes the request via the SOAP adapter to theauthorities.

12. Receive authority status in SAP NFE core applicationThe SAP NFE system receives the government status for the NF-es via SAP NetWeaver PI and updates the status informationaccordingly.

13. Triggering of B2B process (if configured) in SAP NFE core applicationIf configured in Customizing, the SAP NFE system triggers the B2B process and sends the XML file to the business partner.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 62 of 174

14. Forward NF-e status to SAP ERPThe SAP NFE core application sends the government-issued status to SAP ERP.

15. Update status of electronic fiscal document in SAP ERPThe process is terminated and changes to goods movement processing.

16. Send NF-es to SAP NetWeaver PIThe SAP NFE system uses the standard PI adapter to send the NF-es to SAP NetWeaver PI.

17. Send NF-es from SAP NetWeaver PI to B2B receiverSAP NetWeaver PI routes the NF-es to the correct B2B addressee. An HTTPs connection is required to communicate with the B2Breceiver.

The authorities require the receiving and issuing companies to keep the records of exchanged NF-es and of cancellation requeststhat the authorities authorized or denied. You can download XML files and send them to your business partners.

More InformationSetting up and configuring the individual components required to enable the communication process is described in Configuration ofNF-e Outbound.Monitoring the communication process is described in Monitor NF-e Outbound for Layout 3.10+.

1.4.2.2 NF-e Processing (Outbound) for Layout 3.10+ You can display and control the status of your NF-es for all listed processes in the NF-e Monitor (Outbound) for Layout 3.10+.

Process

Issue of NF-e with BatchThe process (Technical name: NFEISSU1) consists of the following steps:1. Create NF-e (technical name NFOCREAT)

The NF-e data is validated and transformed into XML.

If the validation or transformation fails, the NF-e data can be corrected and send again from the feeder system (ERP). The errorreason can be displayed by clicking the Application Log field in the Status Overview tab of the NF-e Monitor.

2. Sign NF-e (technical name NFOSIGNA)The NF-e is signed with the certificate of the NF-e issuer CNPJ (Maintain the SSF settings in Customizing activity Maintain SystemResponse for Own Tax Numbers.

3. Authorize NF-e (technical name NFOTOBAT)The NF-es are collected in batches and then send to the government system for authorization. Sending the batches is a separateprocess described in NF-e Batch Processing for Layout 3.10+.The status code can be authorized (for example: 100, 101, 102), or not authorized. For details about the error codes, see the currentSEFAZ NF-e manual on the SEFAZ website.

4. Trigger B2B Process (optional) (technical name NFOTRB2B)The B2B process is created as a separate process, for more information see the description of the Send NF-e to Business Partner(technical name NFEB2BSD) process below.

This step is only relevant if the NF-e was authorized.

5. Notify Feeder System (technical name NFOUPDFS)The status code is transferred to the feeder system (ERP).

After the successful execution of these steps, the process of issuing an NF-e is complete. However, the process can continue if acancellation or skipping is triggered in the ERP system.

Issue of NF-e CancellationThe process (Technical name: NFECANCL) consists of the following step:Is possible if the NF-e was authorized:1. Cancel NF-e (technical name NFOCANCL)

When a cancellation event arrives in NFE, the NF-e changes the process type to cancellation. If the cancellation event wasauthorized, the NF-e is updated in the event process step Update NF-e Data After Cancellation (For more information, see NF-eEvents: Cancellation Event). If the cancellation event was rejected, the NF-e status code remains authorized.

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 63 of 174

Issue of NF-e SkippingThe process (Technical name: NFESKPNG) consists of the following steps:Is possible if the NF-e was rejected1. Create Skipping (technical name NFOSKCRE)

The skip NF-e data is validated and transformed into XML.

If the validation or transformation fails, the skip NF-e data can be corrected and send again from the feeder system (ERP). Theerror reason can be displayed by clicking the Application Log field in the Status Overview tab of the NF-e Monitor.

2. Sign NF-e (technical name NFOSIGNA)The skip NF-e is signed with the certificate of the NF-e issuer CNPJ (Maintain the SSF settings in Customizing activity MaintainSystem Response for Own Tax Numbers.

3. Authorize Skipping (technical name NFOSKAUT)The skip NF-es are collected and then send to the government system for authorization. The status code can be authorized (102), ornot authorized. For details about the error codes, see the current SEFAZ NF-e manual on the SEFAZ website.

The report /XNFE/NFE_SKIP_SEND (must be scheduled as a background job) collects all skipping requests ready for sendingto the government system and processes them. For more information, see description of report in NF-e Batch Job Planning(Outbound).

4. Notify feeder system (technical name NFOUPDFS)The status code is transferred to the feeder system (ERP).

Send NF-e to Business PartnerThe process (Technical name: NFEB2BSD) consists of the following steps:1. Create B2B Process (technical name NFOB2BCR)

The report /XNFE/NFE_B2B_SEND (must be scheduled as a background job) collects all NF-es ready for sending to the B2Bpartner and processes them. For more information, see description of report in NF-e Batch Job Planning (Outbound).

2. Send NF-e to Transporter (technical name NFOB2BCA)This process step is only relevant if the customizing setting for the transporter CNPJ is activated (For more information, seecustomizing activity Activate B2B Scenarios for Business Partners)

3. Send NF-e to Buyer (technical name NFOB2BBU)This process step is only relevant if the customizing setting for the receiver CNPJ is activated (For more information, see customizingactivity Activate B2B Scenarios for Business Partners)

Issue of NF-e Number Gap SkippingThe process (Technical name: NFESKGAP) consists of the following steps:The numbering scheme of SEFAZ demands that all NF-es use subsequent numbers. However, there are situations when a numbermust be omitted. The process to skip a number is carried out in the following steps:1. Create Number Gap Skipping (technical name NFOSGCRE)

The skip NF-e data is validated and transformed into XML.

If the validation or transformation fails, the skip NF-e data can be corrected and send again from the feeder system (ERP). Theerror reason can be displayed by clicking the Application Log field in the Status Overview tab of the NF-e Monitor.

2. Sign NF-e (technical name NFOSIGNA)The skip NF-e is signed with the certificate of the NF-e issuer CNPJ (Maintain the SSF settings in Customizing activity MaintainSystem Response for Own Tax Numbers.

3. Authorize Skipping (technical name NFOSKAUT)The skip NF-es are collected and then send to the government system for authorization. The status code can be authorized (102), ornot authorized. For details about the error codes, see the current SEFAZ NF-e manual on the SEFAZ website.

The report /XNFE/NFE_SKIP_SEND (must be scheduled as a background job) collects all skipping requests ready for sendingto the government system and sends them. For more information, see description of report in NF-e Batch Job Planning(Outbound).

4. Notify feeder system (technical name NFOUPDFS)The status code is transferred to the feeder system (ERP).

Note

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 64 of 174

1.4.2.3 NF-e Batch Processing for Layout 3.10+ You can display and control the status of your NF-e Batches for all listed processes in the NF-e Batch Monitor (Outbound) for Layout3.10+.

Process

Send NF-e BatchThe process (Technical name: NFEBATSD) consists of the following steps:1. Create NF-e Batch (technical name NFBATCRE)

During batch creation the NF-es are separated according to:System Environment (Test or Production)Issuing TypeCode of Brazilian State (CUF)CNPJ of IssuerXML VersionModel of Nota Fiscal

Batches are created according to different criteria (batch size, No. of NF-es inside the batch). In Customizing activity NF-e: MaintainBatch Parameters, you can set this criteria for your region.

2. Send NF-e Batch (technical name NFBATSND)The batch is sent to authorities asking for authorization of the included NF-es. Before the batch is sent, the system checks the currentservice status. For more Information about the service status check, see Process Settings and Customizing (Outbound). Theauthorities answers with an average time that it took to set the NF-e status.

3. Request NF-e Batch (technical name NFBATREQ)Based on the settings in Customizing activity NF-e: Maintain Batch Parameters, the batch request is sent to authorities and returnsthe status of the included NF-es. If the status is missing the first time, the system automatically resends the batch status request. Thereceived status for each NF-e included in the batch is transferred to the NF-e Process.

If the batch request is not successful due to a technical error, the batch process can be terminated in the NF-e Batch Monitor andan NF-e status check on NF-e level can be carried out manually in the NF-e Monitor.

Reports are available for the processing of NF-e Batches that must be scheduled as background jobs. For details please refer toNF-e Batch Job Planning (Outbound).

1.4.2.4 Monitor NF-e Outbound for Layout 3.10+ SAP Nota Fiscal Eletrônica (SAP NFE) runs in different components when communicating with regional tax authorities. SAP NFE givesyou access to monitors with differing levels of detail to control the communication process and to solve problems. You can use themonitors in the following systems:

SAP ERP feeder system: see Document Monitoring in SAP ERPSAP NetWeaver PI for SAP NFE: see Monitor SAP NetWeaver PI for NF-e Layout 3.10+

Monitor SAP NFEThe monitoring options in SAP Nota Fiscal Eletrônica (SAP NFE) provide you with a single point-of-entry for tracking the communicationstatuses of NF-es (both individual and batched), and the communication process between the NFE application and the authorities'system. In case of communication failures, the NFE monitors allow you to trigger resending and rechecking of NF-es, batches, andrelated messages.The following monitors are available:

The NF-e Monitor (Outbound) for Layout 3.10+ displays an overview list of all NF-es sent individually to government systems and tobusiness partners, along with all NF-e-related messages. You can also resend certain messages from the filtered lists in this monitor.The NF-e Batch Monitor (Outbound) for Layout 3.10+ displays the messages you send to and receive from government systemsabout the status of NF-e batches.The NF-e Service Status Monitor (Outbound) for Layout 3.10+ displays the messages you send to and receive from governmentsystems about government Web service availability.The PI Message Monitoring displays processed XML messages.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 65 of 174

1.4.2.4.1 NF-e Monitor (Outbound) for Layout 3.10+ The NF-e Monitor (Outbound) for Layout 3.10 and Higher is a single point-of-entry for monitoring the document and process status ofan NF-e, as well as for monitoring communication with government systems and with business partners in business-to-business (B2B)scenarios. It allows you to download the XML files for NF-es, along with all authorization, cancellation, and skipping messages that youare legally required to keep as records. You can also resend messages from this monitor that your system was unable to send due totechnical reasons. For more information regarding the NF-e processes, see NF-e Processing (Outbound) for Layout 3.10+.

QueriesOverviewThe Overview query lists all NF-es (except NF-es in process number gap skipping) with their main header data and the statusinformation.Error OverviewThe Error Overview query lists NF-es with errors (except NF-es in process number gap skipping) with their main header data and thestatus information.Overview of B2B ErrorsThe Overview of B2B Errors query lists NF-es with B2B errors with their main header data and the status information.Overview Number Gap SkippingThe Overview Number Gap Skipping query only lists NF-es with process number gap skipping.

This skip access key only has 39 digits.

Overview of Errors in Number Gap SkippingThe Overview of Errors in Number Gap Skipping query lists NF-es with errors in process number gap skipping.

ListBased on your selection criteria, the NF-e monitor displays a list of NF-es and their processing status.The following status icons are used:

Process Completed; NF-e processed successfullyDepending on the NF-e type, this means:

NF-e authorized (Status Code 100)NF-e Cancellation authorized (Status Code 101)NF-e Number Skipping authorized (Status Code 102)Process completed; NF-e denied

The NF-e processing is finished with no option to continue processing.Process completed; NF-e rejected

Depending on the NF-e type, this means:NF-e rejected. The processing is finished and you can either send the NF-e again with corrected data, or skip the NF-e number.NF-e Number Skipping rejected. The processing is finished and can request to skip the NF-e number again.Process stopped; NF-e cannot be created due to validation error

You have to correct this error in your ERP system and resend your NF-e.Process waiting for asynchronous answer

Example: The batch containing the NF-e has not been sent to the authorities.Error in last process step

You can correct this error in your NFE system. Go to the status overview and check the problem description in the last activity. Aftercorrecting the problem, you can continue the process using the Continue Process button on the Error Overview tab.

Process waiting for user actionProcess stopped; Carry out the necessary actions in your ERP system.

Additional InformationOnce you select a line in the displayed table, you receive additional information about this NF-e at the bottom of the screen:

Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this NF-e containing the Status, Activity, Status Description, Info Text, Executed on, and the Userfields.B2B Status OverviewThis is a description of the B2B process with the corresponding Status, Activity, Status Description, Info Text and Application Logfields.B2B HistoryThis is a description of the history of the B2B activities of this NF-e containing the Status, Activity, Status Description, Info Text,Executed on, and the User fields.Events

The Events tab is only visible if there is at least 1 event for an NF-e.

Note

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 66 of 174

The main purpose is to provide information to the user about events. The outbound user must decide how running processes areaffected, and therefore a list of the current authorized and pending events (both self-issued and others) is displayed. The outbounduser can display all events per event type in a dialog box. In the Events tray, the following buttons are enabled after selecting one lineof the events list:

By selecting one event, you can display its content (if available) depending on its type. Select Details Event Details .By choosing Select Details Display Event XML , you can open or save the XML document.By choosing Event Status , you can display the current and former process steps with status icon, activity, process type, statusdescription, and info text.By choosing Event History , you can display the history of an event with status icon, activity, process type, status description,info text, execution date and time, and user.In a dialog box, you can see all other available versions of the selected event by choosing Display Versions .Send XML FileYou have the option to send an event XML using the Send XML File pushbutton. This button is active if the event is authorized andthe B2B scenario for the business partner is activated. You can choose to send the event XML to the Tomador. The followingsituations are supported:

The XML file was not yet sent because the B2B scenario for the business partner was not activated. After activation of the B2Bscenario and sending, the Process Status of the event process will not be changed. However, a history entry is added.The event XML file was already sent. After sending, the Process Status of the event process will not be changed. However, ahistory entry is added.

Errors during the initial B2B sending process must be solved in the Event Outbound Monitor and cannot be solved using theSend XML File function.

By choosing Refresh , the event list is updated to the latest version.

ActionsSelect Details:

Display DetailsThis action displays the entire XML content in multiple sub-screens. You can also access the NF-e details by clicking on the accesskey in the list.Display XMLThis action allows you to download/display the NF-e XML file (if existing).Cancellation XMLThis action allows you to download/display the cancellation event XML file (if existing).Skipping XMLThis action allows you to download/display the skipped XML file (if existing).Display DANFEThis action displays parts of the XML content in a DANFE preview (if existing).

Continue ProcessYou can select an NF-e with an error in the NF-e process and then check the problem description in the last activity. After correctingthe problem, you can continue the process using the Continue Process button.

If the step Check NF-e Authorization finished with an error, you can trigger the NF-e status check by clicking the Continue Processbutton. After that, the process will wait for an asynchronous answer.

Continue B2B ProcessYou can select an NF-e with an error in the B2B process and then check the problem description in the last activity. After correcting theproblem, you can continue the process using the Continue B2B Process button.Additional Functions:

Send XML FileThis action allows you to send an authorized NF-e XML to your business partner depending on the B2B Customizing for the partnerCNPJ.Query EventsThis action triggers an asynchronous NF-e status check to receive Events from your business partner through the authorities.

NF-e DetailsYou can display the invoice details by choosing an NF-e's Access Key, or by selecting the corresponding line and choosing DisplayDetails. The details view displays:

The processing status of the NF-e in both your system and the authorities' systemThe entire content of the XML in several tabs and grouped according to the tags in the XML

NavigationYou can access the NF-e monitor in SAP NFE via one of the following options:

You can call up the specific menu NF-e Monitor from the user role /XNFE/WP_NFE_OUT_MONITOR (Outgoing User Menu).You can navigate to the menu option in the navigation structure of Message Monitor in SAP NFE. You can access this option from theuser role by choosing Monitor Outbound NF-es/Events NF-e Monitor .

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 67 of 174

1.4.2.4.2 NF-e Batch Monitor (Outbound) for Layout 3.10+ The batch monitor displays the statuses of the NF-e batches that are sent to the authorities, along with the results of the batch statusrequests that you have sent to the authorities.

QueriesOverviewThe Overview query displays the main header data and status information for all batches you have sent.Error OverviewThe Error Overview tab page displays the main header data and status information for all batches with errors.

ListBased on your selection criteria, the NF-e batch monitor displays a list of NF-e batches and their processing status .The following status icons are used:

Process completed; Batch processed successfullyProcess completed; Batch process incomplete

The batch sending or batch request was rejected by the authorities, or the batch process was ended manually by the user.Process waiting for asynchronous answer or waiting for external replyError in last process step

You can correct this error in your NFE system. Go to the status overview and check the problem description in the last activity. Aftercorrecting the problem, you can continue the process using the Continue Process button on the Error Overview tab.

Process OK

Additional InformationOnce you select a line in the displayed table, you receive additional information about this NF-e batch at the bottom of the screen:

Status OverviewThe Status Overview tab displays additional information about the processing steps: status, activity, process type, status description,info text, application log.HistoryThe history tab displays the following additional information: status, activity, status description, info text, executed on, user.

ActionsBatch detailsThe batch details are displayed. You can also access the batch details by clicking the batch number in the list.Restart for NF-e Batches with ErrorsYou can select an NF-e Batch with an error and check the problem description in the last activity. After correcting the problem, youcan restart the process using the Restart button.Ending the NF-e Batch processingYou can select an NF-e Batch with an error and check the problem description in the last activity. If you cannot correct the problem, forexample due to technical problems with the SEFAZ system, you can end the batch process using the End Batch Process button. Thisfinishes the batch process and sets the status of the Check Authorization step of every NF-e in the batch to Error. The newstatus for every individual NF-e of the batch allows you to continue the NF-e process in the NF-e monitor. To receive a valid statusfrom SEFAZ, the NF-e status check requests a status for every individual NF-e.

By ending the batch processing, an NF-e status request is only possible via NF-e Status Check. The NF-e process step CheckAuthorization is set to Error and has to be restarted manually in the NF-e Monitor. It is no longer possible to transmit such anNF-e to the government system. If the NF-e is unknown to the government system, the NFE system will update the SEFAZ status tothe feeder system (ERP) which has to issue the NF-e again. It is no longer possible to send the NF-e to the government system fromthe NFE system.

Batch DetailsYou can display the details of a specific batch by choosing the Batch Number or by selecting its line and choosing Details. The detailsview displays:

The processing status of the batch in both your system and the authorities' systemBatch header dataA list of the individual NF-es in the batch with their most important header data

NavigationYou can access the NF-e batch monitor in SAP Nota Fiscal Eletrônica (SAP NFE) by using one of the following options:

Call up the specific menu NF-e Batch Monitor from the user role /XNFE/WP_NFE_OUT_MONITOR (Outgoing User Menu).You can navigate to the menu option in the navigation structure of Message Monitor in SAP NFE. You can access this option from theuser role by choosing Monitor Outbound NF-es/Events NF-e Batch Monitor .

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 68 of 174

1.4.2.4.3 NF-e Service Status Monitor (Outbound) for Layout3.10+ This monitor in SAP Nota Fiscal Eletrônica (SAP NFE) lets you check the results of service status inquiries that the system automaticallyperforms. The service status indicates the authorities' system availability.Each company is required to regularly check the authorities' system availability at a defined interval. You use this status information todetermine if you must start the contingency process in the feeder system SAP ERP manually in order to process your goods movementinvoices in a timely fashion.Status MonitorYou can display the result of the batch job run in the NF-e Service Status Monitor. For more information how to plan a batch job, see thebatch job Service Status Check in NF-e Batch Job Planning (Outbound).Status CheckFor more information, see NF-e/CT-e Administrator.

NavigationYou can access the NF-e service status monitor in the SAP NFE core application by using one of the following options:Call up the NF-e Service Status Monitor in Message Monitor menu under Monitor Outgoing Messages.

1.4.2.4.4 Monitor SAP NetWeaver PI for NF-e Layout 3.10+ You can use the monitoring options in SAP NetWeaver Process Integration (SAP NetWeaver PI). SAP NetWeaver PI to detect problemswith or view the details of many technical process steps.

FeaturesYou can use transaction code SXMB_IFR to access the following Java-based monitors in the SAP PI Runtime Workbench of theIntegration Builder to track communication process steps in SAP NetWeaver PI:

The Component Monitor can help you identify problems in the different components that SAP NetWeaver PI uses during thecommunication process. This includes, for example, monitoring the proxies sent to the core application of SAP Nota FiscalEletrônica, as well as the Integration Engine or the Adapter Engine of the Integration Server.The Message Monitor is the main entry point for retrieving detailed information about individual messages.

For this monitor, use a specific communication process (integration scenario) as the selection criterion.

The Adapter Monitor can help you detect problems in the message flow from the SAP NFE core application to SAP NetWeaver PIcaused by the adapter.Monitoring the adapter is critical if you are trying to find the reason why expected messages from the government are still missingeven when the authorities state that the communication was completed successfully from their side.

An additional monitor is available via transaction SXMB_MONI for tracking individual messages that SAP NetWeaver PI receives orsends to communication partners.

More InformationFor more information about the monitoring options in SAP NetWeaver PI, see the topic Central Monitoring in the SAP Library under Functional View SAP NetWeaver by Key Capability Process Integration by Key Capability SAP NetWeaver ExchangeInfrastructure Runtime .

1.4.2.5 BAdIs for Outbound NF-e for Layout 3.10+ The following BAdIs (Outbound) are available for SAP Nota Fiscal Eletronica (NFE):

BAdI: Extend NF-e with Feeder System DataWith this BAdI, you accept additional data from the feeder system and integrate the data into the XML for the electronic Nota Fiscal(NF-e). You need this additional data, for example, to report industrial-specific information to the authorities.BAdI: Call Non-SAP System via RFC CommunicationYou use a Business Add-In (BAdI) to control the RFC call. The BAdI lets you control the RFC call for communication with the ERPsystem, to use the electronic communication of notas fiscais with the authorities for non-SAP systems. In the standard settings, thesystem uses the standard SAP modules to call SAP ERP for RFC communication with the ERP system.

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 69 of 174

Two function modules are used to call non-SAP systems, one to report the status of NF-es, and one for events. The implementation ofthe BAdI determines if the standard or the non-SAP function modules are called. Function module /XNFE/XML_IN_TAB reports thestatus of NF-es to non-SAP systems. Tables parameter CH_XMLTAB includes the following important fields:I_DOCNUM (NF-e document number)I_AUTHCODE (Protocol number from SEFAZ)I_CODE (Status code from SEFAZ)I_ID (44-character access key)I_MSGTYP (A code that determines if the NF-e is authorized or not: 1: NF-e authorized, 2: NF-e rejected, 3: NF-e denied, 4:Cancellation authorized, 5: Skipping authorized, 6: Cancellation rejected, 7: Skipping rejected)I_AUTHDATE (NF-e Processing Time – Date from SEFAZ)I_AUTHTIME (NF-e Processing Time – Time from SEFAZ)

Tables parameter CT_BAPIRET2: If an error occurs in the target system, the error status with one or more error texts can bereturned with the help of a BAPIRET2 table.Function module /XNFE/NFE_EVENT_IN reports the status of Events to non-SAP systems. Tables parameter IT_EVENTS includesthe following important fields:DOCNUM (NF-e document number)EXT_EVENT (Type of Event)SEQNUM (Internal Sequence Number)EXT_SEQNUM (SEFAZ Sequence Number)ACCKEY (44-character NF-e access key)AUTHCODE (Protocol Number from SEFAZ)REPLY_TMPL (Events: Registration Timestamp)CODE (Status code from SEFAZ)MSGTYP (A code that determines if the event is authorized or not 1: Event authorized, 2: Event rejected)EXT_REPLY_TMPL (Events: Registration Date/Time)

Tables parameter CT_BAPIRET2: If an error occurs in the target system, the error status with one or more error texts can bereturned with the help of a BAPIRET2 table.BAdI: Sign Outgoing NF-esThe BAdI enables a synchronous proxy call of an external signature service (through external signature hardware, for example, or anexternal Web service), to circumvent the standard signature implementation in ABAP.BAdI: Extend B2B Message with AttachmentYou use this BAdI to control the creation of attachments when sending the NF-e to a business partner (consignee or carrier).

For more information, see the documentation for the BAdIs in Customizing under Nota Fiscal Eletrônica Outbound BusinessAdd-Ins for Outbound NF-es .

1.4.3 CT-e Outbound The CT-e Outbound of SAP Nota Fiscal Eletrônica has the following scope:

To automate and monitor the authorization with government systems and to issue CT-es to business partners.The CT-e outbound of SAP Nota Fiscal Eletrônica consists of the following topics:

Communication Flow for Sending CT-esMonitor CT-e OutboundCT-e Communication Process Monitoring (Outbound)CT-e Monitor (Outbound)CT-e Batch Monitor (Outbound)CT-e Service Status Monitoring (Outbound)Monitor SAP NetWeaver PI (CT-e)BAdIs for Outbound CT-e

1.4.3.1 Communication Flow for Sending CT-es This section provides an overview of the interaction between the different components of the SAP Nota Fiscal Eletrônica (SAP NFE)shipment based on the example process of sending a Conhecimento de Transporte Eletrônico (CT-e). You can apply the explanationsfor each CT-e process step to such secondary processes as canceling or skipping CT-es.

Batch creation and processing are specific only to sending CT-es to the authorities.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 70 of 174

Process

Communication Flow

1. Create an electronic fiscal document in SAP ERPTo create an electronic fiscal document in a logistics process, you need country-specific information contained in a CT-e.For more information about the role and the handling of electronic fiscal documents (CT-es), see SAP Library for SAP ERP under SAP Solutions SAP ERP SAP ERP Central Component <Release> SAP ERP Central Component Logistics Country VersionsAmericas Brazil Sales and Distribution (SD) .

2. Receive CT-e data in the SAP NFE core applicationThe system transfers all required data in a CT-e from the SAP ERP feeder system to the SAP NFE core application, which stores thedata with a common identifier and a reference to the feeder system document.

3. Sign CT-eThe authorities require that each CT-e be signed by using a certificate that they have issued. Each CT-e is signed individually withinthe ABAP stack using the certificate that is stored in the STRUST table.

4. Queue signed CT-esThe core application saves the signed CT-es for later reference and also queues them for the next process step.

5. Create batch in core applicationThe authorities only accept CT-es in batches that cannot exceed a certain size. The system applies all requirements from theauthorities when batching signed CT-es.

6. Send CT-e batch to SAP NetWeaver PIThe SAP NFE system sends the batch synchronously to SAP NetWeaver PI using the standard PI adapter.

7. Send CT-e batch from SAP NetWeaver PI to authoritiesSAP NetWeaver PI routes the batches to the correct addressee. For communicating with the authorities, an HTTPs connection usingthe company-specific certificate from the government via SOAP is required.

8. Receive average timeframe from authorities for status availabilityWhen the authorities receive the batched CT-es, they automatically send a response via SAP NetWeaver PI with the average time(in seconds) that it took to set the CT-e batch status.

9. Prepare request for CT-e status informationAfter SAP NetWeaver PI transmits the authorities' response to the SAP NFE core application, the core application schedules asystem status request message to send to the authorities.

10. Set CT-e government status (authorities)The authorities set the status for all CT-es in the batch for which they have provided a time estimate. The status is stored in theauthorities' system until your company retrieves it

Authorities can reject CT-es due to technical problems or other reasons. You can solve this issue if you initiate the skippingprocess by canceling the rejected CT-e in the SAP ERP feeder system. If the authorities return the CT-e with status Denied, thatmeans that a severe credibility problem has occurred.

11. Request status information from authoritiesAfter the time set by the authorities for collecting status data has elapsed, the SAP NFE core application uses the standard PIadapter to send the status request to SAP NetWeaver PI. SAP NetWeaver PI then routes the request via the SOAP adapter to theauthorities.

12. Receive authority status in SAP NFE core application

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 71 of 174

The SAP NFE system receives the government status for the CT-es via SAP NetWeaver PI and updates the status informationaccordingly.

13. Triggering of B2B process (if configured) in SAP NFE core applicationIf configured in Customizing, the SAP NFE system triggers the B2B process and sends the XML file to the business partner.

14. Forward CT-e status to SAP ERPThe SAP NFE core application sends the government-issued status to SAP ERP.

15. Update status of electronic fiscal document in SAP ERPThe process is terminated and changes to goods movement processing.

16. Send CF-es to SAP NetWeaver PIThe SAP NFE system uses the standard PI adapter to send the CT-es to SAP NetWeaver PI.

17. Send CT-es from SAP NetWeaver PI to B2B receiverSAP NetWeaver PI routes the CT-es to the correct B2B addressee. An HTTPs connection is required to communicate with the B2Breceiver.

The authorities require both the consignor and the consignee companies to keep the records of exchanged CT-es and ofcancellation requests that the authorities authorized or denied. You can download XML files and send them to your businesspartners.

More InformationSetting up and configuring the individual components required to enable the communication process is described in Configuration ofCT-e (Outbound).Monitoring the communication process is described in Monitor CT-e Outbound.

1.4.3.2 Monitor CT-e Outbound SAP Nota Fiscal Eletrônica (SAP NFE) runs in different components when communicating with regional tax authorities. SAP NFE givesyou access to monitors with differing levels of detail to control the communication process and to solve problems. You can use themonitors in the following systems:

SAP ERP feeder system: see Document Monitoring in SAP ERPSAP NFE core application: see Communication Process Monitoring in the Core ApplicationSAP NetWeaver PI for SAP NFE: see Monitor SAP NetWeaver PI (CT-e)

1.4.3.2.1 CT-e Communication Process Monitoring (Outbound) The monitoring options in the core application of SAP Nota Fiscal Eletrônica (SAP NFE) provide you with a single point-of-entry fortracking the communication statuses of CT-es (both individual and batched), and the communication process between the NFEapplication and the authorities' system. In case of communication failures, the NFE core application monitors allow you to triggerresending and rechecking of CT-es, batches, and related messages.

ProcessThe following monitors are available:

XI: Message MonitoringThis monitor displays processed XML messages.The CT-e Monitor displays an overview list of all CT-es sent individually to government systems and to business partners, along withall CT-e-related messages. You can also resend certain messages from the filtered lists in this monitor.The CT-e Batch Monitor displays the messages you send to and receive from government systems about the status of CT-e batches.

The Personal Object Work List (POWL) provides central, personalized, and easy-to-use access to all your relevant worklist items,including business objects and documents. Choose Personalize, for example in the CT-e Monitor, to select or deselect the followingoptional query categories:

OverviewOverview Error

We recommend maintaining Quick Criteria due to performance reasons. For example, if a user works only with a certain CNPJ, then

Note

Note

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 72 of 174

that CNPJ can be defined as limiting factor.

Under Layout, you can select Tab Strip or Link Matrix to define the layout.

1.4.3.2.1.1 CT-e Processing (Outbound)

ProcessThe processing of CT-es (Outbound, as displayed in the CT-e Monitor and CT-e Batch Monitor) is carried out in the following steps:1. Create CT-e

CT-e validated and transformed.

If the validation or transformation fails, the CT-e data can be corrected and send again from the backend system. The errorreason can be displayed by clicking the Application Log field in the Status Overview tab of the CT-e Monitor.

2. Sign CT-eCT-e signed with SSF.

3. Check CT-e AuthorizationThe authorization is carried out as follows:

The batch request returns the status of the CT-es of the batch.If the batch request is not successful due to a technical error, the batch process can be terminated in the CT-e Batch Monitor anda CT-e status check on CT-e level can be carried out manually in the CT-e Monitor.

The status code can be authorized (for example: 100, 101, 102), or not authorized. For details about the error codes, see the currentSEFAZ CT-e manual on the SEFAZ website.

4. Trigger B2B Communication (optional)B2B process started.

5. ERP UpdateStatus code is transferred to ERP

After the successful execution of these four steps, the process of issuing a CT-e is complete. However, the process can continue if acancellation or skipping is triggered in the ERP system. Here are the additional steps for the cancellation and skipping scenario:

Cancellation: Is possible if the CT-e was authorized:1. Create Cancellation2. Sign Cancellation3. Send Cancellation4. Trigger B2B Communication (optional)5. ERP UpdateSkipping: Is possible if the CT-e was rejected1. Create Number Skipping Request2. Sign Number Skipping Request3. Send Number Skipping Request4. ERP Update

Number Gap Skipping for CT-esThe numbering scheme of SEFAZ demands that all CT-es use subsequent numbers. However, there are situations when a numbermust be omitted. The process to skip a number is carried out in the following steps:1. Create Number Skipping Request

CT-e number skipping successfully transformed2. Sign Number Skipping Request

CT-e successfully signed with SSF application NFESIG3. Send Number Skipping Request

CT-e cancellation successfully sent; status code received4. ERP Update

Status code successfully transferred to ERP

You can display and control the number gap skipping status of your CT-es in the CT-e Monitor (Outbound).

1.4.3.2.1.2 CT-e Monitor (Outbound) The CT-e Monitor is a single point-of-entry for monitoring the document and process status of Conhecimento de Transporte Eletrônico

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 73 of 174

(CT-e), as well as for monitoring communication with government systems and with business partners in business-to-business (B2B)scenarios. It allows you to download the XML files for CT-es, along with all authorization, cancellation, and skipping messages that youare legally required to keep as records. You can also resend messages from this monitor that your system was unable to send due totechnical reasons.

FeaturesBased on your selection criteria (the layout described here is the Tab Strip design; this can be set via the Personalize link in the right topcorner of your screen), the CT-e monitor displays the following:

CT-e OverviewThe tab page Overview lists successfully processed CT-es and CT-e sending failures with their main header data and the statusinformation. This includes the overall document status and the status code from the authorities, as well as possible error messagesfrom the authorities.

You can display the invoice details by choosing a CT-e's Access Key column for one list entry or by selecting its line and choosingSelect Details. The detail view lists both header and item data relevant for the authorities, for example:

Status information such as process status, error status, and status code.Information about the CT-e sender and recipient, including their respective tax identificationsInvoice item data in SAP ERP, including values and quantities on which the tax calculation is based

Once you selected a line in the list of available CT-es, two new additional information tabs open at the bottom of your screen:Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this CT-e batch containing the Status, Activity, Status Description, Info Text, Executed on, andthe User fields.Events

The Events tab is only visible if there is at least 1 event for a CT-e.

The main purpose is to provide information to the user about events. The outbound user must decide how running processes areaffected, and therefore a list of the current authorized and pending events (both self-issued and others) is displayed. The outbounduser can display all events per event type in a dialog box. In the Events tray, the following buttons are enabled after selecting oneline of the events list:

By selecting one event, you can display its content (if available) depending on its type. Select Details Event Details .By choosing Select Details Display Event XML , you can open or save the XML document.By choosing Event Status , you can display the current and former process steps with status icon, activity, process type,status description, and info text.By choosing Event History , you can display the history of an event with status icon, activity, process type, status description,info text, execution date and time, and user.In a dialog box, you can see all other available versions of the selected event by choosing Display Versions .Send XML FileYou have the option to send an event XML using the Send XML File pushbutton. This button is active if the event is authorizedand the B2B scenario for the business partner is activated. You can choose to send the event XML to the Tomador. The followingsituations are supported:

The XML file was not yet sent because the B2B scenario for the business partner was not activated. After activation of the B2Bscenario and sending, the Process Status of the event process will not be changed. However, a history entry is added.The event XML file was already sent. After sending, the Process Status of the event process will not be changed. However, ahistory entry is added.

Errors during the initial B2B sending process must be solved in the Event Outbound Monitor and cannot be solved using theSend XML File function.

By choosing Refresh , the event list is updated to the latest version.The available tabs are as follows:

CT-e IdentificationThis tab display header data of the CT-e. The main categories are:

OutputCT-e Transport DataOther Data

IssuerThis tab displays details about the issuer name and issuer address data.Service TakerThis tab displays details about the service taker name and address data.Goods SenderThis tab displays details about the name of the goods sender and address data of the goods sender. In addition, OtherReferences are displayed in a table.CT-e DestinationThis tab displays details about the name of the CT-e destination and address of the CT-e destination.Service Rendering ValueThis tab displays details about the total value of goods/services and the tax situation regarding ICMS taxes.

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 74 of 174

Freight InformationThis tab displays details about the freight:

Goods ValueMain ProductGoods Property

Freight QuantityThe freight quantity information is displayed in a table.

In every tab, a status area is visible displaying the Status, Activity, Status Description and Status Code.

The overall status displays the current situation of the issuing process and is displayed as an icon. The following icons are used: Process Completed; CT-e processed successfully

Depending on the CT-e type, this means:CT-e authorized (Status Code 100)CT-e Cancellation authorized (Status Code 101)CT-e Number Skipping authorized (Status Code 102) Process completed; CT-e denied

The CT-e processing is finished with no option to continue processing. Process stopped; CT-e cannot be created due to validation error

You have to correct this error in your ERP system and resend your CT-e. Process waiting for asynchronous answer

Example: The batch containing the CT-e has not been sent to the authorities. Error in last process step

You can correct this error in your NFE system. Go to the status overview and check the problem description in the last activity. Aftercorrecting the problem, you can continue the process using the Continue Process button on the Error Overview tab.

Process waiting for user actionProcess stopped; Carry out the necessary actions in your ERP system.

Error OverviewThe tab page Error Overview lists CT-es and CT-e with errors with their main header data and the status information. This includes theoverall document status and the status code from the authorities, as well as possible error messages from the authorities.

You can display the invoice details by choosing a CT-e's Access Key column for one list entry or by selecting its line and choosingSelect Details. The detail view lists both header and item data relevant for the authorities.Once you selected a line with a batch number, two new additional information tabs open at the bottom of your screen:

Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this CT-e batch containing the Status, Activity, Status Description, Info Text, Executed on, andthe User fields.

The details view displays:Status information such as process status, error status, and status code.Information about the CT-e sender and recipient, including their respective tax identificationsInvoice item data in SAP ERP, including values and quantities on which the tax calculation is based

The available tabs are as follows:CT-e IdentificationThis tab display header data of the CT-e. The main categories are:

OutputCT-e Transport DataOther Data

IssuerThis tab displays details about the issuer name and issuer address data.Goods SenderThis tab displays details about the name of the goods sender and address data of the goods sender. In addition, OtherReferences are displayed in a table.CT-e DestinationThis tab displays details about the name of the CT-e destination and address of the CT-e destination.Service Rendering ValueThis tab displays details about the total value of goods/services and the tax situation regarding ICMS taxes.Freight InformationThis tab displays details about the freight:

Goods ValueMain ProductGoods Property

Freight QuantityThe freight quantity information is displayed in a table.

In every tab, a status area is visible displaying the Status, Activity, Status Description and Status Code.

The overall status is displayed as an icon. The used icons are the same as in the list before.Continue Process for CT-es with ErrorsYou can select a CT-e with an error from the Error Overview tab page and then check the problem description in the last activity. After

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 75 of 174

correcting the problem, you can continue the process using the Continue Process button on the Error Overview tab.

If the step Check CT-e Authorization finished with an error, you can trigger the CT-e status check by clicking the Continue Processbutton on the Error Overview tab. After that, the overall status will change to Process waiting for asynchronous answer. After a while,the overall status of the CT-e will change again according to the asynchronous answer from SEFAZ. Therefore, it is important thatyou refresh the current query repeatedly (using the refresh link at the bottom right of the screen).

Overview of B2B ErrorsThe tab page Overview of B2B Errors lists CT-es with B2B errors with their main header data and the status information. This includesthe following columns:

Overall StatusStatus CodeCT-e NumberCT-e SeriesAccess KeyCT-e Document No.Creation DateCreation TimeCT-e TypeBatch NumberCT-e Type (XML)Issue Date/TypeTransport ModeService TypeService Taker (Tomador)CNPJ of IssuerCT-e IssuerRecipient CNPJTaker Name

Overview Number Gap SkippingThe tab page Overview Number Gap Skipping lists CT-es with number gap skipping errors. This includes the following columns:

Overall StatusStatus CodeCT-e NumberCT-e SeriesAccess KeyThis skip access key has only 39 digits.Creation DateCreation TimeCNPJ of IssuerCT-e Issuer

Once you selected a line with a CT-e number, two new additional information tabs open at the bottom of your screen:Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this CT-e containing the Status, Activity, Status Description, Info Text, Executed on, and the Userfields.

The only action that can be carried out in the Overview Number Gap Skipping area is as follows:1. Select one number gap skipping CT-e2. Press the pushbutton Select Details3. Select Skipping XMLOverview of Errors in Number Gap SkippingThe tab page Overview of Errors in Number Gap Skipping lists CT-es with an error during the number gap skipping. This includes thefollowing columns:

Overall StatusStatus CodeCT-e NumberCT-e SeriesAccess KeyCreation DateCreation TimeCNPJ of IssuerCT-e Issuer

Once you selected a line with a batch number, two new additional information tabs open at the bottom of your screen:Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this CT-e containing the Status, Activity, Status Description, Info Text, Executed on, and the Userfields.

The only actions that can be carried out in the Overview of Errors in Number Gap Skipping area is as follows:1. Select one number gap skipping CT-e2. Press the pushbutton Select Details and then select Skipping XML

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 76 of 174

3. You can also continue the processing after manual corrections (see error status description) by pressing the Continue Processpushbutton.

For more information about the number gap skipping process, see the relevant section Number Gap Skipping in CT-e Processing(Outbound).

Accessing the CT-e MonitorYou can access the CT-e monitor in the core application of SAP NFE via one of the following options:

You can call up the specific menu CT-e Monitor from the user role /XNFE/WP_NFE_OUT_MONITOR (Outgoing User Menu).You can navigate to the menu option in the navigation structure of the Monitor Outgoing Messages for the SAP NFE core application.You can access this option from the user role by choosing CT-e Monitor .

1.4.3.2.1.3 CT-e Batch Monitor (Outbound) The batch monitor displays the statuses of the CT-es that you have sent in batches to the authorities, along with the results of the batchstatus requests that you have sent to the authorities.

FeaturesBased on your selection criteria (the layout described here is the Tab Strip design; this can be set via the Personalize link in the right topcorner of your screen), the CT-e batch monitor displays the following:OverviewThe Overview tab page displays the main header data and status information for all batches you have sent.

You can display the details of a specific batch by choosing the Batch Number or by selecting its line and choosing Details. The detailsview displays:

Batch header dataA list of the individual CT-es in the batchThe processing status of the batch in both your system and the authorities' system.

Once you selected a line with a batch number, two new additional information tabs open at the bottom of your screen:Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this CT-e batch containing the Status, Activity, Status Description, Info Text, Executed on, andthe User fields.

The overall status is displayed as an icon. The following icons are used: Process waiting for asynchronous answer Error in last process step

You can correct this error in your NFE system. Go to the status overview and check the problem description in the last activity. Aftercorrecting the problem, you can continue the process using the Continue Process button on the Error Overview tab.

Batch Processing CompletedError OverviewThe Error Overview tab page displays the main header data and status information for all batches with errors.The overall status is displayed as an icon. The used icons are the same as in the above list.

You can display the details of a specific batch by choosing the Batch Number or by selecting its line and choosing Details. The detailsview displays:

Batch header dataA list of the individual CT-es in the batchThe processing status of the batch in both your system and the authorities' system.

Once you selected a line with a batch number, two new additional information tabs open at the bottom of your screen:Status OverviewThis is a description of the process with the corresponding Status, Activity, Status Description, Info Text and Application Log fields.HistoryThis is a description of the history of this CT-e batch containing the Status, Activity, Status Description, Info Text, Executed on, andthe User fields.

Restart for CT-e Batches with ErrorsYou can select a CT-e Batch with an error from the Overview or Error Overview tab page and then check the problem description in thelast activity. After correcting the problem, you can restart the process using the Restart button on the Overview or Error Overview tab.Ending the CT-e Batch processingYou can select a CT-e Batch with an error from the Overview or Error Overview tab page and then check the problem description in thelast activity. If you cannot correct the problem, for example due to technical problems with the Sefaz system, you can end the batchprocess using the End CT-e Batch Process button on the Overview or Error Overview tab. This finishes the batch process and sets thestatus of the Check Authorization step of every CT-e in the batch to Error. The new status for every individual CT-e of the batchallows you to continue the CT-e process in the error tab of the CT-e monitor. To receive a valid status from Sefaz, the CT-e status checkrequests a status for every individual CT-e.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 77 of 174

By ending the batch processing, a CT-e status request is only possible via CT-e Status Check. The CT-e process step CheckAuthorization is set to Error and has to be restarted manually in the CT-e Monitor. It is no longer possible to transmit such a CT-e to the government system. If the CT-e is unknown to the government system, the NFE system will update the Sefaz status to theERP system and ERP will have to issue the CT-e again. It is no longer possible to send the CT-e to the government system from theNFE system.

ActivitiesYou can access the CT-e batch monitor in the core application of SAP Nota Fiscal Eletrônica (SAP NFE) by using one of the followingoptions:

Call up the specific menu CT-e Batch Monitor from the user role /XNFE/WP_NFE_OUT_MONITOR (Outgoing User Menu).Navigate to the menu option in the navigation structure of the Monitor Outgoing Messages in the SAP NFE core application. You canaccess it from the user role by choosing CT-e Batch Monitor .

1.4.3.2.1.4 CT-e Service Status Monitoring (Outbound) This monitor in SAP Nota Fiscal Eletrônica (SAP NFE) lets you check the results of service status inquiries that the system automaticallyperforms. The service status indicates the authorities' system availability.Each company is required to regularly check the authorities' system availability at a defined interval. You use this status information todetermine if you must start the contingency process in the feeder system SAP ERP manually in order to process your goods movementinvoices in a timely fashion.

ActivitiesYou can access the CT-e service status monitor in the SAP NFE core application by using one of the following options:

Call up the CT-e Service Status Monitor in Message Monitor menu under Monitor Outgoing Messages.Status MonitorYou can display the result of the batch job run in the CT-e Service Status Monitor. For more information how to plan a batch job, see thebatch job Service Status Check in CT-e Batch Job Planning (Outbound).Status CheckFor more information, see NF-e/CT-e Administrator.

1.4.3.2.2 Monitor SAP NetWeaver PI (CT-e) You can use the monitoring options in SAP NetWeaver Process Integration (SAP NetWeaver PI). SAP NetWeaver PI to detect problemswith or view the details of many technical process steps.

FeaturesYou can use transaction code SXMB_IFR to access the following Java-based monitors in the SAP PI Runtime Workbench of theIntegration Builder to track communication process steps in SAP NetWeaver PI:

The Component Monitor can help you identify problems in the different components that SAP NetWeaver PI uses during thecommunication process. This includes, for example, monitoring the proxies sent to the core application of SAP Nota FiscalEletrônica, as well as the Integration Engine or the Adapter Engine of the Integration Server.The Message Monitoris the main entry point for retrieving detailed information about individual messages.

For this monitor, use a specific communication process (integration scenario) as the selection criterion.

The Adapter Monitor can help you detect problems in the message flow from the SAP NFE core application to SAP NetWeaver PIcaused by the adapter.Monitoring the adapter is critical if you are trying to find the reason why expected messages from the government are still missingeven when the authorities state that the communication was completed successfully from their side.

An additional monitor is available via transaction SXMB_MONI for tracking individual messages that SAP NetWeaver PI receives orsends to communication partners.

More InformationFor more information about the monitoring options in SAP NetWeaver PI, see the topic Central Monitoring in the SAP Library under

Caution

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 78 of 174

Functional View SAP NetWeaver by Key Capability Process Integration by Key Capability SAP NetWeaver ExchangeInfrastructure Runtime .

1.4.3.3 BAdIs for Outbound CT-e The following BAdIs are available for outgoing CT-es:

BAdI: Sign Outgoing CT-esThe BAdI enables a synchronous proxy call of an external signature service (through external signature hardware, for example, or anexternal Web service), to avoid the standard signature implementation in ABAP.BAdI: Calling Non-SAP-Systems via RFC CommunicationWith this BAdI you can control the RFC call for the communication with the ERP system to use electronic communication of CT-es withthe authorities for non-SAP systems.

For more information, see the documentation for the BAdIs in Customizing under Nota Fiscal Eletrônica Outbound BusinessAdd-Ins for Outbound CT-es .

1.5 Inbound The Inbound of SAP Nota Fiscal Eletrônica has the following scope:To automate and monitor the receipt of NF-e, CT-e and Events, to check the authorization against government systems, and triggerposting of documents in ERP.The Inbound of SAP Nota Fiscal Eletrônica consists of the following:

Business RolesNF-e InboundCT-e InboundDF-e Gate Monitor

1.5.1 Business Roles

NF-e Fiscal ClerkThe work of the NF-e fiscal clerk combines the activities of a tax accountant with those of a clerk who verifies and processes logisticsinvoices. Incoming notas fiscais are verified for correctness by comparing the document line items with what was expected, basedon, for example, purchase orders. The fiscal clerk also checks the correctness of the applied taxes and verifies the quantities that arephysically delivered. Finally, upon acceptance, the fiscal clerk posts the NF-e accounting. With respect to handling NF-es, the fiscalclerk must verify:

The correctness of received NF-es (the XML documents), including their SEFAZ authorization statusThe correctness of received DANFEs (Documento Auxiliar da NF-e) by comparing them with corresponding NF-esThe correctness of all values, especially tax amounts, by comparing them with, for example, the values on corresponding purchaseordersThe correctness of delivered quantities as reported by inbound delivery processing

The NF-e fiscal clerk works in the NF-e Fiscal Workplace when processing incoming NF-es.CT-e Fiscal ClerkThe CT-e fiscal clerk must verify the correctness of the received CT-es (the XML documents), including their SEFAZ authorizationstatus.:The CT-e fiscal clerk works in the CT-e Fiscal Workplace when processing incoming CT-es.NF-e Logistics ClerkThe NF-e logistics clerk is responsible for handling physical goods receipts. This includes:

Counting or measuring received quantitiesAssigning the goods to appropriate storage locations

The NF-e logistics clerk works in the NF-e Logistics Workplace when tracking the differences (if any exist) between the physicalquantities received and the quantities listed on the DANFE.

The fiscal clerk and the logistics clerk user roles should have separate authorizations. However, certain fiscal authorizations may

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 79 of 174

encompass existing logistics authorizations (and the other way around), as when, for example, the fiscal clerk also works as alogistics invoice verifier, or when the logistics clerk also works as a logistics execution or inventory manager.NF-e AdministratorThe NF-e administrator is a user with administration rights. This role has access to all features of the NFE solution and is able tomanage authorizations, profiles, and users. The NF-e administrator works in the Administration workplace, and normally also has atleast display authorization for the NF-e Fiscal Workplace, the CT-e Fiscal Workplace, and the NF-e Logistics Workplace.

The NF-e Administrator should at least have display authority for the intended workplace.

DF-e Gate ControlDF-e gate control is carried out by a user who is responsible for the entrance check of a shipment (multiple NF-es and CT-es) at thecompany gate. Depending on the multiple statuses of the NF-es/CT-es, the user decides if a shipment can enter the companygrounds.The DF-e Gate Control user works in the DF-e Gate Monitor to check incoming shipments.

1.5.2 NF-e Inbound The NF-e Inbound of SAP Nota Fiscal Eletrônica has the following scope:Manage and automate the receipt of electronic invoices received from suppliers:

Automation of Normal Purchasing and STOCancellationsContingencyVendor Notifications

The NF-e inbound of SAP Nota Fiscal Eletrônica consists of the following topics:Business Process Determination and Position TypesNF-e Processing Step AutomationNF-e List Request Status Monitor (Inbound)Processing Inbound NF-esNF-e Process Normal PurchasingProcessing in SAP ERP: Normal PurchasingNF-e Contingency ProcessProcessing in SAP ERP: ContingencyNF-e Cancellation ProcessProcessing in SAP ERP: CancellationOther Processes for NF-esCommunication with SAP ERP for Other ProcessesNF-e Stock Transfer ProcessProcessing in SAP ERP: Stock TransferNFE Customer-Specific Business Process with DANFENF-e Sucontracting OverviewNF-e Subcontracting ProcessProcessing in SAP ERP: NF-e for Subcontracting (SUBCON1A)NF-e for Symbolic ReturnsProcessing in SAP ERP: NF-e for Symbolic Returns (SUBCON2C)NF-e for Returns of ComponentsProcessing in SAP ERP: NF-e for Return of Components (SUBCON2D)NF-e Future Delivery OverviewNF-e Invoice Receipt Future Delivery ProcessProcessing in SAP ERP: Future Delivery InvoiceNF-e Goods Receipt Future Delivery ProcessProcessing in SAP ERP: Future Delivery Goods ReceiptNF-e Consignment OverviewNF-e Goods Receipt Consignment ProcessProcessing in SAP ERP: Consignment Goods ReceiptNF-e Invoice Consignment ProcessProcessing in SAP ERP: Consignment InvoiceReturnable Packaging for NF-e ProcessesProcessing in SAP ERP: Returnable Packaging with Purchased GoodsBAdIs for Inbound NF-esNF-e Fiscal WorkplaceNF-e Fiscal Workplace: AssignmentAssignment for Normal Purchasing and Future Delivery InvoiceAssignment for NF-e for Subcontracting (SUBCON1A)Assignment for NF-e for Symbolic Returns (SUBCON2C)Assignment for Future Delivery Goods Receipt (FUTDELGR)NF-e Fiscal Workplace: Simulating NF-esNF-e Fiscal Workplace: Recording DANFEs

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 80 of 174

NF-e Fiscal Workplace: Checking Goods Receipt QuantitiesNF-e Logistics WorkplaceNF-e Logistics Workplace: Entering Goods Receipt QuantitiesNF-e Logistics Workplace: Preparing Goods Receipt PostingsReceiver AcknowledgmentNF-e List and DownloadReceiver Acknowledgments EventsDashboards for Inbound NF-esNF-e ReportingReporting for Rejected NF-esNF-es with correct/incorrect Assignment in the XML

Also see:NF-e/CT-e Administrator

1.5.2.1 Business Process Determination and Position Types

ProcedureBusiness Process Determination for CFOP CodesThe business processes are determined based on the CFOP codes that are assigned to the NF-e items. If the CFOP code does notenable identification of a unique business process, the NF-e is not assigned.The content based business process determination deals with the handling of several CFOPs. It is necessary to determine the businessprocess type to be assigned to the incoming legal document. In the case of the Nota Fiscal eletrônica, the business processdetermination depends mainly on the CFOP code which is defined by the Brazilian authorities and describes the type of businesstransaction.Maintain your settings as described in Customizing under Nota Fiscal Eletrônica Inbound NF-e: Maintain Business ProcessDetermination for Inbound NF-es .ExampleCFOP Process Type5101 NF-e for standard purchase order1101 NF-e for standard purchase order

When an NF-e in which all items have CFOP 5101 or 5102 is processed, the "NF-e for Standard" process is executed. When an NF-ewhose CFOPs do not lead to a unique process type (such as 5101 or 1101) is processed, an error occurs. You have to correct thisinconsistency in Customizing, after which you can determine the business process again with menu path Administration Incoming NF-es Redetermine Business Process . When an NF-e that contains only CFOPs that are not defined here in its items is processed, thena predefined process is executed that consists of the steps Check Business Partner's Signature and Check Authorization after NF-eReceipt. If you do not want this to happen, the administrator can also start redetermination through the report in this case after adjustingthe Customizing settings.Position TypesThe introduction of more and more processes made position types necessary. The position types are stored in domain/XNFE/ITEMTYPE as fixed values.The system table /XNFE/ITEMCAT categorizes the position types according to their relevance in the business process determination.If several position types exist in an NF-e, then only the position types with the lowest number are considered during the businessprocess determination.Position Type Description Priority<Blank> Main Position 1RTP Returnable Packaging 9SRE Symbolic Return Subcontracting

Component2

PRE Return Subcontracting Component 2

Determination of the position type of an incoming NF-e is controlled in Customizing under Nota Fiscal Eletronica Inbound MaintainAssignment of Position Type to CFOP Code . Table /XNFE/CFOPCAT contains the assignment of CFOP codes to position types. Ifno entry exists in the table, then the NF-e position receives the position type blank and is therefore seen as a main position.System table /XNFE/PROCITEM: Assignment of process type to allowed position type: This table stores the position types allowed for aprocess type. If the NF-e contains a combination that is not allowed, then the NF-e reports an error.Process Determination Considering the Position TypesThe business process determination considering position types is carried out in four steps:1. Defining of the position types, which represents the meaning of the CFOP code, such as main position, or symbolic return of

subcontracting components2. Prioritizing the position types for the business process determination.3. Defining the allowed combinations for process type and position type.4. Creating a customizing table to assign the CFOP codes to the position types.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 81 of 174

ExampleIn subcontracting cases, the NF-e can contain a final product (= main item) and the subcontracting components (= symbolic return). Todetermine the correct business process, the entries must be maintained for the final product and the subcontracting components, toenable assignment of the corresponding item categories:CFOP Position Type5124 Main Item5902 Symbolic Return of subcontracting component

If an NF-e contains 5124 and 5902, then 5124 receives the higher priority. Therefore, the process “NF-e for Subcontracting” isdetermined. For an NF-e that only contains 5902, the process “Symbolic Return” is determined.

1.5.2.2 NF-e Processing Step Automation Step table /xnfe/procstep gives an overview of the process steps and their default settings. The following settings are possible:

FLAG_MANUALThis step can be carried out manually.FLAG_AUTOThis step can be carried out automatically.FLAG_ERPThis step issues a call to the ERP system. This means that this step cannot be deactivated.FLAG_MANDATORYThis step is required by the NFE system and cannot be deactivated.

Process Step PROCSTEPIMPL Flag MANUAL Flag AUTO Flag ERP Flag MANDATORYACCNOTIF Notification XML

acceptedx

AUTHORIZ Check AuthorizationAfter NF-e Receipt

x

POASSIGN Assign PurchaseOrder Items

x x x

RECDANFE Goods Arrived,Enter DANFE

x

SIGNATUR Check BusinessPartner's Signature

x

1.5.2.3 Processing Inbound NF-es

ProcedureBusiness Process DeterminationThe correct business process for every individual NF-e must be determined by the system before processing.Preprocessing Step 1: Receive the NF-e

The vendor sends an NF-e via XML to the company.The system receives the incoming NF-e from the vendor via PI, saves it to the database, and automatically checks the XML syntax.

Preprocessing Step 2: Determine the Correct Business ProcessThe business process is determined.For more information, see: Business Process Determination and Position TypesYou can control the process determination with the Business Add-In Determination of Business Process in Customizing: Nota FiscalEletrônica Incoming Business Add-Ins for Incoming NF-es BAdI: Determination of Business Process .

For detailed descriptions of business processes, see:NF-e Process Normal PurchasingNF-e Contingency ProcessNF-e Cancellation ProcessOther Processes for NF-eNF-e Stock Transfer ProcessNFE Customer-Specific Business Process with DANFENF-e Subcontracting Overview

NF-e Subcontracting Process

Example

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 82 of 174

NF-e for Symbolic ReturnsNF-e for Returns of Components

NF-e Future Delivery OverviewNF-e Goods Receipt Future Delivery ProcessNF-e Invoice Receipt Future Delivery Process

NF-e Consignment OverviewNF-e Goods Receipt Consignment ProcessNF-e Invoice Consignment Process

Returnable Packaging for NF-e Processes

1.5.2.3.1 NF-e Process Normal Purchasing To automate the processing of NF-es from a business partner, the following activities are required:

Receiving NF-e XML documents from vendorsValidating XML documentsChecking SEFAZ authorization of XML documentsNotifying and requesting information from vendorsAssigning and processing purchase orders and inbound deliveries based on XML receiptsSimulating, comparing and posting of NF-es based on XML receiptsAutomating the posting of goods receipts, invoice receipts, and notas fiscais from incoming NF-es, based on the purchasing orderHandling the purchasing process if goods arrive prior to the vendor XMLHandling of contingency scenarios, such as when the sender could not obtain authorization for an NF-e from the government (seealso NF-e Contingency Process)

If you decide not to process an NF-e, you can reject it in the NF-e Fiscal Workplace using the Additional Functions pushbutton. Afterrejecting an NF-e, you can send a notification to the issuer via e-mail. For more information, see NF-e Rejection. Vendor notification isnot triggered automatically upon rejection; you must do this manually.

ProcessNF-e for Normal Purchasing (NORMPRCH)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. NPURVALD (Auto)

Validation for Normal Purchasing4. POASSIGN (Auto)

Assign PO5. NFESIMUL

Simulate Invoice6. DELCREAT (Auto)

Normal Purchasing Inbound Delivery create7. ACCNOTIF (Auto)

Notification XML accepted8. RECDANFE

Enter DANFE9. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt10. GRCONFQU

Enter Goods Receipt Quantities11. GRFICHCK

Check Goods Receipt Quantities12. GRMMCHCK

Prepare Goods Receipt Posting13. GRPOSTNG (Auto)

Goods Receipt posting14. IVPOSTNG (Auto)

Post Invoice and NF-e15. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 83 of 174

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validation for Normal Purchasing

Actions in Step 3 Validation for Normal Purchasing (technical name: NPURVALD)If there are RTP positions, then a check of the unit of measurement (UoM) and conversion (if necessary) is carried out in the ERP

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 84 of 174

system.In addition to the validation in the ERP system, there is also a validation of the XML regarding the RTP positions. The intention is to checkthat the RTP positions do not contain any taxes.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:The validation in the ERP system comprises checks of units of measurements (UoM), conversions, and purchase orders (if existing).The validation of the XML file within the NFE system checks that the data adheres to defined rules.

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.The validation steps require the assignment information to be able to carry out the validation and for when returnable packaging isinvolved to compare the units of measure of the returnable packaging items with the ERP system. The assignments are not stored inthe validation steps. Instead, the assignments are stored in the subsequent steps for the purchase order assignments.

Step 4: Assign Purchase Order ItemsYou must assign a PO number and item to all NF-e items. in addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Actions in Step 4: Assign Purchase Order Items (technical name: POASSIGN)An NF-e item is automatically assigned to the PO from the received XML: The ERP and NFE systems check if the assignment iscomplete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of items to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerk finds a correct POnumber and item, then the fiscal clerk can manually assign the PO.

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 85 of 174

Optional activities for step 4: PO SimulationYou can manually perform this optional activity to carry out an XML simulation in the ERP system based on PO data. The simulationresult mainly contains the values and taxes of the NF-e. This information can be used to check if the assigned PO items match the dataof the incoming NF-e.While not part of the normal purchasing process, if you carry out the PO simulation, you can save simulated CFOP and tax codes to usein further processing.Step 5: Simulate Invoice and NF-e

Actions in Step 5: Simulate Invoice and NF-e (technical name: NFESIMUL)After the PO items are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. This simulation servesas check on the ERP side to verify if a later goods receipt and invoice receipt can be posted. The fiscal clerk can visualize thesimulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e can proceed to the next processing phase.If the simulation is not correct, then the NF-e receives the result Simulation Not OK. In this case, the fiscal clerk can either:1. Reject the NF-e and notify the vendor. (Vendor notification is not triggered automatically upon rejection; the fiscal clerk must notifythe vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

NF-e Simulation with PO dataNo data is sent to the ERP system. There are no simulation results for RTP.NF-e Simulation with XML dataNo data is sent to the ERP system. There are no simulation results for RTP.

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 6–7: Generate Inbound Delivery, Notification XML Accepted

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 86 of 174

Actions in Step 6: Generate Inbound Delivery (technical name: DELCREAT)If the simulation is OK, then the system triggers the subcontracting inbound delivery creation:

The NFE system calls the ERP system to check the purchase order (PO), the PO item, and the XML quantity.The ERP system uses the PO, the PO item, and the XML quantity data to create an inbound delivery number.The ERP system sends the created inbound delivery number back to the NFE system.The NFE system assigns the inbound delivery. The normal purchase NF-e can proceed to the next processing step.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Inbound Delivery CreationRTP data is sent to the ERP systemThe ERP system creates additional lines for RTPThe ERP system returns the inbound delivery number and position to the NFE system

Actions in Step 7: Notification XML Accepted (technical name: ACCNOTIF)The fiscal clerk notifies the vendor that the XML has been accepted.The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 8–9: Enter DANFE, Check Authorization After DANFE ReceiptThe vendor sends the goods, together with the DANFE, to the company, and the goods arrive at the company.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 87 of 174

Actions in Step 8: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk can compare the PDF preview of the XML with the DANFE. The fiscal clerk sets this process step to OK or Not OK. Ifthe status is OK, the system automatically continues with the next step.

Actions in Step 9: Check Authorization After DANFE Receipt (technical name: AUTHGRPT)The system checks if the NF-e is still authorized.

Step 10–12: Enter Goods Receipt Quantities, Check Goods Receipt Quantities, Prepare Goods Receipt Posting

Actions in Step 10: Enter Goods Receipt Quantities (technical name: GRCONFQU)The logistics clerk counts the quantities. By default, the quantities in the NF-e are used as the reference point.If counted quantities deviate from the default values, the logistics clerk can overwrite and enter other quantities.Once all quantities are entered and checked, the logistics clerk saves all quantities and sets the status to OK.

Actions in Step 11: Check Goods Receipt Quantities (technical name: GRFICHCK)The fiscal clerk compares the quantities from the NF-e with the received quantities (see step 8).The fiscal clerk confirms and sets the status of this step to OK.

Actions in Step 12: Prepare Goods Receipt Posting (technical name: GRMMCHCK)The logistics clerk confirms that all preparations are complete and that the goods receipt can be posted.The logistics clerk sets the status of this step to OK.

Steps 13–14: Post Goods Receipt and Post Invoice and NF-e

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 88 of 174

Actions in Step 13: Posting Goods Receipt (technical name: GRPOSTNG)The fiscal clerk posts the goods receipt to the ERP system.The inbound delivery number is sent to the ERP system and the goods receipt for the inbound delivery is posted.The NFE system receives the goods receipt report from the ERP system:1. Goods receipt successful: In this case, the fiscal clerk sets the status of the step to OK.2. Goods receipt failed: In this case, the fiscal clerk sets the step to Not OK and carries out manual corrections in the ERP system.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Goods Receipt for Inbound DeliveryThe RTP data is sent to the ERP system together with the references of the inbound delivery number and positionThe ERP posts the goods receipt with the RTP data.The ERP system checks that the RTP positions in the inbound delivery are still consistent

Actions in Step 14: Post Invoice and NF-e (technical name: IVPOSTNG)The invoice receipt is posted to the ERP system.The NFE system receives the result of the invoice receipt from the ERP system:1. Invoice receipt successful: In this case, the status of the step is set to OK. The NFE process is completed.2. Invoice receipt failed and no invoice is created: In this case, the step is set to Not OK and you must carry out manual corrections in

the ERP system.3. Invoice receipt failed and a parked invoice is created: In this case, the status of the step is set to OK, but you still must carry out

manual corrections in the ERP system. Nevertheless, the NFE process is completed.The NF-e is created and posted in the ERP system together with the invoice receipt.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

RTP data is not required. The RTP lines in the NF-e are created automatically based on the lines in the material document

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 15: Operation Confirmation Event

Actions in Step 15: Operation Confirmation (technical name: SENDOPCO)After the successful execution of the previous step, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 89 of 174

The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.1.1 Processing in SAP ERP: Normal Purchasing To automatically process the information in an incoming NF-e and create the follow-on documents, SAP Nota Fiscal Eletrônicacommunicates with your SAP ERP system and vice versa. This communication occurs during the following steps in the incomingprocess:

Assign Purchase Order ItemsSimulate Invoice and NF-eGenerate Inbound DeliveryPost Goods ReceiptPost Invoice and NF-e

The two systems also exchange information in the following special situations:The issuer shipped the goods when the company was operating in contingency mode. In this case, the goods and the DANFE arriveat your site before the XML for the incoming NF-e.An incoming NF-e is canceled by the issuer and you have not yet started the goods receipt process.

The data that is exchanged between the two systems is explained in more detail in the following documentation.ERP Documents

VendorSales Order with Reference to Purchase OrderOutbound DeliveryGoods IssueBilling DocumentOutbound NF-e created out of the Billing Document

BuyerPurchase OrderInbound DeliveryMaterial Document Goods ReceiptInvoiceInbound NF-e created out of the Invoice

PrerequisitesYou have set up the RFC connection between SAP Nota Fiscal Eletrônica and your SAP ERP system. For more information, seeTechnical Settings in Core Application (Inbound).You have completed the necessary Customizing settings in your SAP ERP system. For more information, see Related Configurationin SAP ERP.

Features

Assign Purchase Order ItemsAt several points during this process step, the two systems exchange information as follows:

Find Purchase Order Items

If the XML for the incoming NF-e does not contain any purchase order details, you can trigger a search to find the correspondingpurchase order items in your SAP ERP system.

Item-Based SearchFind purchase order: You can enter a purchase order number (required) and the purchase order item number (optional) to trigger aspecific search.Extended search: Your SAP ERP system uses the CNPJ numbers and material numbers from the incoming XML to find possiblepurchase orders with the equivalent material number in your SAP ERP system. You can limit this search by entering a range for thedate on which the purchase order was created or the date of the corresponding inbound delivery. The system then uses the valuefor the NCM code to filter the list of possible matches (if any).

A fuzzy search is only available for the ERP Mat. No. and the Vendor Prod/Serv Code fields. If you make (or change) an entry inany of the other search fields, you must enter the entire value. Do not enter * or a partial value.

Global SearchFind purchase order item by purchase number: You can enter a purchase order number directly to receive all related purchaseorder items.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 90 of 174

Find purchase order: You can use the input help to receive a list of purchase order numbers. Select one entry to receive all relatedpurchase order items. Your SAP ERP system uses the CNPJ numbers from the incoming XML to find possible purchase orders inyour SAP ERP system. You can limit this search by entering a range for the date on which the purchase order was created or thedate of the corresponding inbound delivery.

If your SAP ERP system finds a possible match, it sends the relevant data to SAP Nota Fiscal Eletrônica for purchase order items thathave not been delivered or deleted. You can then select the correct items.

Validate Purchase Orders

After the items in the XML are assigned to purchase order items, SAP Nota Fiscal Eletrônica needs to validate this information bycomparing it with the purchase order data in your SAP ERP system. Your SAP ERP system searches for the purchase order number inits database and when it finds a match, checks the quantities as follows:1. Confirms that the unit of measurement (UoM) in the incoming NF-e exists in the SAP ERP system2. Converts the UoM of the quantity in the incoming XML according to the settings you made in your SAP ERP system3. Provides SAP Nota Fiscal Eletrônica with the ISO code mapped to the UoMIn addition, the system checks whether the recipient’s CNPJ in XML is the same as the CNPJ of the business place that is linked to thepurchase order.

The system supports the assignment of multiple NF-e items to the same purchase order item. This feature is not supported if thepurchase order item has multiple accounts assignment.

Simulate PO Items

Once the assignment to the purchase order items is made and validated, you can trigger a simulation using the price from the purchaseorder and the quantity from the incoming XML data. Your SAP ERP system simulates the NF-e posting and returns the simulation resultsfor you to check.If needed, you can overwrite the tax codes or CFOP codes proposed by the system and run the simulation with different selections.Your SAP ERP system selects the tax codes and CFOP codes as follows:

Select tax codes: To create the simulation, your SAP ERP system uses the tax codes for each purchase order item in the purchaseorder as the default values for tax codes in the NF-e. However, you can overwrite these default values using a list of possible taxcodes that are proposed by your SAP ERP system. The SAP ERP system proposes the allowed tax codes based on a check of thematerial usage and tax type (input/output tax) for each purchase item.Select CFOP codes: To create the simulation, your SAP ERP system uses the CFOP codes defined in Customizing as the defaultvalues in the NF-e. However, you can overwrite these default values using a list of all possible CFOP codes for the region and datethat are proposed by your SAP ERP system and filtered by SAP Nota Fiscal Eletrônica.

Simulate Invoice and NF-eTo check if the invoice and NF-e can be posted once the goods arrive, you can run a simulation of the invoice and NF-e posting in yourSAP ERP system. Your SAP ERP system uses the prices and NF-e data from the incoming XML and the assigned purchase orderitems to simulate the prices and taxes.During the simulation, the system makes several checks:

Standard checks that are also made when such a posting is made using the MIRO transaction. These include, for example, tolerancechecks and a balance check.NF-e Issuer’s CNPJ checks between the data in the XML and the master data of vendor or of the invoicing party in the purchaseorder.Tax comparison checks between the data in the XML and the tax codes and Customizing settings in your SAP ERP system. Thefollowing is checked:

ICMS rateIPI rateICST rate

Note that there is no tax comparison for PIS and COFINS, because incoming PIS and COFINS are posted according to the settings inSAP ERP, which can differ from the values in XML.

You can add your own checks by implementing the Check XML for Invoice (CHECK_INVOICE) method in the Conversions forIncoming NF-e Automation (J_1BNFE_IN) Business Add-In (BAdI) in your SAP ERP system. The system runs your checks after thestandard validation checks. For more information, see the BAdI method documentation in the system.

The simulation results show errors and warnings that may occur. If the tax comparison checks result in an error, the cause may be oneor more of the following:

XML content is not correctTax code is not correctCustomizing in your SAP ERP system (for example, related to tax rates) is not up-to-date

If needed, you can overwrite the tax codes or CFOP codes proposed by the system and run the simulation with different selections.

Generate Inbound DeliveryWhen the status of the invoice and NF-e posting simulation is set to okay, SAP Nota Fiscal Eletrônica informs your SAP ERP system.Your SAP ERP system uses the delivery quantities and UoM from the incoming XML to create the actual inbound delivery automatically.The system checks that there will be only one inbound delivery created for one nota fiscal. If the settings in PO cause a delivery split(e.g. different incoterms), the system will not create the inbound delivery.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 91 of 174

You can implement your own logic in the Search for Inbound Delivery (INBOUND_DELIV_SEARCH) method in the Conversions forIncoming NF-e Automation (J_1BNFE_IN) Business Add-In (BAdI) method to add a search for existing inbound deliveries in yourSAP ERP system during this process step.

Your SAP ERP system saves the NF-e number and the series in the header of the delivery document and sends the delivery documentnumber to SAP Nota Fiscal Eletrônica. If your SAP ERP system cannot create the inbound delivery, the system sends a correspondingmessage to SAP Nota Fiscal Eletrônica.

Batch Split

It is possible to manually split the inbound delivery into batches in your SAP ERP system using the VL32n transaction. If you createbatches, your SAP ERP system posts the corresponding goods receipt with the same number of line items as in the split inbounddelivery. However, since an NF-e can have only one line item for the <det nItem> tag in the XML, your SAP ERP system posts theNF-e with one line item, using the quantity from the XML. The invoice is posted with the line items as in the split inbound delivery andgoods receipt.

Post Goods ReceiptAfter the goods arrive and you complete all logistics-relevant activities, you can trigger the goods receipt posting from SAP Nota FiscalEletrônica. Your SAP ERP system then automatically posts the goods receipt for the corresponding inbound delivery and sends theresulting material document number to SAP Nota Fiscal Eletrônica.

Post Invoice and NF-eUsing the data from SAP Nota Fiscal Eletrônica, your SAP ERP system compares the quantities in the goods receipt with the quantitiesin the incoming XML to ensure that they are still the same. If they are not the same, the processing cannot continue. If the values arecorrect, your SAP ERP system automatically posts the invoice and corresponding NF-e using the prices from the XML. Your SAP ERPsystem sends the resulting invoice number and the fiscal year to SAP Nota Fiscal Eletrônica. Note that the invoice is always postedusing the local currency, even when the value of the items in purchase order is in a foreign currency.If an invoice cannot be posted, your SAP ERP system sends an error message to SAP Nota Fiscal Eletrônica. If the error can be fixed,the user can then repeat the posting step in SAP Nota Fiscal Eletrônica. If not, the user can set the NF-e to complete in SAP Nota FiscalEletrônica and then post the invoice and NF-e in SAP ERP manually.

More InformationThis document describes the communication and document flow for the normal purchasing process. For information about the specificsrelated to other purchasing processes, see the corresponding documentation:

Processing in SAP ERP: ContingencyProcessing in SAP ERP: CancellationProcessing in SAP ERP: Stock TransferProcessing in SAP ERP: NF-e for Subcontracting (SUBCON1A)Processing in SAP ERP: NF-e for Symbolic Returns (SUBCON2C)Processing in SAP ERP: NF-e for Return of Components (SUBCON2D)Processing in SAP ERP: Future Delivery InvoiceProcessing in SAP ERP: Future Delivery Goods ReceiptProcessing in SAP ERP: Consignment Goods ReceiptProcessing in SAP ERP: Consignment InvoiceProcessing in SAP ERP: Returnable Packaging with Purchased Goods

1.5.2.3.2 NF-e Contingency Process This process is used if a DANFE (Documento Auxiliar da NF-e, or supplementary NF-e document) arrives before the XML, and is alsovalid for other NF-e contingencies.If the XML exists and the assigned business process contains a step to receive the DANFE document, then this step is set to OK andthe processing continues. If the XML does not exist and the user decides to post the DANFE, the DANFE is stored with all the data thatwas retrieved from the access key, and the DANWOXML process (DANFE without XML) is assigned to the document.Process DANFE without Business Process (technical name DANWOXML)This process consists of the following steps:

AUTHBXMLAuthorization at DANFE Receipt w/o XMLXMLARRIVXML Arrives when DANFE Already ExistsAUTHORIZ (Auto)Check Authorization After NF-e ReceiptDWOXVALDValidation for DANFE Before XMLNFEINERPCheck Existence of NF-e in ERP

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 92 of 174

SENDOPCO (Auto, deactivated)Send Operation Confirmation

Process Type: DANWOXML

ProcessThis process is used if a DANFE arrives before the XML

When entering the DANFE (44–digit access key), the system checks if the XML is available. If no XML is available, you have theoption to store the DANFE with all data that can be retrieved from the access key.If you accept the DANFE, the DANWOXML process is assigned. This means you must out the logistics processing actions manually.

The arrival of the XML does not change the process type: no new process determination occurs.

This process is valid if this is an NF-e in contingency.The process is carried out as follows:

Authorization is checked at SEFAZYou must analyze the results of the authorization check because there may be a contingency NF-e that does not exist at SEFAZ, Thefollowing options exist:

NF-e does not exist at SEFAZ and there is no contingency NF-e. Result: ErrorNF-e does not exist at SEFAZ and contingency NF-e. Result: Process continuesNF-e exists at SEFAZ, but is not authorized. Result: ErrorNF-e exists at SEFAZ and is authorized: Process continues

If the process can be continued, the system waits for the arrival of the corresponding XML in the next step.If the XML arrives, then the step is set to OK and another authorization check is carried out at SEFAZ.If the authorization is validated, then the step is set to OK and the system checks if a corresponding NF-e was posted in the ERPsystem.Now the validation step DWOXVALD is executed.

This validation step contains a BAdI that can be used to carry out a customer specific validation of the incoming XML document.For more information, see BAdIs for Incoming NF-e.

If the corresponding NF-e is found, the system checks if certain values match, for example, the total value and the ICMS total value. Ifthese values match, then the step is set to OK and the NF-e is set to status completed.If no corresponding NF-e can be found, then the step is set to Not OK. However, this step can be repeated.If no corresponding NF-e is posted in the ERP system, then the process can be manually set to completed after carrying out checks inthe ERP system.

If you decide that you do not want to process an NF-e, you can reject it in the NF-e Fiscal Workplace by choosing AdditionalFunctions. For more information, see NF-e Rejection. Note that the vendor notification is not triggered automatically, it must betriggered via a user action (see Vendor Notification).

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 93 of 174

An additional step has been added after Check Existence of NF-e in ERP.

Step: Operation Confirmation Event

Actions in Step: Operation Confirmation (technical name: SENDOPCO)After the successful previous step, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.2.1 Processing in SAP ERP: Contingency To automatically process the information in an incoming NF-e and to create the follow-on documents, SAP Nota Fiscal Eletrônicacommunicates with your SAP ERP system. This documentation focuses on the communication and processing specific to processingwhenthe vendor ships goods while operating in contingency mode. For information about the standard communication and processingof incoming NF-e, see Processing in SAP ERP: Normal Purchasing.

Features

Contingency ModeIf the issuer is running under contingency, the goods and DANFE may arrive at your site before the XML for the incoming NF-e. If theDANFE arrives before the XML, you can create the inbound delivery manually and create a corresponding incoming NF-e in your SAPERP system.When the XML for the incoming NF-e arrives, SAP Nota Fiscal Eletrônica sends the NF-e access key to your SAP ERP system, whichthen checks if the incoming NF-e has already been created manually. If an incoming NF-e was created, SAP Nota Fiscal Eletrônicasends the following data about the NF-e from the incoming XML to your SAP ERP system:

Protocol numberAuthorization date and timeXML version

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 94 of 174

Your SAP ERP system updates this information in the posted NF-e and sends the amounts that have been posted for the NF-e to SAPNota Fiscal Eletrônica for further processing. If the incoming NF-e does not exist in your SAP ERP system, the system sends acorresponding message to SAP Nota Fiscal Eletrônica.

1.5.2.3.3 NF-e Cancellation Process When an incoming NF-e is canceled, SAP Nota Fiscal Eletrônica automatically sends the corresponding internal delivery documentnumber to your SAP ERP system for checking. Your SAP ERP system checks if the goods receipt process for this inbound delivery hasbeen started.If the good receipt process has not been started, your SAP ERP system deletes the inbound delivery and informs SAP Nota FiscalEletrônica of the successful deletion. If the goods receipt process has been started, the inbound delivery can not be deleted, and yourSAP ERP system informs SAP Nota Fiscal Eletrônica accordingly.

The automated deletion of inbound deliveries is only possible for inbound deliveries that are created using the incoming NF-eautomation functions in SAP Nota Fiscal Eletrônica.

You use one of three cancellation processes to cancel an NF-e:1. CANCEL002. CANCEL013. CANCEL02 (for the special case if a cancellation event arrives before the appropriate NF-e has arrived in the system)Every process type has a fixed cancel process assigned to it. The table below lists the processes that can be canceled, along with theirassigned cancellation process type:

NF-e for Normal PurchasingThe process type is NF-e for Normal Purchasing (technical name: NORMPRCH), the corresponding cancel process type isCancellation of NF-e (technical name: CANCEL00).NF-e for other processes without DANFEThe process type is NF-e for other processes without DANFE (technical name: SIGNAUTH), the corresponding cancel process typeis Cancellation of NF-e, general process (technical name: CANCEL01).NF-e for other processes with DANFEThe process type is NF-e for other processes with DANFE (technical name: SIGNAUT2), the corresponding cancel process type isCancellation of NF-e, general process (technical name: CANCEL01)..NF-e without business process assignmentThe process type is NF-e without business process assignment (technical name: BUPRODET), the corresponding cancel processtype is Cancellation of NF-e, general process (technical name: CANCEL01).NF-e for Stock TransferThe process type is NF-e for Stock Transfer (technical name: STOCKTRF), the corresponding cancel process type is Cancellation ofNF-e, general process (technical name: CANCEL01).NF-e for subcontractingThe process type is NF-e for subcontracting (technical name: SUBCON1A), the corresponding cancel process type is Cancellationof NF-e (technical name: CANCEL00).Symbolic return of subcontracting componentsThe process type is Symbolic return of subcontracting components (technical name: SUBCON2C), the corresponding cancelprocess type is Cancellation of NF-e, general process (technical name: CANCEL01).Return of subcontracting componentsThe process type is Return of subcontracting components (technical name: SUBCON2D), the corresponding cancel process type isCancellation of NF-e, general process (technical name: CANCEL01).Future Delivery - Invoice ReceiptThe process type is Future Delivery - Invoice Receipt (technical name: FUTDELIV), the corresponding cancel process type isCancellation of NF-e, general process (technical name: CANCEL01).Future Delivery - Goods ReceiptThe process type is Future Delivery - Goods Receipt (technical name: FUTDELGR), the corresponding cancel process type isCancellation of NF-e (technical name: CANCEL00).Custumer specific Business Process with DANFEThe process type is Custumer specific Business Process with DANFE (technical name: FLEXPRO01), the corresponding cancelprocess type is Cancellation of NF-e, general process (technical name: CANCEL01).DANFE arrives before XMLThe process type is DANFE arrives before XML (technical name: DANWOXML), the corresponding cancel process type isCancellation of NF-e (technical name: CANCEL00).Consignment - Invoice ReceiptThe process type is Consignment - Invoice Receipt (technical name: CONSIGIV), the corresponding cancel process type isCancellation of NF-e, general process (technical name: CANCEL01).Consignment - Goods ReceiptThe process type is Consignment - Goods Receipt (technical name: CONSIGGR), the corresponding cancel process type isCancellation of NF-e (technical name: CANCEL00).

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 95 of 174

Example

ProcessIf a canceled NF-e arrives, the system carries out the following steps. If the automatic process fails, then the user can manually carry outindividual follow-on actions in the workplace.

Assign Business Process Cancellation of NF-e (technical name: CANCEL00Step: Check Business Partner's Signature (technical name: SIGNATUR)Check if this step was carried out correctly:

If yes, proceed to the next check.If No, then the step is not OK and either the user or the system can decide what happens with this NF-e:

Cancellation rejected: Go back to original process and continue there.Cancellation accepted: The NF-e is canceled and the processing finished.

Step: Check Authorization after Cancellation XML (technical name: AUTHCANC)Check if this step was carried out correctly:

If yes, proceed to the next check.If No, then the step is not OK and either the user or the system can decide what happens with this NF-e:

Cancellation rejected: Go back to original process and continue there.Cancellation accepted: The NF-e is canceled and the processing finished.

Step: XML Arrives when DANFE Already Exists (technical name: XMLARRIV)Check if this step was carried out correctly:

If yes, proceed to the next check.If No, then the step is not OK and either the user or the system can decide what happens with this NF-e:

Cancellation rejected: Go back to original process and continue there.Cancellation accepted: The NF-e is canceled and the processing finished.

Step: Delete a Delivery IN ERP (technical name: DELDELET)Check if this step was carried out correctly:

If yes, proceed to the next check.If No, then the step is not OK and either the user or the system can decide what happens with this NF-e:

Cancellation rejected: Go back to original process and continue there.Cancellation accepted: The NF-e is canceled and the processing finished.

Step: Check Manual Activities in ERP (technical name: ERPTASKS)Check if this step was carried out correctly:

If yes, proceed to the next check.If No, then the step is not OK and either the user or the system can decide what happens with this NF-e:

Cancellation rejected: Go back to original process and continue there.Cancellation accepted: The NF-e is canceled and the processing finished.

NF-e completeIf all these steps have been checked, then the processing of the NF-e is finished. The NF-e is either canceled or sent back to theoriginal processing.

If you decide that you do not want to process an NF-e, you can reject it in the Fiscal Workplace by choosing Additional Functions.After a rejection, you can notify the vendor via e-mail. For more information see NF-e Rejection. Note that the vendor notification isnot triggered automatically, it must be triggered via a user action (see Vendor Notification).

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 96 of 174

New Cancellation Process for NF-eWith SP12, a cancellation event replaces the cancellation NF-e. Before SP12, an NF-e was sent to a cancellation process if acancellation NF-e arrived. This function is now carried out through the cancellation event.

The special case [cancellation event arrives before the corresponding NF-e exists in the system] requires an additional cancelprocess. In this special case, an entry for a cancellation NF-e is created in the tables for incoming NF-es, and the new cancelprocess CANCEL02 is assigned:

Name of the additional cancel process: Cancellation of NF-eTechnical name of the cancel process: CANCEL02Steps of the cancellation process CANCEL02:1. Arrival of XML (technical name: XMLARRIV)2. Check manual activities in ERP (technical name: ERPTASKS)

The new cancellation process is used if the cancellation event arrives in the system before the NF-e has arrived.

1.5.2.3.3.1 Processing in SAP ERP: Cancellation When an incoming NF-e is canceled, SAP Nota Fiscal Eletrônica automatically sends the corresponding internal delivery documentnumber to your SAP ERP system for checking. Your SAP ERP system checks if the goods receipt process for this inbound delivery hasbeen started.If the good receipt process has not been started, your SAP ERP system deletes the inbound delivery and informs SAP Nota FiscalEletrônica of the successful deletion.

The automated deletion of inbound deliveries is only possible for inbound deliveries that are created using the Incoming NF-eAutomation functions in SAP Nota Fiscal Eletrônica.

If the goods receipt process has been started, the inbound delivery can not be deleted, and your SAP ERP system informs SAP NotaFiscal Eletrônica accordingly. If you do not want your SAP ERP system to automatically delete inbound deliveries, you can implementyour own logic in the Check if Deletion of Inbound Delivery Possible (INBOUND_DELIV_ DELETE_CHECK) method in theConversions for Incoming NF-e Automation (J_1BNFE_IN) Business Add-In (BAdI).

More InformationFor information about the standard communication and processing of incoming NF-e, see Processing in SAP ERP: Normal Purchasing.

1.5.2.3.4 Other Processes for NF-es

ProcessThe following other processes are available for processing NF-es:

Determine Business Process(Technical name: BUPRODET)This process is triggered whenever differing business processes are assigned to the same CFOPs in a NF-e. This is interpreted as anerror, because a single NF-e cannot contain several business processes.After changing the customizing for the business process determination, you can carry out a new business process determination toresolve the error.NF-e for Other Processes without DANFE(Technical name: SIGNAUTH)This process is used when no business processes are assigned to the CFOP codes in a NF-e. The system carries out the followingsteps:1. Check Business Partner's Signature (technical name: SIGNATUR)2. Check Authorization after NF-e Receipt (technical name: AUTHORIZ)3. Validate XML (technical name: SIGNVALD)

This validation step contains a BAdI that can be used to carry out a customer-specific validation of the incoming XML document.4. Check Manual Activities in ERP (technical name: ERPTASKS)5. Send Operation Confirmation (technical name: SENDOPCO

(Auto, deactivated))The step (ERPTASKS) lets you check if you must carry out manual actions for the NF-e in the ERP system before you can mark it as

Caution

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 97 of 174

completed.After you have carried out all required manual actions, you can set the ERPTASKS step to OK; the NF-e is then completed.After you have changed the customizing for the business process determination, you can start a new business process determinationfor this NF-e.NF-e for Other Processes with DANFE(Technical name: SIGNAUT2)You can select this process manually via the customizing of the business process determination.

1. Check Business Partner's Signature (technical name: SIGNATUR)2. Check Authorization after NF-e Receipt (technical name: AUTHORIZ)3. Validate XML (technical name: SIG2VALD)

This validation step contains a BAdI that can be used to carry out a customer-specific validation of the incoming XML document.4. Manual Step before Notification: (technical name: ACCPTNFE)5. Notification XML accepted (technical name: ACCNOTIF6. Goods Arrived, Enter DANFE (technical name: RECDANFE)7. Check Manual Activities in ERP (technical name: ERPTASKS)8. Send Operation Confirmation (technical name: SENDOPCO

(Auto, deactivated))

The Goods Arrived, Enter DANFE step comprises several manual actions. You must decide which actions you need to carry out.After you have carried out all necessary actions, you can set this step to OK so that the NF-e can continue to be processed andeventually completed.

1.5.2.3.4.1 Processing in SAP ERP: Other Processes for NF-e There is no automatic communication in the NFE application for Other Processes. The step ERPTASKS notifies you to check if you mustcarry out manual actions, but you must decide which actions to carry out. After you have successfully carried out all necessary actions,you can set this step to OK so that the NF-e can be processed and eventually completed.

1.5.2.3.5 NF-e Stock Transfer Process

Prerequisites

System Configuration for Stock Transfer OrdersTo process stock transfer orders (STOs) in SAP Nota Fiscal Eletrônica (SAP NFE), you must set the B2B communication to DB forevery individual tax number or CNPJ, as follows:1. In Customizing, go to Nota Fiscal Eletrônica Outgoing Activate B2B Scenarios for Business Partners .2. Change the B2B Active field to D - Communication via DB (local)3. Save your changes.

To automatically process STOs, your company branches must use the same system client and belong to the same company code.An outbound STO does not pass through the XI interface; instead, it is transferred directly to the database of your inbound system.

Invoice Consignment (Technical name: STOCKTRF)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. STOCVALD (Auto)

Validate Future Delivery4. ACCNOTIF (Auto)

Notification XML accepted5. RECDANFE

Enter DANFE6. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt7. GRCONFQU

Enter Goods Receipt Quantities8. GRFICHCK (Auto)

Check Goods Receipt Quantities

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 98 of 174

9. GRMMCHCKPrepare Goods Receipt Posting

10. GRSTOPST (Auto)Post Goods Receipt Future Delivery

11. SENDOPCO (Auto, deactivated)Send Operation Confirmation

Process

Process Steps 1–2: Check Business Partner's Signature; Check Authorization after NF-e Receipt

Step 1: Check Business Partner's Signature

(Technical name: SIGNATUR)The system checks if the signature is OK.

Signature OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, see thedocumentation in Customizing under Nota Fiscal Eletrônica Signature .Signature Not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Vendor notification is not triggered automatically; you must trigger it manually. For more information, see Vendor Notification.

Step 2: Check Authorization after NF-e Receipt

(Technical name: AUTHORIZ)The system checks the NF-e's authorization status received from the SEFAZ tax authority's Web service. This communication is carriedout using an asynchronous call.

XML Authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML Not Authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Vendor notification is not triggered automatically; you must trigger it manually. For more information, see Vendor Notification.

Step 3: Validation for Stock Transfer (Technical name: STOCVALD)

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 99 of 174

Actions in Step 3: Validate Future Delivery (technical name: STOCVALD)This validation step contains a BAdI that can be used to carry out a customer specific validation of the incoming XML document.

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.

Steps 4–6: Notification XML Accepted; Enter DANFE; Check Authorization after DANFE ReceiptThe vendor sends the goods together with the DANFE to your company, and the goods and DANFE arrive.

Step 4: Notification XML Accepted

(Technical name: ACCNOTIF)The NF-e fiscal clerk notifies the vendor that the XML has been accepted, and then sets this process step to OK or Not OK. If the statusis OK, the system automatically continues with the next step.

Step 5: Enter DANFE

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 100 of 174

(Technical name: RECDANFE)The NFE system notifies the vendor that the XML has been accepted, and then sets this process step to OK or Not OK. If the status isOK, the system automatically continues with the next step.

Step 6: Check Authorization after DANFE Receipt

(Technical name: AUTHGRPT)The system automatically checks the authorization status of the XML via the SEFAZ tax authority's Web service (this does not apply tocontingency DANFEs printed on security paper).

Steps 7–9: Enter Goods Receipt Quantities; Check Goods Receipt Quantities; Prepare Goods Receipt Posting

Step 7: Enter Goods Receipt Quantities

(Technical name: GRCONFQU)1. The NF-e logistics clerk counts the quantities. By default, the logistics clerk uses the quantities listed in the NF-e.2. If counted quantities deviate from the default values, the logistics clerk can overwrite and enter other quantities.3. After the logistics clerk enters and checks all quantities, the logistics clerk must save all quantities and set the status of this step to

OK.

Step 8: Check Goods Receipts Quantities

(Technical name: GRFICHCK)The NF-e fiscal clerk compares the quantities listed in the NF-e with the received quantities, and sets the status of this step to OK

Step 9: Prepare Goods Receipt Posting

(Technical name: GRMMCHCK)The NF-e logistics clerk confirms that all preparations are complete and that the goods receipt can be posted, and then sets the statusof this step to OK

Step 10: Post Goods Receipt Stock Transfer

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 101 of 174

Actions in Step 10:(Technical name: GRSTOPST)1. The goods receipt is posted in the ERP system.2. The inbound delivery number is sent to the ERP system and the goods receipt for the inbound delivery is posted.3. The SAP NFE system receives the result of the goods receipt from the ERP system:

Goods Receipt Successful: The status of the step is set to OK.Goods Receipt Failed: The status of the step is set to Not OK and you must make manual corrections in the ERP system.

If you do not want to process a NF-e, you can reject it in the NF-e Fiscal Workplace by choosing Additional Functions. For moreinformation, see NF-e Rejection.

NFE Settings for Stock Transfer Order Outbound HandlingIn the B2B customizing table, set the indicator for your company's CNPJ to D. Use the CFOP to determine the STOCKTRF process type.

Procedure

1. Create the outgoing NF-e to a stock transfer.2. The NF-e is sent to the SAP NFE system3. After processing the NF-e, the system checks if the NF-e should be sent to a business partner. (Up to this step, there is no difference

between this NF-e and other NF-es.)4. Determine the NF-e target: See the instructions in Prerequisites; see also the table entry for the STO process in NF-e Cancellation

Process. The following options are available:“ “: No communicationX: Communication via XID: Communication via DB (local)

For Stock Transfer Order, set the indicator to D, which creates the incoming NF-e directly in your database. The logic used is thesame as when an incoming NF-e is sent from an external system to your SAP NFE system. Your system determines the businessprocess and triggers further processing.

Step 11: Operation Confirmation Event

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 102 of 174

Actions in Step 11: Operation Confirmation (technical name: SENDOPCO)After the successful GR, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.5.1 Processing in SAP ERP: Stock Transfer In the Post Goods Receipt for Stock Transfer inbound process, your SAP Nota Fiscal Eletrônica system communicates with your SAPERP system and exchanges data. This documentation focuses on the communication and processing during the Post Goods Receiptfor Stock Transfer step. For information about the standard communication and processing in all steps of the incoming process, seeProcessing in SAP ERP: Normal Purchasing.

Features

Post Goods Receipt for Stock TransferAfter a stock transfer is authorized, you can view the corresponding NF-e in the NF-e Fiscal Workplace.After the goods receipt is confirmed in the NF-e Logistics Workplace, SAP Nota Fiscal Eletrônica sends the access key from the NF-eto your SAP ERP system for checking and to be used in the posting of necessary follow-on documents. Your SAP ERP system does thefollowing:1. Based on the information in the access key, the SAP ERP system tries to locate a reference document by searching for documents

in the following order:1. The system tries to find the inbound delivery.2. If the system cannot find the inbound delivery, the system looks for the outbound delivery.3. If the system cannot find the outbound delivery, the system looks for a corresponding goods reference.

2. The system automatically posts the good receipt, using an inbound delivery number, or an outbound delivery number, or a materialdocument number as the reference.

3. The system creates the corresponding inbound NF-e using the tax code and other relevant data, such as the access key or XMLversion, from the outgoing NF-e.

4. The system sends the material document number from the goods receipt to SAP Nota Fiscal Eletrônica. If NF-e processing cannotbe completed, the system sends an error message.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 103 of 174

1.5.2.3.6 NF-e Process Customer-Specific Business Processwith DANFE

ProcessIn addition to the processes included in the standard shipment of SAP Nota Fiscal Eletrônica (SAP NFE), SAP NFE also offers a flexibleprocess that can trigger customer-specific actions in the ERP system. Two new steps have been added to the Customer-SpecificBusiness Process with DANFE (technical name FLEXPR01) to allow you to call your own actions, events, or processes in the ERPsystem:

Customer-specific step before DANFE (BADIBEFD): You carry out this BAdI-based step before the arrival of goods and thecorresponding DANFE.Customer-specific step after DANFE (BADIAFTD): You carry out this BAdI-based step after the arrival of goods and thecorresponding DANFE.

Customer Specific Business Process with DANFE contains the following technical steps:Customer-Specific Business Process with DANFE (FLEXPR01)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. FLEXVALD (Auto)

Validate Future Delivery4. BADIBEFD (Auto)

Customer-Specific Step Before DANFE5. ACCNOTIF (Auto)

Notification XML accepted6. RECDANFE

Enter DANFE7. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt8. BADIAFTD (Auto)

Customer-Specific Step After DANFE9. SENDOPCO (Auto, deactivated)

Send Operation Confirmation

Steps 1–2: Check Business Partner's Signature; Check Authorization after NF-e Receipt

Step 1: Check Business Partner's Signature

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 104 of 174

(Technical name: SIGNATUR)The system checks if the signature is OK.

Signature OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, see thedocumentation in Customizing under Nota Fiscal Eletrônica Signature .Signature Not OK: The NF-e is rejected and the vendor is notified.

Vendor notification is not triggered automatically; you must trigger it manually. For more information, see Vendor Notification.

Step 2: Check Authorization after NF-e Receipt

(Technical name: AUTHORIZ)The system checks the NF-e's authorization status received from the SEFAZ tax authority's Web service. This communication is carriedout using an asynchronous call.

XML Authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML Not Authorized: The NF-e is rejected and the vendor is notified.

Vendor notification is not triggered automatically; you must trigger it manually. For more information, see Vendor Notification.

Step 3: Validate XML (technical name: FLEXVALD)

This validation step contains a BAdI that can be used to carry out a customer specific validation of the incoming XML document. Formore information, see BAdIs for Incoming NF-e.

Steps 4–5: Customer-Specific Step Before DANFE; Notification XML Accepted

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 105 of 174

Step 4: Customer-Specific Step Before DANFE

(Technical name: BADIBEFD)You can implement this BAdI-based step according to your requirements. For more information, see the documentation in Customizingunder Nota Fiscal Eletrônica Incoming Business Add-Ins for Incoming NF-es BAdI: Step Implementation before/after DANFE .

Step 5: Notification XML Accepted

(Technical name: ACCNOTIF)The NF-e fiscal clerk notifies the vendor that the XML has been accepted, and then sets this process step to OK or Not OK. If the statusis OK, the system automatically continues with the next step.

Steps 6–8: Enter DANFE; Check Authorization After DANFE Receipt; Customer-Specific Step After DANFEThe vendor sends goods together with a DANFE to your company, and the goods and DANFE arrive.

Step 6: Enter DANFE

(Technical name: RECDANFE)The NF-e fiscal clerk notifies the vendor that the XML has been accepted, and then sets this process step to OK or Not OK. If the status

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 106 of 174

is OK, the system automatically continues with the next step.

Step 7: Check Authorization After DANFE Receipt

(Technical name: AUTHGRPT)The system automatically checks the authorization status of the XML via the SEFAZ tax authority's Web service (this does not apply tocontingency DANFEs printed on security paper).

Step 8: Customer-Specific Step After DANFE

(Technical name: BADIAFTD)You can implement this BAdI-based step according to your requirements. For more information, see the documentation in Customizingunder Nota Fiscal Eletrônica Incoming Business Add-Ins for Incoming NF-es BAdI: Step Implementation before/after DANFE .

Step 9: Operation Confirmation Event

Actions in Step 9: Operation Confirmation (technical name: SENDOPCO)After the successful previous step, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.7 NF-e Subcontracting Overview If you obtain materials using subcontracting orders, you receive either one or two incoming NF-e depending on the process involved. Inorder to automatically process the information in the incoming NF-e and create the follow-on documents, SAP Nota Fiscal Eletrônicacommunicates with your SAP ERP system (and vice versa) at different points within the subcontracting process. This communicationdiffers depending on the type of subcontracting process:

NF-e for Subcontracting, that is, the end product and a symbolic return of the used components are delivered with one NF-e(SUBCON1A), see NF-e Subcontracting Process.NF-e for Symbolic Returns (SUBCON2C), that is, the end product is delivered with one NF-e and a subsequent adjustment for theused components is delivered in another NF-e, see NF-e for Symbolic Returns.NF-e for Returns of Components (SUBCON2D), that is, unused components are returned with an NF-e, see NF-e for Returns ofComponents.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 107 of 174

ProcessPrerequisites

You have activated the Outsourced Manufacturing in ERP Operations (LOG_MM_OM_1) Business Function in yourSAP ERP system, which is available as of SAP Enhancement Package 4 for SAP ERP 6.0. With this business function, you can entersubcontracting components in the inbound delivery, or you can fill the subcontracting components using a shipping notification fromthe supplier.You have set up the RFC connection between SAP Nota Fiscal Eletrônica and your SAP ERP system. For more information, seeTechnical Settings in SAP NFE Core Application (Inbound).You have completed the necessary Customizing settings in your SAP ERP system. For more information, see Related Configurationin SAP ERP.

FeaturesThe following documents explain the communication between your SAP ERP system and SAP Nota Fiscal Eletrônica in the steps forprocessing the NF-e related to the components. These steps are as follows for the respective process:Process Name Technical Name StepsNF-e for Subcontracting SUBCON1A Assign Purchase Order Items

Simulate Invoice and NF-eGenerate Inbound DeliveryPost Goods ReceiptPost Invoice and NF-e

NF-e for Symbolic Returns SUBCON2C Simulate Material Document and NF-ePost Subsequent Adjustment and NF-e

NF-e for Returns of Components SUBCON2D Assign Purchase Order ItemsSimulate Material Document and NF-ePost Component Return and NF-e

1.5.2.3.7.1 NF-e Subcontracting Process

ProcessNF-e for Subcontracting (SUBCON1A)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. SCONVALD (Auto)

Validation for Subcontracting4. SCASSIGN (Auto)

Assignment of Items with Components5. NFESIMSC

Simulate Invoice and NF-e6. SCDELCRE (Auto)

Sub Contracting Inbound Delivery create7. ACCNOTIF (Auto)

Notification XML accepted8. RECDANFE

Enter DANFE9. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt10. GRCONFQU

Enter Goods Receipt Quantities11. GRFICHCK

Check Goods Receipt Quantities12. GRMMCHCK

Prepare Goods Receipt Posting13. GRSCON1A (Auto)

Goods Receipt Subcontracting mixed14. IVSCON1A (Auto)

Post Invoice and NF-e Subcontracting mixed15. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 108 of 174

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validation for Subcontracting

Actions in Step 3 Validation for Subcontracting (technical name: SCONVALD)The validation checks if the Symbolic Returns are marked as statistical: If not, the process stops with an error.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 109 of 174

The validation checks if the Symbolic Returns contain taxes: If they contain taxes, the process stops with an error.If there are RTP positions, then a check of the unit of measurement (UoM) and conversion (if necessary) is carried out in the ERPsystem.

In addition to the validation in the ERP system, there is also a validation of the XML regarding the RTP positions. The intention is to checkthat the RTP positions do not contain any taxes.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:The validation in the ERP system comprises checks of units of measurements (UoM), conversions, and purchase orders (if existing).The validation of the XML file within the NFE system checks that the data adheres to defined rules.

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.The validation steps require the assignment information to be able to carry out the validation and for when returnable packaging isinvolved to compare the units of measure of the returnable packaging items with the ERP system. The assignments are not stored inthe validation steps. Instead, the assignments are stored in the subsequent steps for the purchase order assignments.

Process Step 4: Assignment of Items with ComponentsA PO number and item must be assigned to all NF-e items. This happens either automatically, or by manual assignment if errorsoccurred. In addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Actions in Step 4: Assignment of Items with Components (technical name: SCASSIGN). In this step you have to assign all finishedproducts and components to purchase order items.

An NF-e item is automatically assigned to the PO if the XML provides this information. The ERP and NFE systems check if theassignment is complete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of items with components to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerkfinds a correct PO number and item, then the fiscal clerk can manually assign the PO.

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 110 of 174

Additional Check and FunctionsIf the item is a component of item type symbolic return and there is a PO number and item assigned, check if this PO number anditem exists in one of the main items. If not, raise an error as this is not allowed.If there is only one main item and the component contains no assigned PO number and item, then assign the main item POnumber and item to the components that have no assignment so far.

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Step 5: Simulate Invoice and NF-e

Actions in Step 5: Simulate Invoice and NF-e (technical name: NFESIMSC)After the PO items with components are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. Thissimulation serves as check on the ERP side to verify if a later goods receipt and invoice receipt can be posted. The fiscal clerk canvisualize the simulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOPcodes.

If the simulation was correct, then the NF-e can proceed to the next processing phase.If the simulation is not correct, then the NF-e receives the result Simulation Not OK. In this case, the fiscal clerk can either:1. Reject the NF-e and notify the vendor. (Vendor notification is not triggered automatically upon rejection; the fiscal clerk must notifythe vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

NF-e Simulation with PO dataNo data is sent to the ERP system. There are no simulation results for RTP.NF-e Simulation with XML dataNo data is sent to the ERP system. There are no simulation results for RTP.

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 6: Sub Contracting Inbound Delivery create

Note

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 111 of 174

Actions in Step 6: Sub Contracting Inbound Delivery create (technical name: SCDELCRE)If the simulation is OK, then the system triggers the subcontracting inbound delivery creation:

The ERP system uses the PO, the PO item, and the XML quantity data to create an inbound delivery.The ERP system sends the created inbound delivery number back to the NFE system.The NFE system assigns the inbound delivery. The subcontracting NF-e can proceed to the next processing step.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Inbound Delivery CreationRTP data is sent to the ERP systemThe ERP system creates additional lines for RTPThe ERP system returns the inbound delivery number and position to the NFE system

Step 7: Notification XML Accepted

Actions in Step 7: Notification XML Accepted (technical name: ACCNOTIF)The NFE system notifies the vendor by e-mail that the XML has been accepted.

Step 8: Enter DANFE

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 112 of 174

The vendor sends the goods, together with the DANFE, to the company, and the goods arrive at the company.

Actions in Step 8: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk can compare the PDF preview of the XML with the DANFE. The fiscal clerk sets this process step to OK or Not OK. Ifthe status is OK, the system automatically continues with the next step.

Step 9: Check Authorization After DANFE ReceiptThe system checks if the NF-e is still authorized.

Actions in Step 9: Check Authorization After DANFE Receipt (technical name: AUTHGRPT)The system checks if the NF-e is still authorized.

Step 10: Enter Goods Receipt Quantities

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 113 of 174

Actions in Step 10: Enter Goods Receipt Quantities (technical name: GRCONFQU)The logistics clerk counts the quantities. By default, the quantities in the NF-e are used as the reference point.If counted quantities deviate from the default values, the logistics clerk can overwrite and enter other quantities.Once all quantities are entered and checked, the logistics clerk saves all quantities and sets the status to OK.

Step 11: Check Goods Receipt Quantities

Actions in Step 11: Check Goods Receipt Quantities (technical name: GRFICHCK)The fiscal clerk compares the quantities from the NF-e with the received quantities (see step 8).The fiscal clerk confirms and sets the status of this step to OK.

Step 12: Prepare Goods Receipt Posting

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 114 of 174

Actions in Step 12: Prepare Goods Receipt Posting (technical name: GRMMCHCK)The logistics clerk confirms that all preparations are complete and that the goods receipt can be posted.The logistics clerk sets the status of this step to OK.

Step 13: Goods Receipt Subcontracting mixed

Actions in Step 13: Goods Receipt Subcontracting mixed (technical name: GRSCON1A)The goods receipt is automatically posted to the ERP system if the preceding step was set to OK (If the preceding step was not OK,the fiscal clerk can repeat the step..The inbound delivery number is sent to the ERP system and the goods receipt for the inbound delivery is posted.The NFE system receives the goods receipt report from the ERP system:1. Goods receipt successful: In this case, the system sets the status of the step to OK.2. Goods receipt failed: In this case, the system sets the step to Not OK. The fiscal clerk can carry out manual corrections in the ERP

system and repeat the step.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Goods Receipt for Inbound DeliveryThe RTP data is sent to the ERP system together with the references of the inbound delivery number and position

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 115 of 174

The ERP posts the goods receipt with the RTP data.The ERP system checks that the RTP positions in the inbound delivery are still consistent

Step 14: Post Invoice and NF-e Subcontracting mixed

Actions in Step 14: Post Invoice and NF-e Subcontracting mixed (technical name: IVSCON1A)The invoice receipt is posted to the ERP system.The NFE system receives the result of the invoice receipt from the ERP system:1. Invoice receipt successful: In this case, the status of the step is set to OK. The NFE process is completed.2. Invoice receipt failed and no invoice is created: In this case, the step is set to Not OK and you must carry out manual corrections in

the ERP system.3. Invoice receipt failed and a parked invoice is created: In this case, the status of the step is set to OK, but you still must carry out

manual corrections in the ERP system. Nevertheless, the NFE process is completed.The NF-e is created and posted in the ERP system together with the invoice receipt.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

RTP data is not required. The RTP lines in the NF-e are created automatically based on the lines in the material document

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 15: Operation Confirmation Event

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 116 of 174

Actions in Step 15: Operation Confirmation (technical name: SENDOPCO)After the successful post invoice and NF-e subcontracting mixed, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.7.1.1 Processing in SAP ERP: NF-e for Subcontracting(SUBCON1A) This documentation explains how your SAP ERP system and SAP Nota Fiscal Eletrônica communicate during the NF-e forSubcontracting (SUBCON1A) process, that is, the end product and the symbolic return of the used components are delivered with oneincoming NF-e. When your SAP ERP system validates the purchase order assignment for the end product, the system checks that thispurchase order is a subcontracting purchase order, that is, the purchase order items only have L as the item category.The documentation focuses mainly on the communication that is needed to process the components in the NF-e. Communicationrelated to the components takes place during the following steps in the incoming process:

Assign Purchase Order ItemsSimulate Invoice and NF-eGenerate Inbound DeliveryPost Goods ReceiptPost Invoice and NF-e

For information about the standard communication and processing in all steps of the incoming process, see Processing in SAP ERP:Normal Purchasing.

Features

Assign Purchase Order ItemsSAP Nota Fiscal Eletrônica sends the XML data to your SAP ERP system and indicates that the purchase order was created for asubcontracting order.If the XML contains the purchase order information for the components, your SAP ERP system maps the XML materials to the ERPmaterials. By default, the mapping is done using vendor info records. Alternatively, you can implement your own logic to do this mappingin the Convert Material from XML into ERP Material(MATERIAL_CONVERSION) method of the Conversions for

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 117 of 174

Incoming NF-e Automation (J_1BNFE_IN) Business Add-In (BAdI). Your SAP ERP system checks that the ERPmaterial in the XML is included in the component list for the purchase order. The system then converts the UoM (unit of measurement) inthe XML to the UoM in SAP ERP.If the XML does not contain the purchase order item information, your SAP ERP system uses the purchase order for the end product tosearch for the possible purchase order items for the used components. The purchase order data for the components, if any, is returnedto SAP Nota Fiscal Eletrônica. After the purchase order items are assigned to the components, your SAP ERP system then coverts theUoM in the XML to the UoM in SAP ERP.

When you save the purchase order assignment in SAP Nota Fiscal Eletrônica, it is essential for the rest of the automation to runcorrectly that the assignment of the NF-e item to the purchase order item or purchase order item component is unique.

Simulate Invoice and NF-eTo check if the invoice and NF-e can be posted, you can run a simulation of the invoice and NF-e posting in your SAP ERP system. YourSAP ERP system uses the prices and NF-e data from the incoming XML and the assigned purchase order items to simulate the pricesand taxes. The system also checks if the stock quantities at the vendor are sufficient for a consumption posting for the components. Ifthis is not the case, your SAP ERP system returns an error message to SAP Nota Fiscal Eletrônica.

Generate Inbound DeliveryWhen creating the inbound delivery, your SAP ERP system uses the delivery quantities and UoM from the incoming XML. Your systemproceeds as follows regarding the components:

Adjusts the default quantity of the components taken from the purchase order item to match the quantities passed from SAP NotaFiscal EletrônicaSets the component quantities to zero if no component information is passed from SAP Nota Fiscal Eletrônica. This is the case whenthe NF-e only contains the end product.

Post Goods ReceiptAfter the goods arrive and you complete all logistics-relevant activities, you can trigger the goods receipt posting from SAP Nota FiscalEletrônica. SAP Nota Fiscal Eletrônica sends the inbound delivery number to your SAP ERP system. Your SAP ERP system thenautomatically posts the goods receipt for the end product and the component consumption. It sends the resulting material documentnumber to SAP Nota Fiscal Eletrônica.

Post Invoice and NF-eYour SAP ERP system posts the invoice and corresponding NF-e. The system uses the prices from the XML for these postings. ThisNF-e has additional lines for the used components with the NF item type that is mapped to the relevant movement type in your SAPERP Customizing. These lines are also marked as statistical items.

1.5.2.3.7.2 NF-e for Symbolic Returns NF-e for Symbolic Returns (SUBCON2C)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. SCONVALD (Auto)

Validation for Subcontracting4. SCASSIGN (Auto)

Assignment of Items with Components5. NFESIMSA (Auto)

Simulate Goods Movement and NF-e6. GISCON2C (Auto)

Goods Issue Subcontracting Symbolic Return7. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 118 of 174

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:.

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validation for Subcontracting

Actions in Step 3 Validation for Subcontracting(technical name: SCONVALD)The validation checks if the Symbolic Returns are marked as statistical.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 119 of 174

The validation checks if the Symbolic Returns contains no taxes.If any of the checks fails, the process stops with an error.

In the event of an error, the process step validation can be set to OK manually. This can influence the later simulation or actions inthe ERP system.

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.

Process Step 4: Assignment of Items with ComponentsA PO number and item must be assigned to all NF-e items. This happens either automatically, or by manual assignment if errorsoccurred. In addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Actions in Step 4: Assignment of Items with Components (technical name: SCASSIGN). In this step you have to assign all finishedproducts and components to purchase order items.

An NF-e item is automatically assigned to the PO if the XML provides this information. The ERP and NFE systems check if theassignment is complete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of items with components to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerkfinds a correct PO number and item, then the fiscal clerk can manually assign the PO.

Additional Check and FunctionsIf the item is a component of item type symbolic return and there is a PO number and item assigned, check if this PO number anditem exists in one of the main items. If not, raise an error as this is not allowed.If there is only one main item and the component contains no assigned PO number and item, then assign the main item POnumber and item to the components that have no assignment so far.

Note

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 120 of 174

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Step 5: Simulate Invoice and NF-e Subcontracting

Actions in Step 5: Simulate Goods Movement and NF-e (technical name: NFESIMSA)After the PO items with components are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. Thissimulation serves as check on the ERP side to verify if a later goods receipt can be posted. The fiscal clerk can visualize thesimulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e Subcontracting can proceed to the next processing phase.If the simulation is not correct, then the NF-e Subcontracting receives the result Simulation Not OK. In this case, the fiscal clerk caneither:1. Reject the NF-e Subcontracting and notify the vendor. (Vendor notification is not triggered automatically upon rejection; the fiscalclerk must notify the vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.Step 6: Goods Issue Subcontracting Symbolic Return

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 121 of 174

Actions in Step 6: Goods Issue Subcontracting Symbolic Return (technical name: GISCON2C)If the simulation is OK, then the system triggers the subcontracting goods issue symbolic return creation. The Goods IssueSubcontracting Symbolic Return is processed.

Step 7: Operation Confirmation Event

Actions in Step 7: Operation Confirmation (technical name: SENDOPCO)After the successful Goods Issue Subcontracting Symbolic Return, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.7.2.1 Processing in SAP ERP: NF-e for SymbolicReturns (SUBCON2C) In the NF-e for Symbolic Returns (SUBCON2C) process, the end product is delivered with one NF-e and a subsequent adjustment forused components in another NF-e. In this process, the NF-e for the end product must be posted first.The communication for processing the end product is similar to the normal purchasing process. When the inbound delivery is posted,your SAP ERP system adjusts the quantity for the subcomponents to zero. The component consumption is posted later in thesubsequent adjustment. The following documentation explains how your SAP ERP system and SAP Nota Fiscal Eletrônicacommunicate during this subsequent adjustment. The steps in the adjustment process are as follows:

Assign Purchase Order ItemsSimulate Material Document and NF-ePost Subsequent Adjustment and NF-e

For information about the standard communication and processing in all steps of the incoming process, see Processing in SAP ERP:Normal Purchasing.

Features

Assign Purchase Order ItemsSAP Nota Fiscal Eletrônica sends the XML data to your SAP ERP system. Your SAP ERP system searches for subcontracting

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 122 of 174

purchase orders that have the XML materials in the component list for the purchase order items.Your SAP ERP system then maps the XML materials to the ERP materials. By default, the mapping is done using vendor info records.Alternatively, you can implement your own logic to do this mapping in the Convert Material from XML into ERPMaterial(MATERIAL_CONVERSION) method of the Conversions for Incoming NF-e Automation (J_1BNFE_IN)Business Add-In (BAdI). The system then converts the UoM (unit of measurement) in the XML to the UoM in SAP ERP.The purchase order data for the components is returned to SAP Nota Fiscal Eletrônica.

Simulate Material Document and NF-eUsing the information from SAP Nota Fiscal Eletrônica, your SAP ERP system checks if the stock quantities at the vendor are sufficientfor a consumption posting for the components. If the posting is possible, the system checks if the goods receipt of the end productrelated to this purchase order item has taken place. If this is not the case, your SAP ERP system returns an error message to SAP NotaFiscal Eletrônica. If the posting is possible, the system simulates the tax postings using the prices and other values from the XML sentby SAP Nota Fiscal Eletrônica. The ICMS value should be 0. The tax base is calculated using the values from the XML.

Post Subsequent Adjustment and NF-eUsing the data from the XML sent by SAP Nota Fiscal Eletrônica, your SAP ERP posts the subsequent adjustments for the components(movement type 543) and the corresponding NF-e. This NF-e has additional lines for the used components with the NF item type that ismapped to the relevant movement type in your SAP ERP Customizing. In the Observation field of the NF-e, the system enters the NFnumber series of the referred NF. If no reference is available, the system enters a hyphen (-). Your SAP ERP system then sends thematerial number and material item numbers to SAP Nota Fiscal Eletrônica.

1.5.2.3.7.3 NF-e for Returns of Components NF-e for Returns of Components (SUBCON2D)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. SCONVALD (Auto)

Validation for Subcontracting4. ASSUNITS (Auto)

Check and Assignment of Units5. NFESIMGR

Simulate Goods Receipt and NF-e6. ACCNOTIF (Auto)

Notification XML accepted7. RECDANFE

Enter DANFE8. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt9. GRCONFQU

Enter Goods Receipt Quantities10. GRFICHCK

Check Goods Receipt Quantities11. GRMMCHCK

Prepare Goods Receipt Posting12. GRSCON2D (Auto)

Goods Receipt Subcontracting Components Return13. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 123 of 174

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validation for Subcontracting

Actions in Step 3 Validation for Subcontracting (technical name: SCONVALD)The validation checks if a reference NF-e is assigned to Returns of Components: If not, the process stops with an error

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 124 of 174

The validation checks that no paper-based NF is assigned to Returns of Components: If yes, the process stops with an errorThe validation checks if the Returns of Components contain taxes: If they contain taxes, the process stops with an error

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.

Process Step 4: Check and Assignment of UnitsA PO number and item must be assigned to all NF-e items. This happens either automatically, or by manual assignment if errorsoccurred. In addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

Actions in Step 4: Check and Assignment of Units (technical name: ASSUNITS)An NF-e item is automatically assigned to the PO from the received XML: The ERP and NFE systems check if the assignment iscomplete.Assignment of units is complete: The NF-e can proceed to the next step

This step is carried out automatically. The NFE system calls the ERP system to check if the units of measure are known in the ERPsystem and if a conversion can be carried out if required.

Step 5: Simulate Goods Receipt and NF-e Subcontracting

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 125 of 174

Actions in Step 5: Simulate Goods Receipt and NF-e Subcontracting (technical name: NFESIMGR)After the PO items with components are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. Thissimulation serves as check on the ERP side to verify if a later goods receipt can be posted. The fiscal clerk can visualize thesimulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e Subcontracting can proceed to the next processing phase.If the simulation is not correct, then the NF-e Subcontracting receives the result Simulation Not OK. In this case, the fiscal clerk caneither:1. Reject the NF-e Subcontracting and notify the vendor. (Vendor notification is not triggered automatically upon rejection; the fiscalclerk must notify the vendor manually.)2. Manually adjust incorrectly assigned units as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.Step 6: Notification XML Accepted

Actions in Step 6: Notification XML Accepted (technical name: ACCNOTIF)The NFE system notifies the vendor by e-mail that the XML has been accepted.

Step 7: Enter DANFE

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 126 of 174

Actions in Step 7: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk can compare the PDF preview of the XML with the DANFE. The fiscal clerk sets this process step to OK or Not OK. Ifthe status is OK, the system automatically continues with the next step.

Step 8: Check Authorization After DANFE ReceiptThe system checks if the NF-e is still authorized.

Actions in Step 8: Check Authorization After DANFE Receipt (technical name: AUTHGRPT)The system automatically checks the authorization status of the XML via Web service with the SEFAZ tax authority.

For the event that you receive is a contingency DANFE printed on security paper, see NF-e Contingency Process.Step 9: Enter Goods Receipt Quantities

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 127 of 174

Actions in Step 9: Enter Goods Receipt Quantities (technical name: GRCONFQU)The logistics clerk counts the quantities. By default, the quantities in the NF-e are used as the reference point.If counted quantities deviate from the default values, the logistics clerk can overwrite and enter other quantities.Once all quantities are entered and checked, the logistics clerk saves all quantities and sets the status to OK.

Step 10: Check Goods Receipt Quantities

Actions in Step 10: Check Goods Receipt Quantities (technical name: GRFICHCK)The fiscal clerk compares the quantities from the NF-e with the received quantities (see step 8).The fiscal clerk confirms and sets the status of this step to OK.

Step 11: Prepare Goods Receipt Posting

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 128 of 174

Actions in Step 11: Prepare Goods Receipt Posting (technical name: GRMMCHCK)The logistics clerk confirms that all preparations are complete and that the goods receipt can be posted.The logistics clerk sets the status of this step to OK.

Step 12: Goods Receipt Subcontracting Components Return

Actions in Step 12: Goods Receipt Subcontracting mixed (technical name: GRSCON2D)The system posts the goods receipt to the ERP system.The inbound delivery number is sent to the ERP system and the goods receipt for the inbound delivery is posted.

Step 13: Operation Confirmation Event

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 129 of 174

Actions in Step 13: Operation Confirmation (technical name: SENDOPCO)After the successful GR, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.7.3.1 Processing in SAP ERP: NF-e for Return ofComponents (SUBCON2D) In the NF-e for Return of Components (SUBCON2D) process, unused components are returned with an NF-e. In the NF-e for thereturned components, there is a reference to the nota fiscal that was used to ship the components to the subcontractor.The following documentation explains how your SAP ERP system and SAP Nota Fiscal Eletrônica communicates and processes thereturn of unused components. The steps in this process are as follows:

Simulate Material Document and NF-ePost Component Return and NF-e

For information about the standard communication and processing in all steps of the incoming process, see Processing in SAP ERP:Normal Purchasing.

Features

Simulate Material Document and NF-eIn addition to the usual data needed for a simulation, SAP Nota Fiscal Eletrônica sends the number of the reference nota fiscal, that isthe NF that was used to send the components to the subcontractor, to your SAP ERP system.Your SAP ERP system checks that the referred nota fiscal exists as an outgoing nota fiscal. If several notas fiscais are found, thesystem checks that they all have the same sender and recipient. Using the recipient of the referred nota fiscal, the system tries to findthe vendor, plant, and storage location. If this is successful, the system then checks if the stock quantities at the vendor are sufficient fora return of components posting. If this is not the case, your SAP ERP system returns an error message to SAP Nota Fiscal Eletrônica.The system converts the UoM (unit of measurement) in the XML to the UoM in SAP ERP.If a posting is possible, the system simulates the tax postings using the prices and other values passed from SAP Nota FiscalEletrônica. The ICMS value should be 0. The tax base is calculated using the values in the XML.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 130 of 174

Post Component Return and NF-eSAP Nota Fiscal Eletrônica sends data that is necessary for posting the component return to your SAP ERP system. Your SAP ERPsystem uses the recipient in the referred nota fiscal to locate the vendor, plant, and storage location. The system then posts the goodsconsumption with this data:

Material and quantity from the XML dataNF number (number and series) in the Material Slip fieldReferred NF number (number and series) in the document header text

Your SAP ERP system also posts the NF-e for the return. The system calculates the taxes using the prices from the incoming XML asthe prices in the NF-e. After a successful posting, your SAP ERP system returns the material number to SAP Nota Fiscal Eletrônica.

1.5.2.3.8 NF-e Future Delivery Overview NF-e Future Delivery is used to carry out Future Delivery processes in the NFE system. Every Future Delivery process consists of twoNF-es that belong together. The first NF-e is the invoice and the second NF-e is the delivery and goods receipt.

First NF-e: InvoiceSecond NF-e: Delivery and Goods Receipt

ProcessThe following Future Delivery processes are offered:

NF-e Goods Receipt Future Delivery ProcessNF-e Invoice Receipt Future Delivery Process

1.5.2.3.8.1 NF-e Invoice Receipt Future Delivery Process Invoice Receipt Future Delivery (Technical name: FUTDELIV)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. FDIVVALD (Auto)

Validate Future Delivery4. FDASSIGN (Auto)

Assign Purchase Order Items Future Delivery5. NFESIMFD

Simulate Invoice and NF-e Future Delivery6. ACCNOTIF (Auto)

Notification XML accepted7. RECDANFE

Enter DANFE8. FDIVPOST (Auto)

Post Invoice and NF-e Future Delivery9. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 131 of 174

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validate Future Delivery Invoice (technical name: FDIVVALD)

Actions in Step 3: Validate Future Delivery (technical name: FDIVVALD)This validation step contains a BAdI that can be used to carry out a customer specific validation of the incoming XML document.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 132 of 174

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.

Process Step 4: Assign Purchase Order Items Future DeliveryYou must assign a PO number and item to all NF-e Future Delivery items. In addition, the following requirements must be fulfilled tocomplete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Actions in Step 4: Assign Purchase Order Items Future Delivery (technical name: FDASSIGN)An NF-e item is automatically assigned to the PO from the received XML: The ERP and NFE systems check if the assignment iscomplete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of reference items to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerk finds acorrect PO number and item, then the fiscal clerk can manually assign the PO.

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Step 5: Simulate Invoice and NF-e Future Delivery

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 133 of 174

Actions in Step 5: Simulate Invoice and NF-e Future Delivery (technical name: NFESIMFD)After the reference PO items are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. Thissimulation serves as check on the ERP side to verify if a later invoice receipt can be posted. The fiscal clerk can visualize thesimulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e Future Delivery can proceed to the next processing phase.If the simulation is not correct, then the NF-e Future delivery receives the result Simulation Not OK. In this case, the fiscal clerk caneither:1. Reject the NF-e Future Delivery and notify the vendor. (Vendor notification is not triggered automatically upon rejection; the fiscalclerk must notify the vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 6: Notification XML Accepted

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 134 of 174

Actions in Step 6: Notification XML Accepted (technical name: ACCNOTIF)The fiscal clerk notifies the vendor that the XML has been accepted.The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 7: Enter DANFE

Actions in Step 7: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 8: Post Invoice and NF-e Future Delivery

Actions in Step 8: Post Invoice and NF-e Future Delivery (technical name: FDIVPOST)The invoice receipt is posted to the ERP system.The NFE system receives the result of the invoice receipt from the ERP system:1. Invoice receipt successful: In this case, the status of the step is set to OK. The NFE process is completed.2. Invoice receipt failed and no invoice is created: In this case, the step is set to Not OK and you must carry out manual corrections in

the ERP system.3. Invoice receipt failed and a parked invoice is created: In this case, the status of the step is set to OK, but you still must carry out

manual corrections in the ERP system. Nevertheless, the NFE process is completed.The NF-e is created and posted in the ERP system together with the invoice receipt.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 135 of 174

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 9: Operation Confirmation Event

Actions in Step 9: Operation Confirmation (technical name: SENDOPCO)After the successful execution of the previous step, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.8.1.1 Processing in SAP ERP: Future Delivery Invoice To automatically process the information in the invoice and incoming NF-e for future deliveries and create the follow-on documents,SAPNota Fiscal Eletrônica communicates with your SAP ERP system and vice versa. This documentation focuses on thecommunication and processing specific to future deliveries in the following steps in the incoming process:

Assign Purchase Order ItemsSimulate Invoice and NF-ePost Invoice and NF-e

For information about the standard communication and processing in all steps of the incoming process, see Processing in SAP ERP:Normal Purchasing.

Features

Assign Purchase Order ItemsIn this process, the communication between SAP Nota Fiscal Eletrônica and your SAP ERP system is similar to the communication fornormal purchasing. However, when your SAP ERP validates the purchase order assignment, the system also checks that none of thepurchase order items in the assigned purchase order is set for goods-receipt-based invoice verification. If an item is marked as such inthe purchase order, your SAP ERP system returns an error message to SAP Nota Fiscal Eletrônica.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 136 of 174

The assignment of multiple NF-e items to the same purchase order item is not supported for future delivery invoices.

Simulate Invoice and NF-eAfter the purchase order data is assigned, you can simulate the NF-e using the prices and other data from the XML. Your SAP ERPsystem determines the NF type for the future delivery process using the corresponding Customizing settings in your SAP ERP system.The system then simulates the prices and taxes. The system also checks that the taxes are consistent for this process type, that is,ICMS is statistical. If this is not the case, your SAP ERP system returns an error message to SAP Nota Fiscal Eletrônica.

Post Invoice and NF-eAfter the status of the invoice and NF-e posting simulation is set to okay, SAP Nota Fiscal Eletrônica informs your SAP ERP system.Your SAP ERP system then uses the data sent by SAP Nota Fiscal Eletrônica and the required NF type from your SAP ERPCustomizing to post the invoice and corresponding NF-e. Your SAP ERPS system sends the resulting invoice number and the fiscal yearto SAP Nota Fiscal Eletrônica.

1.5.2.3.8.2 NF-e Goods Receipt Future Delivery Process

ProcessGoods Receipt Future Delivery (FUTDELGR)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. FDELVALD (Auto)

Validate Future Delivery4. POASSREF (Auto)

Assign Reference Purchase Order Items5. NFESIMFD

Simulate Goods Receipt and NF-e Future Delivery6. FDDELCRE (Auto)

Generate Inbound Delivery7. ACCNOTIF (Auto)

Notification XML accepted8. RECDANFE

Enter DANFE9. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt10. GRCONFQU

Enter Goods Receipt Quantities11. GRFICHCK

Check Goods Receipt Quantities12. GRMMCHCK

Prepare Goods Receipt Posting13. FDGRPOST

Post Goods Receipt Future Delivery14. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 137 of 174

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validate Future Delivery

Actions in Step 3 Validate Future Delivery (technical name: FDELVALD)Check if there are paper references: If yes, then this is an error because only electronic references are accepted

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 138 of 174

Check existence of reference NF-eCheck for NF-e type if reference is of type ‘NF-e’Check for process type of the reference NF-e if the process type is FUTDELIVCheck for NF-e status if the reference NF-e has header status 98 (manual completed) or 99 (automatically completed)Check if the material number matches with the material number of the reference NF-e. It is NOT possible to set this step manually toOK. If more than one entry is found in reference the step is OK, but no automatic assignment is possible. If exactly one entry is foundan automatic assignment can be done.If there are RTP positions, then a check of the unit of measurement (UoM) and conversion (if necessary) is carried out in the ERPsystem.

In addition to the validation in the ERP system, there is also a validation of the XML regarding the RTP positions. The intention is to checkthat the RTP positions do not contain any taxes.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Only RTP materials need to be converted as the unit of measurement (UoM) of other materials can be derived from the first NF-e.The process Invoice with Future Delivery consists of two phases:1. Invoice

The product to be delivered is assigned2. Delivery and Goods Receipt

The RTP positions must be validated in processing step FDELVALD. The validation in the ERP system comprises checks ofunits of measurements (UoM), conversions, and purchase orders (if existing).

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.The validation steps require the assignment information to be able to carry out the validation and for when returnable packaging isinvolved to compare the units of measure of the returnable packaging items with the ERP system. The assignments are not stored inthe validation steps. Instead, the assignments are stored in the subsequent steps for the purchase order assignments.

Process Step 4: Assign Reference Purchase Order ItemsA PO number and item must be assigned to all NF-e items. This happens either automatically, or by manual assignment if errorsoccurred. In addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Actions in Step 4: Assign Reference Purchase Order Items (technical name: POASSREF)An NF-e item is automatically assigned to the PO from the received XML: The ERP and NFE systems check if the assignment is

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 139 of 174

complete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of reference items to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerk finds acorrect PO number and item, then the fiscal clerk can manually assign the PO.

The delivery relates to the relevant invoice that must already exist in the system. The invoice must be completely assigned to orders.The delivery is assigned using the reference NF-e, that means the invoice NF-e. The system checks if the assignments from theinvoice-NF-e can be taken over to the delivery NF-e. If this is possible, the assignment is used and the delivery-NF-e is assigned.

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Step 5: Simulate Goods Receipt and NF-e Future Delivery

Actions in Step 5: Simulate Goods Receipt and NF-e Future Delivery (technical name: NFESIMFD)After the reference PO items are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. Thissimulation serves as check on the ERP side to verify if a later goods receipt can be posted. The fiscal clerk can visualize thesimulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e Future Delivery can proceed to the next processing phase.If the simulation is not correct, then the NF-e Future delivery receives the result Simulation Not OK. In this case, the fiscal clerk caneither:1. Reject the NF-e Future Delivery and notify the vendor. (Vendor notification is not triggered automatically upon rejection; the fiscalclerk must notify the vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

NF-e Simulation with PO dataNo data is sent to the ERP system. There are no simulation results for RTP.NF-e Simulation with XML dataNo data is sent to the ERP system. There are no simulation results for RTP.

Step 6: Generate Inbound Delivery

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 140 of 174

Actions in Step 6: Generate Inbound Delivery (technical name: FDDELCRE)If the simulation is OK, then the system triggers inbound delivery creation via the following steps:

The NFE system calls the ERP system to check the purchase order (PO), the PO item, and the XML quantity.The ERP system uses the PO, the PO item, and the XML quantity data to create an inbound delivery number.The ERP system sends the created inbound delivery number back to the NFE system.The NFE system assigns the inbound delivery. The normal purchase NF-e can proceed to the next processing step.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Inbound Delivery CreationRTP data is sent to the ERP systemThe ERP system creates additional lines for RTPThe ERP system returns the inbound delivery number and position to the NFE system

Step 7: Notification XML Accepted

Actions in Step 7: Notification XML Accepted (technical name: ACCNOTIF)The fiscal clerk notifies the vendor that the XML has been accepted.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 141 of 174

The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.Step 8: Enter DANFEThe vendor sends the goods, together with the DANFE, to the company, and the goods arrive at the company.

Actions in Step 8: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 9: Check Authorization After DANFE Receipt

Actions in Step 9: Check Authorization After DANFE Receipt (technical name: AUTHGRPT)The system automatically checks the authorization status of the XML via Web service with the SEFAZ tax authority.

For the event that you receive is a contingency DANFE printed on security paper, see NF-e Contingency Process.Step 10: Enter Goods Receipt Quantities

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 142 of 174

Actions in Step 10: Enter Goods Receipt Quantities (technical name: GRCONFQU)The logistics clerk counts the quantities. By default, the quantities in the NF-e are used as the reference point.If counted quantities deviate from the default values, the logistics clerk can overwrite and enter other quantities.Once all quantities are entered and checked, the logistics clerk saves all quantities and sets the status to OK.

Step 11: Check Goods Receipt Quantities

Actions in Step 11: Check Goods Receipt Quantities (technical name: GRFICHCK)The fiscal clerk compares the quantities from the NF-e with the received quantities (see step 8).The fiscal clerk confirms and sets the status of this step to OK.

Step 12: Prepare Goods Receipt Posting

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 143 of 174

Actions in Step 12: Prepare Goods Receipt Posting (technical name: GRMMCHCK)The logistics clerk confirms that all preparations are complete and that the goods receipt can be posted.The logistics clerk sets the status of this step to OK.

Step 13: Post Goods Receipt Future Delivery

Actions in Step 13: Post Goods Receipt Future Delivery (technical name: FDGRPOST)The fiscal clerk posts the goods receipt to the ERP system.The inbound delivery number is sent to the ERP system and the goods receipt for the inbound delivery is posted.The NFE system receives the goods receipt report from the ERP system:1. Goods receipt successful: In this case, the fiscal clerk sets the status of the step to OK.2. Goods receipt failed: In this case, the fiscal clerk sets the step to Not OK and carries out manual corrections in the ERP system.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Goods Receipt for Inbound DeliveryThe RTP data is sent to the ERP system together with the references of the inbound delivery number and positionThe ERP posts the goods receipt with the RTP data.The ERP system checks that the RTP positions in the inbound delivery are still consistent

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 144 of 174

Step 14: Operation Confirmation Event

Actions in Step 14: Operation Confirmation (technical name: SENDOPCO)After the successful execution of the previous step, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.8.2.1 Processing in SAP ERP: Future Delivery GoodsReceipt In order to automatically process the information in the incoming NF-e delivered with the goods receipt for a future delivery and createthe follow-on documents, SAP Nota Fiscal Eletrônica communicates with your SAP ERP system and vice versa. This documentationfocuses on the communication specific to future deliveries that occurs during the following steps in the incoming process:

Simulate NF-e based on Goods ReceiptCreate Inbound DeliveryPost Goods Receipt and NF-e based on Inbound Delivery

For information about the standard communication and processing in all steps of the incoming process, see Processing in SAP ERP:Normal Purchasing.

Features

Simulate NF-e based on Goods ReceiptUsing the data from SAP Nota Fiscal Eletrônica, your SAP ERP system checks if the referenced NF-e access key exists in thedatabase. If it does, the system simulates the goods receipt and its corresponding NF-e. The system derives the movement type fromthe delivery type that was entered in your SAP ERP Customizing for the future delivery process. Your SAP ERP system derives the taxcodes from the mapping in your SAP ERP Customizing of the tax codes for the purchase order to the tax codes of the goods receipt.The system checks the following tax information:

ICMS rate to be used in SAP ERP is the same as the rate in the XMLIncoming XML does not contain IPIIPI, if any, is to be posted statistically

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 145 of 174

The assignment of multiple NF-e items to the same purchase order item is supported as of SAP Enhancement Package 5 for SAPERP 6.0 the. For lower releases, it is essential for the rest of the automation to run correctly that the assignment between NF-e itemand purchase order item is unique.

Create Inbound DeliveryAfter a successful simulation, your SAP ERP system can create an inbound delivery. SAP Nota Fiscal Eletrônica sends the tax datafrom the XML and informs your SAP ERP system that this is an inbound delivery for the Future Delivery Goods Receipt process. Thesystem creates the inbound delivery using the delivery type from your Customizing settings for the future delivery process.

Post Goods Receipt and NF-e based on Inbound DeliveryUsing the data from SAP Nota Fiscal Eletrônica, your SAP ERP system compares the quantities in the inbound delivery with thequantities in the incoming XML to ensure that they are still the same. The system posts the goods receipt and NF-e and sends theresulting goods receipt number to SAP Nota Fiscal Eletrônica.

1.5.2.3.9 NF-e Consignment Overview The NF-e Consignment process can be described in the following way: A supplier provides products or raw material for a customer thatis also stored in the customer's own warehouse. The supplier remains the rightful owner of these products or raw materials until thecustomer (reseller or manufacturer) withdraw them from the consignment warehouse. By removing products or raw materials from theconsignment warehouse, a liability towards the supplier is created. The invoice is due according to agreed time periods, for example,monthly. The parties of this contract can arrange that the customer will automatically take over remaining products or raw materials inthe consignment warehouse after a defined time period. The process consists of 2 parts and is similar to the NF-e Future Deliveryprocess. In contrast to the NF-e Future Delivery process, which issues the invoice before the delivery of the product, the NF-eConsignment process has a delivery of a product or raw material first and then an invoice. The delivery comes first and a GoodsReceipt is booked for the Consignment warehouse. After that, an invoice is created that refers to the withdrawal of products or rawmaterials from the Consignment warehouse. The two parts of the Consignment process are described in detail in the following two links:

NF-e Goods Receipt Consignment, that is, the filling of the consignment warehouse. The technical name of the process isCONSIGGR, for more information see NF-e Goods Receipt Consignment Process.NF-e Invoice Consignment (technical name CONSIGIV), that is, the invoice after the withdrawal of the product or raw material from theconsignment warehouse. For more information, see NF-e Invoice Consignment Process.

ProcessProcess OverviewProcess Name Technical Name StepsNF-e Goods Receipt Consignment CONSIGGR Check Business Partner's Signature

Check Authorization after NF-e ReceiptValidate Goods Receipts ConsignmentAssign Reference Purchase Order ItemsSimulate Invoice and NF-eGenerate Inbound DeliveryNotification XML acceptedEnter DANFECheck Authorization after DANFEReceiptEnter Goods Receipt QuantitiesCheck Goods Receipt QuantitiesPrepare Goods Receipt PostingPost Goods Receipt Consignment

NF-e Invoice Consignment CONSIGIV Check Business Partner's SignatureCheck Authorization after NF-e ReceiptValidate Invoice for ConsignmentAssign Purchase Order ItemsSimulate Invoice for ConsignmentNotification XML acceptedEnter DANFEPost Invoice for Consignment

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 146 of 174

1.5.2.3.9.1 NF-e Goods Receipt Consignment Process

ProcessGoods Receipt Consignment (CONSIGGR)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. CSGRVALD (Auto)

Validate Goods Receipt Consignment4. CSASSIGN (Auto)

Assign Reference Purchase Order Items5. NSIMCSGR

Simulate Goods Receipt and NF-e Goods Receipt Consignment6. CSDELCRE (Auto)

Generate Inbound Delivery7. ACCNOTIF (Auto)

Notification XML accepted8. RECDANFE

Enter DANFE9. AUTHGRPT (Auto)

Check Authorization After DANFE Receipt10. GRCONFQU

Enter Goods Receipt Quantities11. GRFICHCK

Check Goods Receipt Quantities12. GRMMCHCK

Prepare Goods Receipt Posting13. CSGRPOST (Auto)

Post Goods Receipt Consignment14. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 147 of 174

The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validation for Process Goods Receipt for Consignment

Actions in Step 3 Validate Consignment (technical name: CSGRVALD)This validation step contains a BAdI that can be used to carry out a customer specific validation of the incoming XML document.

If there are RTP positions, then a check of the unit of measurement (UoM) and conversion (if necessary) is carried out in the ERPsystem.

In addition to the validation in the ERP system, there is also a validation of the XML regarding the RTP positions. The intention is to checkthat the RTP positions do not contain any taxes.

RTPIf you have RTP positions in your NF-e, then the following additional steps take place:

Only RTP materials need to be converted in this step. The unit of measurement (UoM) of other materials will be converted in Step4.Delivery and Goods ReceiptThe RTP positions must be validated in processing step CSGRVALD. The validation in the ERP system comprises checks of unitsof measurements (UoM), conversions, and purchase orders (if existing).

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.The validation steps require the assignment information to be able to carry out the validation and for when returnable packaging isinvolved to compare the units of measure of the returnable packaging items with the ERP system. The assignments are not stored inthe validation steps. Instead, the assignments are stored in the subsequent steps for the purchase order assignments.

Process Step 4: Assign Purchase Order ItemsA PO number and item must be assigned to all NF-e items. This happens either automatically, or by manual assignment if errorsoccurred. In addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 148 of 174

Actions in Step 4: Assign Purchase Order Items (technical name: CSASSIGN)An NF-e item is automatically assigned to the PO from the received XML: The ERP and NFE systems check if the assignment iscomplete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of items to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerk finds a correct POnumber and item, then the fiscal clerk can manually assign the PO.

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Step 5: Simulate NF-e Goods Receipt

Actions in Step 5: Simulate Goods Receipt (technical name: NSIMCSGR)

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 149 of 174

After the PO items are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. This simulation servesas check on the ERP side to verify if a later goods receipt can be posted. The fiscal clerk can visualize the simulation and comparisonresults with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e for Goods Receipt Consignment can proceed to the next processing phase.If the simulation is not correct, then the NF-e for Goods Receipt Consignment receives the result Simulation Not OK. In this case, thefiscal clerk can either:1. Reject the NF-e for Goods Receipt Consignment and notify the vendor. (Vendor notification is not triggered automatically uponrejection; the fiscal clerk must notify the vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.

RTPIf you have RTP positions in your NF-e, the following takes place:

NF-e Simulation with PO dataNo data is sent to the ERP system. There are no simulation results for RTP.NF-e Simulation with XML dataNo data is sent to the ERP system. There are no simulation results for RTP.

Step 6: Generate Inbound Delivery

Actions in Step 6: Generate Inbound Delivery (technical name: CSDELCRE)If the simulation is OK, then the system triggers inbound delivery creation via the following steps:

The NFE system calls the ERP system to check the purchase order (PO), the PO item, and the XML quantity.The ERP system uses the PO, the PO item, and the XML quantity data to create an inbound delivery number.The ERP system sends the created inbound delivery number back to the NFE system.The NFE system assigns the inbound delivery. The NF-e can proceed to the next processing step.

RTPIf you have RTP positions in your NF-e, then the following takes place:

Inbound Delivery CreationRTP data is sent to the ERP systemThe ERP system creates additional lines for RTPThe ERP system returns the inbound delivery number and position to the NFE system

Step 7: Notification XML Accepted

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 150 of 174

Actions in Step 7: Notification XML Accepted (technical name: ACCNOTIF)The NFE system notifies the vendor that the XML has been accepted.This process step is set to OK or Not OK by the NFE system. If the status is OK, the system automatically continues with the nextstep. If the step is set to Not OK, then the fiscal clerk can manually set this step to OK

Step 8: Enter DANFEThe vendor sends the goods, together with the DANFE, to the company.

Actions in Step 8: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 9: Check Authorization After DANFE Receipt

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 151 of 174

Actions in Step 9: Check Authorization After DANFE Receipt (technical name: AUTHGRPT)The system automatically checks the authorization status of the XML via Web service with the SEFAZ tax authority.

For the event that you receive is a contingency DANFE printed on security paper, see NF-e Contingency Process.Step 10: Enter Goods Receipt Quantities

Actions in Step 10: Enter Goods Receipt Quantities (technical name: GRCONFQU)The logistics clerk counts the quantities. By default, the quantities in the NF-e are used as the reference point.If counted quantities deviate from the default values, the logistics clerk can overwrite and enter other quantities.Once all quantities are entered and checked, the logistics clerk saves all quantities and sets the status to OK.

Step 11: Check Goods Receipt Quantities

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 152 of 174

Actions in Step 11: Check Goods Receipt Quantities (technical name: GRFICHCK)The fiscal clerk compares the quantities from the NF-e with the received quantities (see step 8).The fiscal clerk confirms and sets the status of this step to OK.

Step 12: Prepare Goods Receipt Posting

Actions in Step 12: Prepare Goods Receipt Posting (technical name: GRMMCHCK)The logistics clerk confirms that all preparations are complete and that the goods receipt can be posted.The logistics clerk sets the status of this step to OK.

Step 13: Post Goods Receipt Consignment

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 153 of 174

Actions in Step 13: Post Goods Receipt Consignment (technical name: CSGRPOST)The NFE system posts the goods receipt to the ERP system.The inbound delivery number is sent to the ERP system and the goods receipt for the inbound delivery is posted.The NFE system receives the goods receipt report from the ERP system:1. Goods receipt successful: In this case, the NFE system sets the status of the step to OK.2. Goods receipt failed: In this case, the NFE system sets the step to Not OK. The fiscal clerk can then carry out manual corrections in

the ERP system and trigger this step again.

RTPIf you have RTP positions in your NF-e, then the following takes place:

Goods Receipt for Inbound DeliveryThe RTP data is sent to the ERP system together with the references of the inbound delivery number and positionThe ERP posts the goods receipt with the RTP data.The ERP system checks that the RTP positions in the inbound delivery are still consistent

Step 14: Operation Confirmation Event

Actions in Step 14: Operation Confirmation (technical name: SENDOPCO)

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 154 of 174

After the successful GR, the NFE system triggers the operation confirmation event.The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.9.1.1 Processing in SAP ERP: Consignment GoodsReceipt During the automatic processing of NF-e in the delivery of consignment goods to the consignee’s premises in the Consignment GoodsReceipt scenario, SAP Nota Fiscal Eletrônica communicates with your SAP ERP system during the following steps in this part of theconsignment process:1. Assign Purchase Order Items2. Simulate NF-e based on Goods Receipt3. Create Inbound Delivery4. Post Goods Receipt and NF-e based on Inbound DeliveryThis documentation focuses on the processing specific to consignments. For information about the standard communication andprocessing in all steps of the incoming process, see Processing in SAP ERP: Normal Purchasing.

PrerequisitesYou have completed the necessary Customizing settings in your SAP ERP system. For more information, see Related Configuration inSAP ERP. Note that in the Assign Delivery Type to Incoming NF-e Processes Customizing activity, you must enter a delivery type forthe Consignment Goods Receipt process.

Features

Assign Purchase Order ItemsAs in the Normal Purchasing process, if the XML for the incoming NF-e does not contain any purchase order details, you can trigger asearch to try to find the corresponding purchase order items in your SAP ERP system. After the items in the XML are assigned topurchase order items, your SAP ERP system validates the quantities in the XML.Once the assignment to the purchase order items is made and validated, you can trigger a simulation using the price from the purchaseorder and the quantity from the incoming XML data. Your SAP ERP system simulates the NF-e posting and returns the simulation resultsfor you to check.

The assignment of multiple NF-e items to the same purchase order item is supported as of SAP Enhancement Package 5 for SAPERP 6.0. In lower releases, it is essential for the rest of the automation to run correctly that the assignment between NF-e item andpurchase order item is unique.

Simulate NF-e based on Goods ReceiptUsing the data from SAP Nota Fiscal Eletrônica, your SAP ERP system simulates the goods receipt and its corresponding NF-e. Thesystem derives the movement type (for example, 821) from the delivery type entered in your SAP ERP Customizing for Incoming NF-eAutomation for the Consignment Goods Receipt process. Your SAP ERP system uses the prices and taxes from the XML and the taxcodes that are passed from SAP Nota Fiscal Eletrônica. If SAP Nota Fiscal Eletrônica does not send any tax codes, your SAP ERPsystem derives the tax codes from the mapping in your SAP ERP Customizing of the tax codes for the purchase order to the tax codesof the goods receipt.The system checks the following tax information:

ICMS, ICST and IPI rates in the XML are the same as the rates in SAP ERP Customizing. Note that the SAP ERP system does notcheck IPI pauta rates.Since consignment is only applicable for industrialization cases, the tax code must have the production/sales as the usage. If not, theERP system returns an error message.

Create Inbound DeliveryAfter a successful simulation, your SAP ERP system can create an inbound delivery. SAP Nota Fiscal Eletrônica sends the tax datafrom the XML and informs your SAP ERP system that this is an inbound delivery for the Consignment Goods Receipt process. The

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 155 of 174

system creates the inbound delivery using the delivery type from your SAP ERP Customizing settings for the Consignment GoodsReceipt process.Note that you can implement your own logic to determine a valuation type for the materials in the inbound delivery. You do this byimplementing the Change Storage Location and Valuation Type in Inbd Delivery (CHANGE_SLOC_AND_VALTYPE) method in theConversions for Incoming NF-e Automation (J_1BNFE_IN) Business Add-In (BAdI).

Post Goods Receipt and NF-e based on Inbound DeliveryUsing the data from SAP Nota Fiscal Eletrônica, your SAP ERP system compares the quantities in the inbound delivery with thequantities in the incoming XML to ensure that they are still the same. The system posts the goods receipt and NF-e, taking the tax rates,values and bases for ICMS, ICST and IPI from the XML. The system sends the resulting goods receipt number to SAP Nota FiscalEletrônica.

1.5.2.3.9.2 NF-e Invoice Consignment Process Invoice Consignment (Technical name: CONSIGIV)This process consists of the following steps:1. SIGNATUR (Auto)

Check Business Partner's Signature2. AUTHORIZ (Auto)

Check Authorization After NF-e Receipt3. CSIVVALD (Auto)

Validate Invoice for Consignment4. CSASSREF (Auto)

Assign Purchase Order Items5. NSIMCSIV

Simulate Invoice for Consignment6. ACCNOTIF (Auto)

Notification XML accepted7. RECDANFE

Enter DANFE8. CSIVPOST (Auto)

Post Invoice for Consignment9. SENDOPCO (Auto, deactivated)

Send Operation ConfirmationProcess Steps 1–2: Check Business Partner's Signature, Check Authorization after NF-e Receipt

Actions in Step 1:Check Business Partner's Signature (technical name: SIGNATUR)The system checks if the business partner’s signature is OK. The following options are possible:

Signature is OK: The NF-e has passed the signature check and can proceed to the next processing step. For more information, seeDigital Signature Validation under Nota Fiscal Eletrônica (SAP NFE) Signature .Signature is not OK: The step is set to Not OK. You have the following options:

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 156 of 174

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Actions in Step 2: Check Authorization After NF-e Receipt (technical name: AUTHORIZ)The system checks the authorization status of the received NF-e via the SEFAZ tax authority‘s Web service. This communication iscarried out using an asynchronous call.

XML authorized: The authorization check was successful and the NF-e can proceed to the next processing step.XML not authorized: The step is set to Not OK. You have the following options:

Retry the step after manual corrections.Set the step to OK manually.Reject NF-e (vendor notification is not triggered automatically upon rejection; you must notify the vendor manually).

Process Step 3: Validate Consignment

Actions in Step 3 Validate Consignment (technical name: CSIVVALD)This validation step contains a BAdI that can be used to carry out a customer specific validation of the incoming XML document.

Check if there are paper references: If yes, then this is an error because only electronic references are acceptedCheck existence of reference NF-eCheck for NF-e type if reference is of type ‘NF-e’Check for process type of the reference NF-e if the process type is CONSIGIVCheck for NF-e status if the reference NF-e has header status 98 (manual completed) or 99 (automatically completed)Check if the material number matches with the material number of the reference NF-e. It is NOT possible to set this step manually toOK. If more than one entry is found in reference the step is OK, but no automatic assignment is possible. If exactly one entry is foundan automatic assignment can be done.

You can use a BAdI in this step to implement customer-specific validation checks. For more information about the available BAdIs,see BAdIs for Incoming NF-e.You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.The validation steps require the assignment information to be able to carry out the validation and for when returnable packaging isinvolved to compare the units of measure of the returnable packaging items with the ERP system. The assignments are not stored inthe validation steps. Instead, the assignments are stored in the subsequent steps for the purchase order assignments.

Process Step 4: Assign Reference Purchase Order ItemsA reference PO number and item must be assigned to all NF-e items. This happens either automatically, or by manual assignment iferrors occurred. In addition, the following requirements must be fulfilled to complete this step:

The PO number and item must exist in the ERP system.The ERP system has validated the unit of measure of the NF-e item:If the unit of measure for the assigned PO is different than the unit of measure for the corresponding NF-e item, then a conversionmust be defined in the ERP system.

Both units of measure must be defined in the NFE and ERP system.The corresponding ISO code is required to determine the internal language-independent unit of measurement.

These requirements ensure that the following process steps, including communication with an ERP system, are carried out correctly.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 157 of 174

Actions in Step 4: Assign Reference Purchase Order Items (technical name: CSASSREF)An NF-e item is automatically assigned to the PO from the received XML: The ERP and NFE systems check if the assignment iscomplete.

This process can be performed manually if the automatic process fails.Assignment of PO is complete: The NF-e can proceed to the next stepAssignment of reference items to PO is not complete: The fiscal clerk must search for a PO in the ERP system. If the clerk finds acorrect PO number and item, then the fiscal clerk can manually assign the PO.

The invoice relates to the relevant goods receipt that must already exist in the system. The goods receipt must be completelyassigned to orders. The invoice is assigned using the reference NF-e, that means the goods receipt NF-e. The system checks if theassignments from the goods receipt NF-e can be taken over to the invoice NF-e. If this is possible, the assignment is used and theinvoice NF-e is assigned.

You can use a BAdI to implement a customer-specific mapping of the purchase order number and item to the NF-e item. For moreinformation, see BAdIs for Incoming NF-e.

Step 5: Simulate Invoice Consignment

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 158 of 174

Actions in Step 5: Simulate Invoice Consignment (technical name: NSIMCSIV)After the reference PO items are assigned, the fiscal clerk can trigger a simulation using XML data, tax code, and CFOP. Thissimulation serves as check on the ERP side to verify if a later goods receipt can be posted. The fiscal clerk can visualize thesimulation and comparison results with the data of the incoming NF-e. The fiscal clerk can change tax codes and CFOP codes.

If the simulation was correct, then the NF-e Invoice Consignment can proceed to the next processing phase.If the simulation is not correct, then the NF-e Invoice Consignment receives the result Simulation Not OK. In this case, the fiscal clerkcan either:1. Reject the NF-e Invoice Consignment and notify the vendor. (Vendor notification is not triggered automatically upon rejection; thefiscal clerk must notify the vendor manually.)2. Manually adjust incorrectly assigned items as described in step 4, and then continue with step 5.

All parameters must be saved before the status can be changed.

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 6: Notification XML Accepted

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 159 of 174

Actions in Step 6 Notification XML Accepted (technical name: ACCNOTIF)The NFE system notifies the vendor that the XML has been accepted.The NFE system sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 7: Enter DANFEThe vendor sends the DANFE to the company.

Actions in Step 7: Enter DANFE (technical name: RECDANFE)The fiscal clerk enters the DANFE key or scans the DANFE with a bar code reader.The fiscal clerk sets this process step to OK or Not OK. If the status is OK, the system automatically continues with the next step.

Step 8: Post Invoice Consignment

Actions in Step 8: Post Invoice Consignment (technical name: CSIVPOST)The invoice receipt is posted to the ERP system.The NFE system receives the result of the invoice receipt from the ERP system:1. Invoice receipt successful: In this case, the status of the step is set to OK. The NFE process is completed.2. Invoice receipt failed and no invoice is created: In this case, the step is set to Not OK and you must carry out manual corrections in

the ERP system.3. Invoice receipt failed and a parked invoice is created: In this case, the status of the step is set to OK, but you still must carry out

manual corrections in the ERP system. Nevertheless, the NFE process is completed.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 160 of 174

The NF-e is created and posted in the ERP system together with the invoice receipt.

You can implement a BAdI that fills extension parameters that are handed over to the ERP system in a simulation/booking of theinvoice. For more information, see BAdIs for Incoming NF-e.

Step 9: Operation Confirmation Event

Actions in Step 9: Operation Confirmation (technical name: SENDOPCO)After the successful execution of the previous step, the NFE system triggers the operation confirmation event.

The NFE system calls the event process.The event process sends the operation confirmation event to the government system for authorization.If the operation confirmation event is successfully created, the status of the step is set to OK. If the operation confirmation could notbe created, the status of the step is set to Not OK. For details about the operation confirmation event, see NF-e Events: OperationConfirmation.The NFE system completes the inbound process.

Events are collected in batches. The batch collection and sending is carried out via background jobs. For details about sending NF-eevents, see Sending NF-e Events.

1.5.2.3.9.2.1 Processing in SAP ERP: Consignment Invoice During the automatic processing of NF-e for consumed consignment goods in the Consignment Invoice process step, SAP Nota FiscalEletrônica communicates with your SAP ERP system during the following steps in this part of the consignment process:1. Simulate Invoice and NF-e2. Post Invoice and NF-eThis documentation focuses on the processing specific to consignments. For information about the standard communication andprocessing in all steps of the incoming process, see Processing in SAP ERP: Normal Purchasing.

PrerequisitesYou have completed the necessary Customizing settings in your SAP ERP system. For more information, see Related Configuration inSAP ERP. Note that in the Assign NF Type to Incoming NF-e Processes Customizing activity, you must enter an NF type for theConsignment Invoice Receipt process that has a default item type for which ICMS and IPI are statistical.

Features

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 161 of 174

Simulate Invoice and NF-eTo check the invoice and NF-e, you can run a simulation of their posting in your SAP ERP system that is similar to the simulation for theNormal Purchasing process. However, the following aspects differ from normal purchasing:

The goods receipt has already taken place. Your SAP ERP system must have a reference to the goods receipt, that is, the NF-enumber and the series (similar to the value placed in the field text (SGTXT) in a goods receipt created with the MIRO transaction).The quantity in the invoice and NF-e may differ from the quantity delivered with the goods receipt, for example, in the case of a partialinvoice.NF-e does not contain values for ICMS, ICST or IPI. Your SAP ERP system has to calculate statistical values for these tax types if theconfiguration of the tax codes requires this.Your SAP ERP system uses the NF type assigned to the Consignment Invoice Receipt process in your SAP ERP Customizing forincoming NF-e automation.

To enable the simulation, SAP NFE passes the following information to your SAP ERP system:Prices and quantities from the XMLTax codes. Since consignment is only applicable for industrialization cases, the tax code must have the production/sales as theusage. If the tax code is not filled by SAP Nota Fiscal Eletrônica, your SAP ERP system uses the tax codes from the purchase order.

During the simulation, your SAP ERP system does the following:Calculates the amount of ICMS using values from your SAP ERP Customizing. This amount is then used to derive the net purchaseprice from the XML prices.Checks that ICMS, ICST and IPI in the XML contain zero as the tax rate and tax valuesCalculate statistical postings for IPI and ICST based on you SAP ERP Customizing settings

The assignment of multiple NF-e items to the same purchase order item is supported as of SAP Enhancement Package 5 for SAPERP 6.0. The prerequisite is that multiple assignment of NF-e items to purchase order item has been already used for theconsignment goods receipt process. For lower releases, it is essential for the rest of the automation to run correctly that theassignment between NF-e item and purchase order item is unique.

Post Invoice and NF-eAfter the status of the invoice and NF-e posting simulation is set to okay, SAP Nota Fiscal Eletrônica informs your SAP ERP system.Your SAP ERP system then uses the quantity and prices from the XML and the required NF type for the Consignment Invoice Receiptprocess from your SAP ERP Customizing for incoming NF-e automation to post the invoice and corresponding NF-e. The statisticalposting for ICMS, ICST and IPI are based on your SAP ERP Customizing settings.Your SAP ERP system sends the resulting invoice number and the fiscal year to SAP Nota Fiscal Eletrônica.

1.5.2.3.10 Returnable Packaging for NF-e Processes Returnable Packaging (RTP) can be described by the following statements:

A vendor places the purchased good into/on a package that must be returnedExamples for such packages are pallets and barrelsA customer receiving RTP must include the packages in their inventory at no value until it is returned to the vendor

There are two different processes for RTP: Same and SingleSameSame is when the vendor includes in the same NF-e an item for the goods purchased, and another item for the RTP. Example: Mycompany issues a purchase order with one item, oil. The vendor then issues an NF-e with two items: oil and barrel (RTP)SingleSingle is when the vendor issues separate NF-es for the purchased goods and for the RTP. In our example for the oil business, avendor would issue an NF-e for the oil and another one for the barrel.

RTP items have different CFOPs than normally purchased goods.

RTP is not invoice relevant, but has special stock and unique movement types.This offers two options:1. The RTP positions are in the same NF-e as the product to be delivered. This is described as RTP same.2. The RTP positions are in a separate NF-e. This is described as RTP single.NFE offers only option 1. This means that the NF-es used in the processes are extended by RTP positions.NFE Position TypesAbbreviation Main PositionRTP Returnable PackagingSRE Symbolic Return Subcontracting ComponentPRE Return Subcontracting Component

Processes with RTP Positions

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 162 of 174

Process Technical NameNormal Purchasing NORMPRCHSubcontracting SUBCON1AFuture Delivery FUTDELGR

1.5.2.3.10.1 Processing in SAP ERP: Returnable Packagingwith Purchased Goods To automatically process the information in the incoming NF-e for purchased goods and returnable transport packaging (RTP) that areshipped together and create the follow-on documents, SAP Nota Fiscal Eletrônica communicates with your SAP ERP system and viceversa. The processing of RTP is supported for the following purchasing processes:

Normal purchasingSubcontracting (receipt of end product with or without subsequent adjustment)Future delivery goods receipt

In these processes, when your SAP ERP validates the purchase order for the purchased goods, the system maps the material numberin the XML for the RTP items to the ERP material. By default the mapping is done using vendor info records. Alternatively, you canimplement your own logic to do this mapping in the Convert Material from XML into ERP Material (MATERIAL_CONVERSION) methodof the Conversions for Incoming NF-e Automation (J_1BNFE_IN) Business Add-In (BAdI). In addition, the system converts the UoMand quantity in the XML to the UoM and quantity in ERP.This documentation focuses on the RTP-specific communication and processing that occurs during the following steps of the purchasingprocess:

Create Inbound DeliveryPost Goods Receipt and NF-e

For information about the standard communication and processing in all steps of the incoming process, see Processing in SAP ERP:Normal Purchasing.

Features

Create Inbound DeliverySAP Nota Fiscal Eletrônica sends the following additional data about the RTP items to your SAP ERP system:

ERP material numberQuantityUnit of measurement (UoM)

When your SAP ERP system creates the inbound delivery, it does the following for the RTP items:Creates delivery items for the RTP materials with the delivery type that is mapped to the movement type for the Purchased Goodswith RTP process (for example, 841) in your SAP ERP CustomizingSets the special stock indication to M for the RTP delivery itemsUses the same plant for the RTP delivery items as the plant from the purchased goods if there is only one plant for the whole delivery.If there is more than one plant for the purchased goods, the system uses the first plant listed for the purchased goods a the plant forthe RTP delivery items.Uses the same storage location for the RTP delivery items from the purchased goods if there is only one storage location for thewhole delivery. If there is more than one, the system leaves the storage location for the RTP delivery items blank.Note that it is also possible to implement your own logic for assigning the storage location in the inbound delivery in the ChangeStorage Location and Valuation Type in Inbd Delivery (CHANGE_SLOC_AND_VALTYPE) method of the Conversions for IncomingNF-e Automation (J_1BNFE_IN) Business Add-In (BAdI).

Post Goods ReceiptWhen your SAP ERP system posts the goods receipt, it does the following for the RTP items:

Checks that the inbound delivery still contains all RTP items in the XML and that their quantities have not been changed. If the RTPitems have changed, your SAP ERP system sends an error message to SAP Nota Fiscal Eletrônica.Stores the final price for the RTP items from the XML (= price + freight + insurance + other expense − discount) in the Alternate BaseAmount field on the Tax tab page of the goods receipt. This information is later included in the NF item details for the RTP items whenthe NF-e is posted:

For normal purchasing and subcontracting, the system creates the NF-e with the invoice.For future delivery – goods receipt, it is created during goods receipt posting.

Your SAP ERP system sends the material document number and the year to SAP Nota Fiscal Eletrônica. If the goods receipt cannot beposted, an error message is returned.

1.5.2.4 BAdIs for Inbound NF-es

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 163 of 174

The following BAdIs (Incoming) are available for SAP Nota Fiscal Eletrônica (NFE):

BAdI: Step Implementation before/after DANFEYou can implement a BAdI that is used within the business process Customer-Specific Business Process withDANFE (technical name: FLEXPR01) to trigger transactions in the integrated ERP system.BAdI: Determine Business ProcessYou can implement a BAdI that carries out a customer-specific business process determination.BAdI: Validation of Incoming XML DocumentYou can implement a BAdI that executes a customer-specific validation of an incoming XML document.BAdI: Assignment of purchase order number and purchase order ItemYou can implement a BAdI that executes a customer-specific assignment of the order number and order positions to an NF-e position.BAdI: Determination of Variant for Delivery Quantity EntryYou can implement a BAdI that determines a customer-specific variant for the delivery quantity entry.BAdI: Simulate/Post Filling of Extension Parameter for InvoiceYou can implement a BAdI that fills extension parameters, which are handed over to the ERP system in a simulation/booking ofinvoice.BAdI: Determination of Logical SystemYou can implement a BAdI that determines the logical system for the ERP system.BAdI: Calculation of Total ValueYou can implement a BAdI that performs a customer-specific calculation of the total value. The BAdI returns the calculated total valueto the ERP system for the XML simulation and for posting the invoice. In the standard SAP NFE system, the total value of the XMLdocument is returned to the ERP system.BAdI: Determination of Status for Gate MonitorYou can implement a BAdI that defines the DF-e status and corresponding text for the Gate Monitor. In addition, you can define a textfor the status of the traffic light that determines the entrance to the company premises.

For more information, see the documentation for the BAdIs in Customizing under Nota Fiscal Eletrônica Inbound Business Add-Ins for Inbound NF-es .

1.5.2.5 NF-e Fiscal Workplace The NF-e Fiscal Workplace is where the fiscal clerk monitors and processes incoming NF-es.The main overview screen of the NF-e Fiscal Workplace displays a table containing NF-es and corresponding data. The default viewdisplays the following columns:

Overall StatusThe overall status of each NF-e in the list is represented by one of the following status codes and respective icon:

Status code 99Process Completed; NF-e Processed Successfully

Status Code 98NF-e Ended Manually

Status Code 89Process Completed; NF-e Rejected

Status Code 88Document Rejected, Can Be Overwritten

Status Code 22NF-e Missing Logical System for Processing

Status Code 21NF-e without Business Process Assignment

Status Code 11Process Waiting for Asynchronous Answer

Status Code 03Technical Error in preceding Process Step

Status Code 02Error in preceding Process Step

Status Code 01Process Waiting for User Action

NF-e NumberThe NF-e Number is a 9 digit-key that identifies a single NF-e.SeriesThe NF-e series number is a 3 digit key that identifies an NF-e series.Access KeyThe NF-e access key is a 44 digit identifier that serves as a link to the following detailed information about a selected NF-e:1. NF-e Identification

Contains output information, NF-e movement data, and other data.2. Issuer

Contains the issuer name and address, and other tax data.

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 164 of 174

3. RecipientContains the consignee name, the recipient’s address, other tax data.

4. ItemsContains a table with information about specific items. In the lower portion of the screen, you can find NF-e product and serviceinformation, along with data for such specific Brazilian tax categories as, ICMS, IPI, II, ISSQN, PIS, and COFINS.

5. Total ValuesContains an overview of all ICMS tax data, including the values for all tax categories.

6. TransportContains transport and transport identification data.

Creation DateDisplays the date of arrival of the NF-e in the NFE system.Creation TimeDisplays the time of arrival of the NF-e in the NFE system.ProcessDisplays the assigned process of the NF-e.Last Process StepDisplays the last executed process step.Issuer's CNPJDisplays the CNPJ of the issuer.Recipient's CNPJ/CPFDisplays the CNPJ/CPF of the recipient.Issuer RegionDisplays the region of the issuer, 27 different regions are possible.Issuing TypeDisplays the issuing type.Authority System EnvironmentDisplays the authority environment.ICMS ValueDisplays the value of ICMS.IPI Tax ValueDisplays the tax value of IPI.PIS ValueDisplays the value of PIS.COFINS ValueDisplays the value of Cofins.Total valueDisplays the total value of included taxes.

Other Column Choices

You can use the Settings link to add or delete columns in the NF-e table. By default, the following columns are hidden:

Overall StatusPosted Conting[ency]CUFIssuer’s NameDocument DateSend DateRecipient NamePurpose of IssuingLogical SystemNF ModelProtocol NumberProcessOperation ProgressStatus CodeCarrier’s CNPJAuthority System Env[ironment]Issuing TypeRecipient’s UFIssuer’s UFAuthority Vers[ion]

Process StepsChoose Execute Process Step to manually execute a process step.The process available process steps depend on the used NF-e process. For the Normal Purchasing process, you can manuallyexecute the following steps:

Assigning Purchase OrdersSimulating NF-esRecording DANFEsChecking Goods Receipt

There are other process steps that cannot be executed manually.Select DetailsChoose Details to display the following information about the selected NF-e:

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 165 of 174

NF-e IdentificationIssuerRecipientItemsTotal ValuesTransport

Enter DANFEChoose Enter DANFE to record a DANFE code manually or with a bar code reader.

For the event that you receive a contingency DANFE printed on security paper, see NF-e Contingency Process.

Additional FunctionsChoose Additional Functions to call up the following additional functions:

Continue ProcessFor attempting to restart the automatic processing of an NF-e. If NF-e processing stops, investigate the reason, and then chooseContinue Process to try to continue processing.Set Process Step to OK ManuallyFor setting the current process step to OK, despite the fact that the process step was not carried out successfully.Manually End NF-eFor ending NF-e processing in the NFE system without carrying out any further steps. The user has the option to issue a receiveracknowledgement end event of type operation confirmation (See:Operation Confirmation).

You must do necessary additional processing in the ERP system manually without linking to the NFE system.

Reject NF-eFor rejecting an NF-e and to stop further processing in the NFE system. The receiver acknowledgement end event of type operationdenial (See: Operation Denial), or operation termination (See: Operation Termination) will be sent depending on the customizingsettings for the rejection reasons. (See: Nota Fiscal Eletrônica Inbound Communication to Business Partner NF-e Reasons forRejection ). Note that the message to the vendor is not sent automatically. To send a message about the rejection, you have toexecute Send notification to vendor (This is active for a rejected NF-e).

After rejecting an NF-e, you must do necessary additional processing in the ERP system manually without linking to the NFEsystem.

For the case that the XML is incorrect you have the option to flag the NF-e as Enable New Receipt of NF-e. The NF-e receives a newstatus (Status code 88 –>Document rejected, Can be overwritten) and will be overwritten once the same NF-e (with the sameaccess key) arrives again in the NFE system. This is documented in the history table of the NF-e.

The previous XML is overwritten and the processing starts again. You cannot restore an overwritten NF-e.

Reject Cancellation NF-eFor rejecting the cancellation of an NF-e and to return to the original process.Send notification to VendorYou can use this pushbutton to send a notification about the rejection of an NF-e to the vendor. This can be done after the NF-e wasrejected.Status Check for EventsTrigger the status update for the selected NF-e to receive all known events from the authorities.

Print VersionFor printing out a list of NF-es.ExportFor exporting a list to Microsoft Excel.Additional InformationOnce you have selected an NF-e in the top table, tabs containing additional information about this NF-e appear at the bottom of thescreen:

Status OverviewThis tab contains the following fields:

StatusActivityProcess TypeStatus DescriptionInfo TextApplication Log

HistoryStatusProcess TypeActivity

Note

Note

Note

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 166 of 174

Status DescriptionInfo TextExecuted onUserApplication Log

AssignmentsIn the Assignments tab, you can select the displayed fields by choosing the Settings link for this table. By default, the following fieldsare displayed:

Item NumberThis is the position in the XML.Item TypeDescribes the characteristics of the item. The following options are supported:

MainSymbolic ReturnPhysical ReturnReturnable Packages

NF-e QuantityThis is the NF-e quantity as in the XMLNF-e Quantity UnitThis is the NF-e Quantity Unit as in the XMLConverted NF-e Quantity UnitThe NF-e quantity unit converted to the internal quantity unit determined via the validation in the ERP systemNF-e Material NumberThis is the code of the product/material as in the XMLNF-e Material Short TextA description of the NF-e product/material as in the XMLPurchase Order NumberThe PO number as in the XML or determined by manual/automatic assignment.Purchase Order Item NumberThe PO Item number as in the XML or determined by manual/automatic assignment.Converted PO Quantity (from NF-e quantity)The quantity of the NF-e in the unit of the ERP system (Either from material master record or PO)ERP Quantity UnitThe quantity unit as determined in the ERP systemERP Material NumberThe code of the product/material as determined in the ERP systemERP Material Short TextA description of the product/material as determined in the ERP systemDelivery NumberThe delivery number as created in the ERP system if the process creates a delivery. If no delivery is involved, the field is empty.Delivery ItemThe delivery number item as created in the ERP system if the process creates a delivery. If no delivery is involved, the field isempty.Received QuantityThe quantity that was actually delivered in NF-e quantity units.CFOPThe CFOP code that is relevant for the simulation and posting in the ERP system. The CFOP code is determined automatically inthe ERP system or entered manually in the simulation steps.Tax CodeThe tax code that is relevant for the simulation and posting in the ERP system. The tax code is determined automatically in the ERPsystem or entered manually in the simulation steps.

You can display the following additional fields:Fiscal Year from Invoice VerificationThe year in which the invoice was created in the ERP systemInvoice NumberThe invoice number as created in the ERP system.Number of Material DocumentThe number of the material document as created in the ERP system.Invoice Document StatusThe status of the invoice document. Available options are Invoice booked and Invoice parked.ERP-internal Quantity UnitThe internal quantity unit used in the ERP system

ReferencesThe References tab is only displayed for NF-es where the XML contains electronic or paper-based references.

Reference NF-es/CT-esThe icon indicates whether the NF-e/CT-e is stored in the NFE systemAccess KeyThe access key comes in form of a direct link to the XML of the NF-e/CT-e. To open this link, you need the authorization to displaythe NF-e/CT-e.

Events

The Events tab is only visible if there is at least 1 event for an NF-e.

Caution

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 167 of 174

The main purpose is to provide information to the Fiscal Clerk about events. The Fiscal Clerk must decide how running processes areaffected, and therefore a list of the current authorized and pending events (both self-issued and others) is displayed. The Fiscal Clerkcan display all events per event type in a dialog box. In the Events tray, the following buttons are enabled after selecting one line ofthe events list:

By selecting one event, you can display its content (if available) depending on its type. Select Details Event Details .By choosing Select Details Display Event XML , you can open or save the XML document.By choosing Event Status , you can display the current and former process steps with status icon, activity, process type, statusdescription, and info text.By choosing Event History , you can display the history of an event with status icon, activity, process type, status description,info text, execution date and time, and user.In a dialog box, you can see all other available versions of the selected event by choosing Display Versions .Send XML FileYou have the option to send an event XML using the Send XML File pushbutton. This button is active if the event is authorized andthe B2B scenario for the business partner is activated. You can choose to send the event XML to one of your business partners,either the event recipient or NF-e carrier (Outbound NF-e only). The following situations are supported:

The XML file was not yet sent due to the fact that the B2B scenario for the business partner was not activated. After activation ofthe B2B scenario and sending, the Process Status of the event process will not be changed. However, a history entry is added.The event XML file was already sent. After sending, the Process Status of the event process will not be changed. However, ahistory entry is added.

Errors during the initial B2B sending process must be solved in the Event Outbound Monitor and cannot be solved using theSend XML File function.

By choosing Refresh , the event list is updated to the latest version.Maintaining the Personal Object Work List (POWL)The POWL (Personal Object Work List) offers central, personalized access to all relevant work lists. You can see the number ofbusiness objects per work list on the overview screen and can therefore handle a great number of work lists, business objects, anddocuments. Further, by choosing Personalize, you can select or deselect the following categories and queries:

OverviewToday

We recommend maintaining Quick Criteria due to performance reasons. For example, if a user is only working with a certain CNPJ,then that CNPJ can be defined as limiting factor.

Under Layout, you can select Tab strip or Link Matrix to define the layout.

1.5.2.5.1 NF-e Fiscal Workplace: Assignment

ProcedureThe following assignment steps are carried out during the processing of an NF-e:

Assignment of purchase order items. This step is used for the following processes:Normal Purchasing (NORMPRCH)Future Delivery Invoice (FUTDELIV)For more information, see Assignment for Normal Purchasing and Future Delivery Invoice

Assignment of main items and optionally components. This step is used in the following process:NF-e for Subcontracting (SUBCON1A)For more information, see Assignment for NF-e for Subcontracting (SUBCON1A)

Assignment of components. This step is used in the following process:NF-e for Symbolic Returns (SUBCON2C)For more information, see Assignment for NF-e for Symbolic Returns (SUBCON2C)

Assignment of items of the referenced NF-e. This step is used in the following process:Future Delivery Goods Receipt (FUTDELGR)For more information, see Assignment for Future Delivery Goods Receipt (FUTDELGR)

1.5.2.5.1.1 Assignment for Normal Purchasing and FutureDelivery Invoice

Note

Recommendation

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 168 of 174

ProcedureYou can choose Execute Process Step to manually execute the assignment of items. This step depends on the determined businessprocess. For Normal Purchasing, the process step isAssign Purchase Order Items.To assign purchase order items, proceed as follows:1. Select an NF-e and choose Execute Process Steps –> Assign Purchase Order Items (for Normal Purchasing)2. On the next screen, you see the following table entries:

Open NF-e ItemsItem NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order Item

Available Items (for example: PO items from a reference purchase Order)PO NumberPurchase Order ItemPO Material NumberPurchase Order Material Short TextPO QuantityPurchase Order Unit

Available PO items are determined in the ERP system with search criteria provided by the XML file. For more information, seeCommunication with SAP ERP for Normal Purchasing (example for business process Normal Purchasing. All other businessprocesses also have a description of the ERP communication)

3. Types of Assignment Execution

It is possible to assign multiple NF-e items to the same purchase order item for normal purchasing. For future delivery invoices,the assignment must be unique. For more information see Processing Inbound NF-es.

Item-Based SearchSelect an open NF-e item in the table Open NF-e Items. Select an available PO item in the table Available PO Items and assign itto the open NF-e item by choosing Assign Purchase Order.If no available PO item is displayed, choose Find Purchase Order Items to search for purchase orders using specific PO numbers(Find Purchase Order) or other search criteria (Extended Search for the Item-based search).Global SearchYou can search for an existing individual purchase order by entering the purchase order number into the search field of the globalsearch. If you don't know the number, use the input help (F4) for a list of proposed purchase order numbers. You are free to assignall open NF-e items to a purchase order item.You have to assign the purchase order items using drag-and-drop.

To complete this step, you must assign all open NF-e items to a purchase order item.4. All assigned NF-e items are now displayed in the Assigned NF-e Items table, along with the following information:

Assigned NF-e ItemsItem NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order ItemPO QuantityPurchase Order UnitPO Material NumberPurchase Order Material Short Text

You can always reset assignments. Select the lines with the NF-e items to be reset, and then choose Reset Assignment.

5. To check if your assigned NF-e items are correct, save your assignments.

You can also check if your assigned NF-e items are correct by running a simulation (see NF-e Fiscal Workplace: NF-e Simulation).

Note

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 169 of 174

1.5.2.5.1.2 Assignment for NF-e for Subcontracting(SUBCON1A)

ProcedureYou can choose Execute Process Step to manually execute the assignment of items. This step depends on the determined businessprocess. For Normal Purchasing, the process step isAssign Purchase Order Items.To assign purchase order items, proceed as follows:1. Select an NF-e and choose Execute Process Steps –> Assign Purchase Order Items (for Normal Purchasing)2. On the next screen, you see the following table entries:

Open NF-e ItemsItem NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order Item

Available Items (for example: PO items from a reference NF-ePO NumberPurchase Order ItemPO Material NumberPurchase Order Material Short TextPO QuantityPurchase Order Unit

Available PO items are determined in the ERP system with search criteria provided by the XML file. For more information, seeCommunication with SAP ERP for Normal Purchasing (example for business process Normal Purchasing. All other businessprocesses also have a description of the ERP communication)

3. Select an open NF-e item in the table Open NF-e Items. Select an available PO item in the table Available PO Items and assign it tothe open NF-e item by choosing Assign Purchase Order.If no available PO item is displayed, choose Find Purchase Order Items to search for purchase orders using specific PO numbers(Find Purchase Order) or other search criteria (Extended Search for the item-based search).Alternatively, you can search for an existing individual purchase order by entering the purchase order number into the search field ofthe global search. If you do not know the number, use the input help (F4) for a list of proposed purchase order numbers.You have to assign the purchase order items using drag-and-drop.To complete this step, you must assign a purchase order item to all open NF-e items.

4. All assigned NF-e items are now displayed in the Assigned NF-e Items table, along with the following information:Assigned NF-e Items

Item NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order ItemPO QuantityPurchase Order UnitPO Material NumberPurchase Order Material Short Text

You can always reset assignments. Select the lines with the NF-e items to be reset, and then choose Reset Assignment.

5. To check if your assigned NF-e items are correct, save your assignments.

You can also check if your assigned NF-e items are correct by running a simulation (see NF-e Fiscal Workplace: NF-e Simulation).

1.5.2.5.1.3 Assignment for NF-e for Symbolic Returns(SUBCON2C)

Procedure

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 170 of 174

You can choose Execute Process Step to manually execute the assignment of items. This step depends on the determined businessprocess. For Normal Purchasing, the process step isAssign Purchase Order Items.To assign purchase order items, proceed as follows:1. Select an NF-e and choose Execute Process Steps –> Assign Purchase Order Items (for Normal Purchasing)2. On the next screen, you see the following table entries:

Open NF-e ItemsItem NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order Item

Available Items (for example: PO items from a reference NF-ePO NumberPurchase Order ItemPO Material NumberPurchase Order Material Short TextPO QuantityPurchase Order Unit

Available PO items are determined in the ERP system with search criteria provided by the XML file. For more information, seeCommunication with SAP ERP for Normal Purchasing (example for business process Normal Purchasing. All other businessprocesses also have a description of the ERP communication)

3. Select an open NF-e item in the table Open NF-e Items. Select an available PO item in the table Available PO Items and assign it tothe open NF-e item by choosing Assign Purchase Order.If no available PO item is displayed, choose Find Purchase Order Items to search for purchase orders using specific PO numbers(Find Purchase Order) or other search criteria (Extended Search for the Item-based search).Alternatively, you can search for an existing individual purchase order by entering the purchase order number into the search field ofthe global search. If you do not know the number, use the input help (F4) for a list of proposed purchase order numbers.You have to assign the purchase order items using drag-and-drop.To complete this step, you must assign a purchase order item to all open NF-e items.

4. All assigned NF-e items are now displayed in the Assigned NF-e Items table, along with the following information:Assigned NF-e Items

Item NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order ItemPO QuantityPurchase Order UnitPO Material NumberPurchase Order Material Short Text

You can always reset assignments. Select the lines with the NF-e items to be reset, and then choose Reset Assignment.

5. To check if your assigned NF-e items are correct, save your assignments.

You can also check if your assigned NF-e items are correct by running a simulation (see NF-e Fiscal Workplace: NF-e Simulation).

1.5.2.5.1.4 Assignment for Future Delivery Goods Receipt(FUTDELGR)

ProcedureYou can choose Execute Process Step to manually execute the assignment of items. This step depends on the determined businessprocess. For Normal Purchasing, the process step isAssign Purchase Order Items.To assign purchase order items, proceed as follows:1. Select an NF-e and choose Execute Process Steps –> Assign Purchase Order Items (for Normal Purchasing)2. On the next screen, you see the following table entries:

Open NF-e Items

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 171 of 174

Item NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order Item

Available Items (for example: PO items from a reference NF-ePO NumberPurchase Order ItemPO Material NumberPurchase Order Material Short TextPO QuantityPurchase Order Unit

Available PO items are determined in the ERP system with search criteria provided by the XML file. For more information, seeCommunication with SAP ERP for Normal Purchasing (example for business process Normal Purchasing. All other businessprocesses also have a description of the ERP communication)

3. Select an open NF-e item in the table Open NF-e Items. Select an available PO item in the table Available PO Items and assign it tothe open NF-e item by choosing Assign Purchase Order.If no available PO item is displayed, choose Find Purchase Order Items to search for purchase orders using specific PO numbers(Find Purchase Order) or other search criteria (Extended Search).To complete this step, you must assign a purchase order item to all open NF-e items.

4. All assigned NF-e items are now displayed in the Assigned NF-e Items table, along with the following information:Assigned NF-e Items

Item NumberQuantityUnit of MeasureMaterial NumberPO NumberPurchase Order ItemPO QuantityPurchase Order UnitPO Material NumberPurchase Order Material Short Text

You can always reset assignments. Select the lines with the NF-e items to be reset, and then choose Reset Assignment.

5. To check if your assigned NF-e items are correct, save your assignments.

You can also check if your assigned NF-e items are correct by running a simulation (see NF-e Fiscal Workplace: NF-e Simulation).

1.5.2.5.2 NF-e Fiscal Workplace: Simulating NF-es

ProcedureYou can choose Execute Process Step to manually execute the Simulate Invoice and NF-e process step. To run a simulation, proceedas follows:1. Select an NF-e and choose Execute Process Steps Simulate Invoice and NF-e . The simulation is executed in the background

and you receive the simulation results immediately.2. The result displays the following information:

Simulation ResultsItem NumberPO NumberPurchase Order ItemPO QuantityPurchase Order UnitPO Material NumberPurchase Order Material Short TextCFOPTax Code

ItemsValues

Note

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 172 of 174

This tab page compares certain calculated and NF-e values.TaxesThis tab page displays tax values from the NF-e and from the simulation.

Total ValuesThis tab page displays a list comparing calculated values with total tax values.

3. Messages during simulation are displayed on top of the table in a message area and offer two message types:General messagesItem-based messages

Every message has a link to the long text in the ERP system. If a long text is available in the ERP system, it will be displayed in a pop-up window.

4. Possible ActionsYou can choose different values for CFOP and tax code and restart the simulation.After running a simulation, you can choose Save Parameters to save the tax code and CFOP code used in the simulation, as wellas the messages received during the simulation.After saving the simulation results, you can set the status for this NF-e. You have two options:

Set Status to OKYou confirm that the invoice simulation of the NF-e was without errors. You can only set the status to OK if you have an error-free simulation.Set Status Not OKChoose this status if there are still issues to deal with.

Select the Back button to go back to the overview screen.

Exception: If you want to simulate a PO, it is not possible to set a status. The Back button leads to the assignment screen. Theadditional button Back to Overview leads you back to the NF-e Fiscal Workplace.

5. After setting a status, you return automatically to the NF-e Fiscal Workplace. If you do not want to set a status, use the Back button toreturn to the NF-e Fiscal Workplace.

1.5.2.5.3 NF-e Fiscal Workplace: Recording DANFEs

ProcedureThis step is intended to compare the XML generated PDF preview from the NFE system with the arrived DANFE paper document andto confirm that the DANFE has arrived and that the processing can continue.The degree of displayed details in the step Recording DANFE can be controlled in Customizing under Nota Fiscal Eletronica Inbound Define Control Parameters for Process Steps . Table /XNFE/PROCCTRL contains the control parameters for this step andbusiness process. If no entry exists in the table during processing, then the parameter receives value blank and the PDF preview isdisplayed immediately.For more information, see the section Maintaining the Variant for the PDF Display in Process Settings and Customizing (Inbound).For this activity, the following settings can be made:

Display PDF Preview (A PDF preview of the DANFE is displayed in the corresponding step immediately)Do not Display PDF Preview (No PDF preview of the DANFE is displayed in the corresponding step)Display PDF Preview Subsequently (The DANFE PDF preview is only loaded and displayed after inquiry via opening of the previewarea

You can choose Execute Process Step to manually execute the Goods Arrived, Enter DANFE process step. To record a DANFE,proceed as follows:1. Select an NF-e and choose Execute Process Steps Goods Arrived, Enter DANFE .2. On the next screen, you see Goods Arrived, Enter DANFE: <DANFE number> along with the following information:

Goods Arrived, Enter DANFEProcess TypeCNPJ number of the NF-e issuerCNPJ/CPF number of the NF-e recipientTotal value including taxName of NF-e issuerName of NF-e recipient

3. Display DANFEYou can display a PDF file that is generated from the XML content. This DANFE is only a preview of the received DANFE. Thepurpose is to compare the preview with the data of the received DANFE.

To display the PDF file, you must have an ADS system running and connected to your environment.

4. You can now set the status for this NF-e. You have two options:Set Status to OKYou confirm that the goods have arrived and the entered DANFE is correct.Set Status Not OK

Note

Note

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 173 of 174

Choose this status if there are still issues to deal with.5. After setting a status, you return automatically to the NF-e Fiscal Workplace. If you do not want to set a status, use the Back button to

return to the NF-e Fiscal Workplace.

1.5.2.5.4 NF-e Fiscal Workplace: Checking Goods ReceiptQuantities

ProcedureYou can choose Execute Process Step to manually execute the Check Goods Receipt Quantities process step. To check goodsreceipt quantities, proceed as follows:1. Select an NF-e and press Execute Process Steps -> Check Goods Receipt Quantities2. In the following screen, you see a message Check Goods Receipt Quantities followed by the number of the NF-e. You see the

following information:Checking Goods Receipt Quantities

Process TypeCNPJ number of the NF-e issuerCNPJ/CPF number of the NF-e recipientTotal value including taxName of NF-e issuerName of NF-e recipient

3. You can now set the status for this NF-e. You have two options:Set Status to OKYou confirm the correctness of the quantities that were entered by the logistics clerk.Set Status Not OKChoose this status if there are still issues to deal with.

4. After setting a status, you return automatically to the NF-e Fiscal Workplace. If you do not want to set a status, use the Back button toreturn to the NF-e Fiscal Workplace.

PUBLIC© 2013 SAP AG or an SAP affiliate company. All rights reserved.

Page 174 of 174