SAPLibrary NF-e27 Nov 2012

107
HELP.CAINTBR Electronic Fiscal Documents (DF-e) PUBLIC | CUSTOMER | INTERNAL | CONFIDENTIAL | STRICTLY CONFIDENTIAL Document Version: 6773 – November 27, 2012

Transcript of SAPLibrary NF-e27 Nov 2012

Page 1: SAPLibrary NF-e27 Nov 2012

HELP.CAINTBR Electronic Fiscal Documents (DF-e)

PUBLIC | CUSTOMER | INTERNAL | CONFIDENTIAL | STRICTLY CONFIDENTIAL Document Version: 6773 – November 27, 2012

Page 2: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 2

Copyright © Copyright 2012 SAP AG. All rights reserved. SAP Library document classification: PUBLIC 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. 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. Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the United States and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and other countries. Oracle and Java are registered trademarks of Oracle and its affiliates. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems Inc. HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. IOS is a registered trademark of Cisco Systems Inc. RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App World are trademarks or registered trademarks of Research in Motion Limited. Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik and Android are trademarks or registered trademarks of Google Inc.

Page 3: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 3

INTERMEC is a registered trademark of Intermec Technologies Corporation. Wi-Fi is a registered trademark of Wi-Fi Alliance. Bluetooth is a registered trademark of Bluetooth SIG Inc. Motorola is a registered trademark of Motorola Trademark Holdings LLC. Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, 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. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company. Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. 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.

Page 4: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 4

Icons in Body Text Icon Meaning

Caution

Example

Note

Recommendation

Syntax

Additional icons are used in SAP Library documentation to help you identify different types of information at a glance. For more information, see Help on Help General Information Classes and Information Classes for Business Information Warehouse on the first page of any version of SAP Library.

Typographic Conventions Type Style Description

Example text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation.

Example text Emphasized words or phrases in body text, graphic titles, and table titles.

EXAMPLE TEXT Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE.

Example text Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools.

Example text Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation.

<Example text> Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system.

EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER.

Page 5: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 5

Electronic Fiscal Documents (DF-e)....................................................................................... 8 Electronic Nota Fiscal (NF-e) .......................................................................................... 9

Customizing for NF-e ................................................................................................ 10 Mandatory Settings ............................................................................................... 12

Customizing Nota Fiscal Types .......................................................................... 13 Maintaining Number Ranges .............................................................................. 14 Customizing Numbering and Sending Documents to the Messaging System ...... 15 Assigning Authorizations Related to Electronic Fiscal Documents ...................... 16 Customizing XML Layout Version ....................................................................... 17 Maintaining Default Values for the XML File ....................................................... 18 Customizing for Contingency Processing ........................................................... 19

Customizing for Printing Contingency Document on Security Paper ................ 20 Customizing Cancellation Reasons .................................................................... 21 Customizing Tax Jurisdiction Codes ................................................................... 22

Optional Settings ................................................................................................... 23 Customizing Official Status Codes ..................................................................... 24 Customizing Automatic Printing of Authorized Documents .................................. 25 Customizing for Cancellation under Contingency ................................................ 26 Customizing Tax Situations ................................................................................ 27 Customizing NF Type Redetermination in SD ..................................................... 28 Customizing NF Type Determination for Mixed Scenarios .................................. 29 Customizing BCB Country Codes ....................................................................... 31 Customizing for SCAN ....................................................................................... 32 Customizing for ICMS Exemption Reasons ........................................................ 33 Business Add-Ins (BAdIs) for Electronic Fiscal Documents ................................. 34

Interfaces for Communicating with Messaging System ........................................... 35 Activating SAP BusinessObjects Nota Fiscal Eletrônica ..................................... 36 Interface for Outbound Messages ...................................................................... 37 Interfaces for Inbound Messages ....................................................................... 39 Interfaces for Messaging-System Actions ........................................................... 41

Business Transactions .............................................................................................. 43 Outgoing Electronic Notas Fiscais ......................................................................... 44

Requesting Authorization for Documents ............................................................ 45 NF-e/CT-e Monitor ................................................................................................ 47

Checking Document Status ................................................................................ 49 Log for Electronic Fiscal Documents ............................................................... 51 Electronic Fiscal Document Data .................................................................... 52 Access Key .................................................................................................... 56

User Actions for Individual Documents ............................................................... 57 Document Cancellation ...................................................................................... 59 Contingency Processing of Documents Posted in Normal Mode ......................... 62 Central Contingency Processing ........................................................................ 65

Activating Contingency Processing for Regions .............................................. 66 Activating Contingency Processing for Business Places.................................. 67

Electronic Fiscal Document Processing with Contingency Server ....................... 69 Statuses in NF-e/CT-e Monitor ........................................................................... 71

Monitor Statuses: Document Authorization ..................................................... 72 Monitor Statuses: Authorization with Subsequent Cancellation........................ 73

Page 6: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 6

Monitor Statuses: Rejection and Subsequent Skipping ................................... 75 Monitor Statuses: Authorization with Validation Error ...................................... 77 Monitor Statuses: Document Switched to Contingency ................................... 78 Monitor Statuses: Document Posted under Contingency ................................. 80 Monitor Statuses: Cancellation Prior to Authorization ...................................... 81

Incoming Electronic Notas Fiscais ......................................................................... 83 Changing Posting Date for Manually-Created Incoming NF-e ............................. 85 User Decision in Creation of Incoming NF in Mixed Scenarios ............................ 86

Reports ..................................................................................................................... 87 Check Number Range Gaps (Gap Report)............................................................. 88

NF-e Events.............................................................................................................. 89 Customizing for NF-e Events ................................................................................. 90 Interfaces for NF-e Events ..................................................................................... 91

Interface for Outbound NF-e Event Messages .................................................... 92 Interface for Outbound CC-e Messages ............................................................. 93 Interface for Inbound NF-e Event Messages ....................................................... 94

Event: Electronic Correction Letters (CC-e) ........................................................... 95 Process Flow for Electronic Corrections Letters (CC-e) ...................................... 96

Creating Electronic Correction Letters (CC-e) ................................................. 98 Event: NF-e Cancellation ....................................................................................... 99

Creating NF-e Cancellation Event .................................................................... 100 Archiving NF-Event Data ..................................................................................... 101

Conhecimento de Transporte Eletrônico (CT-e) .......................................................... 102 Customizing for CT-e .............................................................................................. 106

Archiving Notas Fiscais .................................................................................................. 107

Page 7: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 7

Change History This table summarizes the main changes made the existing Electronic Fiscal Documents (DF-e) documentation due to the implementation of changes regarding the support of the SVC server.

Type of Change

Reason Releated

Documents

Documents updated

Document title has been changed

Business Add-Ins (BAdIs) for NF-e changed to Business Add-Ins (BAdIs) for Electronic Fiscal Documents (pg 34)

NF-e Processing with SCAN changed to Electronic Fiscal Document Processing with Contingency Server (pg 69)

Documents updated

Content has been updated Customizing Numbering and Sending

Documents to the Messaging System (pg 15)

Customizing for Cancellation under Contingency (pg 26)

Business Add-Ins (BAdIs) for Electronic Fiscal Documents (pg 34)

Electronic Fiscal Document Data (pg 52)

Electronic Fiscal Document Processing with Contingency Server (pg 69)

Page 8: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 8

Electronic Fiscal Documents (DF-e)

In your SAP ERP system, you can create and process the following types of electronic fiscal documents:

Electronic Nota Fiscal (NF-e) Conhecimento de Transporte Eletrônico (CT-e)

Page 9: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 9

Electronic Nota Fiscal (NF-e)

As of 2007, the Brazilian government introduced electronic notas fiscais (NF-e) to replace the conventional, hard-copy notas fiscais. Before NF-e are printed and sent with goods, the state tax authority (SEFAZ) of the state of origin of the NF-e (or, in certain cases, the federal authority) must grant authorization.

Integration

You enable communication between the tax authority systems and your SAP ERP system with a messaging system. You can choose your own messaging system or an SAP product: SAP BusinessObjects Nota Fiscal Eletrônica. SAP BusinessObjects Nota Fiscal Eletrônica can be integrated into your existing system landscape, so that your SAP ERP system provides the data required by the authorities and SAP BusinessObjects Nota Fiscal Eletrônica communicates with the authorities and your customers and suppliers. When connecting SAP ERP to SAP BusinessObjects Nota Fiscal Eletrônica, all necessary interface implementation is part of the standard delivery. However, you must make certain Customizing settings in SAP ERP and SAP BusinessObjects Nota Fiscal Eletrônica.

For more information about SAP BusinessObjects Nota Fiscal Eletrônica and the communication with your SAP ERP system, see http://help.sap.com/grc SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

If you choose to use a different messaging system for communication with the tax authorities, you must also make certain Customizing settings to enable this communication. For more information about these settings, see Customizing for NF-e.

Prerequisites

To process NF-e, you have made the necessary settings in Customizing. This includes Customizing activities that are specific to NF-e. For more information, see Customizing for NF-e.

Features

The system generates the required NF-e in processes that are subject to NF-e processing.

Activities

You monitor your NF-e – from its initial posting through its authorization by the tax authorities – using the NF-e/ CT-e Monitor, described in the following documentation. You use the monitor to perform activities such as:

Switching to contingency Canceling NF-e and source documents (with authorization request) Skipping NF-e (with authorization request) Running reports about number gaps Checking logs for NF-e

The functions that enable these activities are described in more detail in the following documentation.

Page 10: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 10

Customizing for NF-e

You need to make a number of Customizing settings to process electronic notas fiscais (NF-e). The Customizing activities for these settings are located in different parts of the SAP Implementation Guide (IMG): Some of the settings are made in the general activities for nota fiscal processing and are located in the Customizing for Cross-Application Functions under

General Application Functions Nota fiscal . Others are specific to processing NF-e and are located in the Customizing for Nota fiscal under Electronic Notas Fiscais (NF-e).

Mandatory Optional Related to the configuration of the messaging system you use for communication with

the tax authorities Related to electronic correction letters (CC-e). The information about these

Customizing settings is included in Customizing for Electronic Correction Letters (CC-e).

Features

These settings are explained in the following sections in this documentation:

Mandatory Settings o Customize Nota Fiscal Types o Maintain Number Ranges o Customize Numbering and Sending NF-e to the Messaging System o Assign Authorizations for User Actions Related to NF-e o Customize XML Layout Version o Maintain Default Values for the NF-e XML File o Customize Printing for Contingency NF o Customize Cancellation Reasons o Customize Contingency Reasons o Customize Tax Jurisdiction Codes

Optional Settings o Customize SEFAZ Status Codes o Customize Automatic Printing of Authorized NF-e o Enable the automatic cancellation of source documents o Customize Tax Situations o Customize NF Type Redetermination in SD o Customize NF Type Determination for Mixed Scenarios o Customize BCB Country Codes o Customize for SCAN o Customize ICMS Exemption Reasons o Create implementations of the General Enhancements for Electronic Fiscal

Documents and Check Period of Notas Fiscais Business Add-Ins (BAdIs)

SAP BusinessObjects Nota Fiscal Eletrônica as Messaging System

If you use SAP BusinessObjects Nota Fiscal Eletrônica as your messaging system, you must make Customizing settings in both your ERP system and the SAP BusinessObjects Nota Fiscal Eletrônica system. In your ERP System, these include the following:

Activating SAP BusinessObjects Nota Fiscal Eletrônica as your messaging system Enabling functions related to the automation of the processing of incoming NF-e

Page 11: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 11

For more information about the Customizing in SAP BusinessObjects Nota Fiscal Eletrônica, see http://help.sap.com/grc SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

Other Messaging Systems

If you do not use SAP BusinessObjects Nota Fiscal Eletrônica, you must enable your messaging system to pass the communication between your SAP ERP system and the tax authorities. Information about the function modules in SAP ERP that act as interfaces to your messaging system is provided in the following documentation. The following interfaces are explained:

Interfaces for Outbound Messages Interfaces for Inbound Messages Interfaces for Messaging-System Actions

NF-e Events

For information about the Customizing for electronic correction letters (CC-e), see Customizing for Electronic Correction Letters (CC-e).

Page 12: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 12

Mandatory Settings The following documentation describes the settings you must make to process electronic notas fiscais (NF-e).

Page 13: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 13

Customizing Nota Fiscal Types

The system identifies a process that is relevant for electronic fiscal documents (such as NF-e or CT-e) processing based on the nota fiscal (NF) type assigned to the corresponding nota fiscal.

Activities

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal Define Nota Fiscal Types .

In the details of those NF types that are used for NF-e, do the following:

In the Indicators group box, select Electronic NF. In the Other group box, choose Nota Fiscal - Model 55 as the Nota Fiscal

model for NF-e or Nota Fiscal - Model 57 for CT-e. For outgoing NF types or NF types that require authorization from the tax authorities,

enter a nota fiscal form, which you must configure for NF-e numbering.

Note

You can create new electronic NF types by copying existing NF types, specifying a new name, and setting the Electronic Doc indicator.

End of the note.

Page 14: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 14

Maintaining Number Ranges

You need to define number ranges that the system uses for assigning the nine-digit NF-e number to an electronic fiscal document (such as NF-e or CT-e). This number is also known as the external document number and is part of the access key.

You do so in Customizing for Cross-Application Components, by choosing General Application Functions Nota Fiscal Electronic Fiscal Documents Maintain Number Ranges for Electronic Fiscal Documents .

Each number range belongs to a number range group. You must assign a unique number range group to each business place. This enables the system to identify which business place generated a particular NF-e number.

You make this assignment in Customizing for Cross-Application Components, by choosing General Application Functions Nota Fiscal Output Assign Numbering and Printing

Parameters .

Page 15: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 15

Customizing Numbering and Sending Documents to the Messaging System

When you create electronic fiscal documents such as NF-e or CT-e, you need to number and send them to be authorized by the tax authorities.

You can choose among four different ways of numbering and sending the electronic fiscal document to the messaging system:

You create an electronic fiscal document, and the numbering and sending is done automatically in processes in Materials Management (MM) and Sales and Distribution (SD) and stand-alone creation using the Nota Fiscal Writer.

Caution

SAP does not recommend this method of numbering and sending, because it can lead to inconsistencies of the status of the electronic fiscal document, between the back-end system, the messaging system and the tax authorities’ database.

End of the caution.

You number and send the document manually in the NF-e/CT-e Monitor, by selecting the Set Number button.

You number the document manually in the NF-e/CT-e Monitor, by selecting the Set number menu. The document is then sent automatically in the batch process.

You schedule a periodic execution of the Send Fiscal Documents in Batch to the Messaging System (J_BNFECALLRFC) report, and the numbering and sending of the documents are done automatically.

Activities

1. In Customizing for Cross-Application Components, choose General Application Functions Nota fiscal Output Assign Numbering and Printing Parameters .

2. Select one of the entries in the General Printing Parameters list or create a new one. 3. In the Key-Specific Printing Parameters view, define the numbering and sending

option in the RFC Exec. field.

Note

Only relevant for NF-e: For SCAN forms, you cannot select 2 - Numbering in Monitor Report - RFC via batch report for this field. This value is not allowed, because the scheduling of the batch run may cause the NF-e to be sent at a time when the SEFAZ or SCAN server, respectively, is no longer active.

End of the note.

4. If you use the batch process to send the documents to the messaging system, define the periodic execution of the report (See Background Processing System: Overview).

Page 16: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 16

Assigning Authorizations Related to Electronic Fiscal Documents

Many of the user actions that are possible from the NF-e/CT-e Monitor are subject to authorization checks. You make the settings described below to enable the appropriate users to carry out these tasks.

Note

The Monitor does not carry out authorization checks when users check the connection to the messaging system, check an electronic fiscal document log, or display an NF-e or a CT-e in the Nota Fiscal Writer.

End of the note.

Activities

From the SAP Easy Access menu, choose Tools Administration User Maintenance Role Administration Roles , and assign the following activities of the F_NFBA authorization object to the role you use for Financial Accounting (FI) functions:

Assign Activity To Enable User Actions in the NF-e/CT-e Monitor

85 (reverse)

Request an authorization to cancel an authorized NF-e/CT-e Set contingency per region or per business place Request an authorization to cancel a rejected NF-e/CT-e Synchronize cancellation, that is, cancel both NF-e//CT-e and source

document Cancel NF-e prior to receiving authorization from tax authorities

35 (output)

Send NF-e with system communication status blank (not sent) Set contingency per NF-e/CT-e Reset contingency per NF-e/CT-e Delete NF-e//CT-e log entries Resend an NF-e/CT-e Request cancellation again for an NF-e/CT-e

02 (change) Create electronic correction letters (CC-e) for NF-e 03 (display) Display notas fiscais in the NF-e/CT-e Monitor

Note

You must also enable appropriate users to cancel a contingency NF-e by canceling the related material or invoice document in Materials Management (MM) or Sales and Distribution (SD) without prior cancellation authorization from the tax authorities. To do so, assign activity 85 (reverse).

End of the note.

Page 17: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 17

Customizing XML Layout Version

To be able to create and send an XML file to the tax authorities, you must enter the correct XML layout version in Customizing. You assign the XML layout version that is currently valid for the state of origin of your goods or services per business place.

Activities

Assign the XML layout version as follows:

1. In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal CNPJ Business Places Define Business Places .

2. For the relevant company code and business place, choose Electronic Fiscal Document Configuration.

3. Enter Nota Fiscal - Model 55 for NF-e or Nota Fiscal - Model 57 for CT-e in the NF model field and the date from which it is valid.

4. Enter the version in the XML Version field.

Page 18: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 18

Maintaining Default Values for the XML File

You use this function to maintain default values that must be included in the XML file that the system sends to the tax authorities.

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal CNPJ Business Places Define Business Places . For the relevant

company code and business place, choose Electronic Fiscal Document Configuration and specify default values for the following:

Application version Value for the issuing type. You enter a value to indicate which documents are

processed normally and which are processed under contingency Value for the issuing process. Special values related to the region and city for foreign business partners Default values for contingency

For more information, refer to the respective field help in the system.

Page 19: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 19

Customizing for Contingency Processing

To be able to process an electronic fiscal document (such as NF-e or CT-e) under contingency – either as one switched from normal processing to contingency processing, or as one posted under central contingency – you must make the following settings:

Enter contingency reasons to be sent to the tax authorities Determine how electronic fiscal documents processed under contingency should be

printed

Contingency Reasons

You enter internal codes for the contingency reasons and descriptive texts that must meet the requirements of the tax authorities in Customizing for Cross-Application Components, under

General Application Functions Nota Fiscal Electronic Fiscal Documents Define Contingency Reasons . The descriptive text, along with the contingency date and time, is sent in the XML file to the tax authorities for NF-e posted in contingency. The text is also displayed in the NF-e/CT-e Monitor.

Printing Under Contingency

Your SAP ERP system determines which number range and printer to use, based on how you set up printing in Customizing. For more information about printing contingency notas fiscais, see Customizing for Printing Contingency Document on Security Paper.

Page 20: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 20

Customizing for Printing Contingency Document on Security Paper

To configure printing a contingency nota fiscal on security paper, make the following settings in Customizing for Cross-Application Components, under General Application Functions Nota Fiscal Output Assign Numbering and Printing Parameters :

For number-range determination in Sales and Distribution (SD) and Materials Management (MM), set the Numbering Contin. indicator in the NF-e group box.

For printing in MM, maintain the contingency printer (must be a laser printer) in the Output Device field in the NF-e group box.

For printing in SD, you can maintain the contingency printer in one of the following ways:

o Maintain the contingency printer (must be a laser printer) in the Output Device field in the NF-e group box

o Configure the contingency printer using the classical printer configuration: Do not enter a printer in the Output Device field in the NF-e box.

Page 21: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 21

Customizing Cancellation Reasons

When you request authorization from the tax authorities to cancel or skip an electronic fiscal document (such as NF-e or CT-e), you must specify a reason.

Activities

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal Electronic Fiscal Document Define Cancellation Reasons and make

settings as required.

In the Cancel Reason field, specify a technical key for the reason to cancel or skip the electronic fiscal document. In the column Description, specify the reason, which will be sent in the XML file. You may assign pre-defined reversal reasons from logistics invoice verification and/or goods movements in the columns Reason LIV and Reason GM respectively.

Note

If the cancellation of an electronic fiscal documents occurs automatically in the background upon receipt of an authorization to cancel/skip, the system uses the reversal reason for Logistics Invoice Verification (LIV) or the goods movement as defined in this activity to cancel the related invoice or material document.

End of the note.

Page 22: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 22

Customizing Tax Jurisdiction Codes

Your SAP ERP system derives the region in the access key from the tax jurisdiction code of the NF-e issuer. The city codes in the NF-e are also derived from the tax jurisdiction code of the corresponding address. Therefore a tax jurisdiction code is composed as follows:

The first 3 digits of the jurisdiction code are the region code followed by a space. For example, “SP ” is the tax region for Sao Paulo.

The last 7 digits of the key are for the municipal code: The first two digits define the state and the next five digits define the municipio as listed in the IBGE table. For example, “3550308” is the municipal code for the city of Sao Paulo.

In the example, the tax jurisdiction code for the city of Sao Paulo is then “SP 3550308”. “35” is used as the region/state in the access key, and “3550308” is used as the city code.

To enable your system to determine tax jurisdiction codes to create access keys, you must enter the tax jurisdiction codes for the different tax regions in Customizing and then assign them to postal codes.

Activities

1. In Customizing for Financial Accounting choose Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil .

2. In the Define Tax Jurisdiction Codes Customizing activity, you enter tax jurisdiction codes.

3. In the Assign Postal Codes to Tax Jurisdiction Codes Customizing activity, you assign a range of postal codes to each tax jurisdiction code.

For more information about the settings to be made, see the system documentation for the Customizing activities.

Page 23: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 23

Optional Settings The following documentation describes the optional settings you can make to process electronic notas fiscais (NF-e).

Page 24: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 24

Customizing Official Status Codes

The NF-e/CT-e Monitor displays the official status codes issued by the tax authorities. An example of such a code is 100 for an authorized electronic fiscal document. If you enter a description for the codes in Customizing, the NF-e/CT-e Monitor additionally displays the description in the Single Document History section. For example, next to the 100 code, it can display Authorized as the description.

Activities

Enter the official status codes as defined by the tax authorities and descriptions as required in Customizing for Cross-Application Components, by choosing General Application Functions Nota Fiscal Electronic Fiscal Document Define Official Status Codes .

Page 25: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 25

Customizing Automatic Printing of Authorized Documents

You must first wait for authorization from the tax authorities to print an electronic fiscal document (such as NF-e or CT-e). Once the tax authorities approve your electronic fiscal document and return a corresponding protocol number, the system does not print the document automatically. You can configure automatic printing by implementing a Business Add-In.

Activities

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal Electronic Fiscal Documents BAdI: General Enhancements for Electronic

Fiscal Documents , and create an implementation for the Call Print Program (CALL_RSNAST00) method.

Note

If you want to ensure that this method is called after the database has been updated with the authorization message from the tax authorities, you can use the Set Indicator for Commit Call (SET_COMMIT) method.

End of the note.

Page 26: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 26

Customizing for Cancellation under Contingency

When the server at the tax authorities (SEFAZ, SCAN, or SVC) is having performance problems, you can react by doing one of the following:

Cancel the electronic fiscal document (such as NF-e or CT-e) prior to receiving authorization from the tax authorities (in the NF-e/CT-e Monitor, choose Fiscal Document Cancel Prior to Author )

Switch the electronic fiscal document to contingency mode (in the NF-e/CT-e Monitor, choose the Contingency pushbutton)

In Customizing, you must define how to proceed with the source document: cancel it manually, let the system cancel it automatically upon cancellation of the electronic fiscal document or even keep the source document and set the system to automatically generate a new electronic fiscal document to replace the cancelled one.

Activities

You make the corresponding setting in Customizing for Cross-Application Components, under General Application Functions Nota fiscal CNPJ Business Places Define Business

Places . On the Details of Added Entries screen for the relevant branches, under Cancellation under Contingency, select one of the options in Cancel Elect. Doc:

Manually: You define that the cancellation of source documents should be triggered by the user manually.

Cancel source document automatically: You define that the system automatically cancels the source document. Once the source document is cancelled, the electronic fiscal document is automatically cancelled by the system.

Create new fiscal doc. and request cancel. for previous one: You define that the system automatically creates a new electronic fiscal document with the same data of the previous one. The source document is then linked to the new electronic fiscal document.

By selecting Send Cancel. Req. Automatically, you configure the system to automatically send a cancellation request to the tax authorities for an electronic fiscal document if this has been either canceled prior to being authorized or is switched to contingency.

Page 27: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 27

Customizing Tax Situations

Tax situations for incoming and outgoing fiscal electronic documents (such as NF-e or CT-e) may differ for the following tax types:

IPI PIS COFINS

Electronic fiscal documents use the “outgoing” tax situations if they exist. Otherwise, the “incoming” tax situation is used.

Activities

You must enter the tax situation for these tax types in Customizing for Financial Accounting under Financial Accounting Global Settings Tax on Sales/Purchases Basic Settings Brazil . The relevant Customizing activities are the following:

Define IPI Tax Laws Define PIS Tax Laws Define COFINS Tax Laws

You only need to enter an outgoing tax situation if it differs from the incoming value. You do so in the Details for the respective tax law.

Page 28: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 28

Customizing NF Type Redetermination in SD Use In Sales and Distribution (SD), the system checks if a nota fiscal type is assigned to the sales document type you specify in the sales order. This is how the system determines which type of nota fiscal should be generated for the given sales process.

Activities For the system to recognize that a sales process is subject to electronic nota fiscal (NF-e) processing, you need to assign an electronic NF type, based on your requirements, in one of the following activities in Customizing for Cross-Application Components, under General Application Functions Nota Fiscal Sales and Distribution – Billing Documents

Assign Nota Fiscal Type to Sales Document Types

Define NF Type Redetermination per Business Place

Define NF Type Redetermination per Region If required, you can also redetermine the NF type at line-item level by implementing the Business Add-In in the activity BAdI: Redetermination of Nota Fiscal Type per Line Item (under same path as above).

Page 29: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 29

Customizing NF Type Determination for Mixed Scenarios

You need to make the settings described below if your company handles scenarios with mixed nota fiscal (NF) types. The settings below enable you to specify whether the user can decide what type of NF should be created – conventional NF or electronic fiscal document (such as NF-e or CT-e) when you enter an incoming NF for which a reference NF already exists, during goods movement transactions. For more information, see User Decision in Creation of Incoming NF in Mixed Scenarios.

Activities

Make settings related to NF type determination as follows:

NF type redetermination for goods movements

You assign an NF type for processing of NF-e to a combination of plant and movement type. To do so, in Customizing for Cross-Application Components, choose

General Application Functions Nota Fiscal Material Management Inventory Managment Define NF Type Redetermination for Goods Movements and maintain entries for plant, movement type, and NF type, and select the User Decision checkbox.

Note

You have assigned NF types to movement types for normal NF processing in the Customizing activity Maintain Nota Fiscal Category Derivation. When both activities are maintained, the system uses the following logic:

1. User Decision checkbox is selected: A dialog box appears in which you specify which NF type to use (for a specific movement type).

2. User Decision checkbox is not selected: The settings in the Customizing activity Define NF Type Redetermination for Goods Movements overrule the settings made in the Customizing activity Assign Nota Fiscal Category to Sales Document Types.

End of the note.

NF type determination for vendors

You assign an NF type for processing of NF-e to a combination of vendor, plant, and movement type. You only need to maintain this activity if, in the case of mixed scenarios, users should be able to decide on the type of NF to be created based on the vendor. If this is not required, only maintain the activity Define NF Type Redetermination for Goods Movements.

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal Material Management Inventory Management Define NF Type Determination for Vendors and maintain the entries for plant, movement type, vendor, and NF type, and select the User Decision checkbox.

Page 30: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 30

You can also maintain this activity generically by only specifying movement type and vendor without specifying the plant.

Note

If the system finds an entry in vendor, plant, and movement type in the activity Define NF Type Determination for Vendors, these values overrule any entries made in the activities Assign Nota Fiscal Category to Sales Document Types and Define NF Type Redetermination for Goods Movements.

End of the note.

Page 31: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 31

Customizing BCB Country Codes

You need to map the BCB country codes defined by the Central Bank of Brazil (BCB) to the ISO country codes used by your SAP system, so that your system can determine the correct country code and set it for XML files.

Activities

Make the necessary settings in Customizing for Financial Accounting (New) under General Ledger Accounting Periodic Processing Report Statutory Reporting: Brazil SPED Reporting Assign BCB Country Codes to ISO Country Codes .

Page 32: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 32

Customizing for SCAN

When there are technical problems with the SEFAZ server in your region (state) and the government activates SCAN, you can send your NF-e to the SCAN server for authorization. To enable this switch to the alternative SCAN server, you must make the following settings in Customizing.

Activities

You have activated automatic server determination for NF-e processing at the business-place level.

To do so, in Customizing for Cross-Application Components, choose General Application Functions Nota fiscal CNPJ Business Place Define Business Places . For the relevant company code and business place, on the NFe Configuration screen, select the Activate Automatic Server Determination for NF-e Processing checkbox.

Note

If you do not use the SAP BusinessObjects Nota Fiscal Eletrônica or want to overwrite the setting for server availability, you can do so by implementing a Business Add-In.

To do so, in Customizing for Cross-Application Components, choose General Application Functions Nota fiscal Electronic Notas Fiscais (NF-e) Business Add-Ins BAdI: General Enhancements for NF-e . Create an implementation for the Get Availability of Server (get_server) method.

End of the note.

You have defined NF-e forms for SCAN processing. The series in these forms must be in the number range from 900 to 999.

To do so, in Customizing for Cross-Application Components, choose General Application Functions Nota fiscal Output Define Forms .

You have maintained the form for SCAN in the nota fiscal type.

To do so, in Customizing for Cross-Application Components, choose General Application Functions Nota fiscal Define Nota Fiscal Types . Open the Details for the relevant nota fiscal type. In the Other group box, enter the NF-e SCAN form.

Page 33: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 33

Customizing for ICMS Exemption Reasons

If items in an NF-e have a tax situation that is exempted from ICMS, Brazilian law requires that the reason for the ICMS exemption is included in the XML of the NF-e. To enable the system to include the correct ICMS exemption reason for each item in the XML, you must map the possible reasons to the relevant CFOPs in Customizing.

Activities

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal CFOP Codes Define CFOP Codes and Assign Version , and make

settings as required. For more information, see the field help of the Reason for ICMS Exemption field in the system.

Page 34: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 34

Business Add-Ins (BAdIs) for Electronic Fiscal Documents

You can enhance the standard electronic fiscal document (NF-e or CT-e) process by implementing the following Business Add-Ins (BAdIs):

BAdI: General Enhancements for Electronic Fiscal Documents (CL_NFE_PRINT).

This BAdI allows you to implement, for example, the following additional functions:

o Allow printing of contingency NF-e o Block the sending of cancellation requests for certain NF-e o Fill header and item data that is not provided by SAP in the XML file o Trigger the automatic printing of the NF-e upon receipt of authorization from

the authorities o Check which server, SEFAZ, SCAN, or SVC, is available o Exclude certain NF-e from batch processing o Sort NF-e for batch processing o Change cancellation date for NF-e from material documents

BAdI: Check Period of Notas Fiscais (J_1BNF_CHECK_PERIOD).

This BAdI allows you to check if the posting period for an NF-e has been closed.

For more information about the functions offered by these BAdIs, see the system documentation.

Page 35: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 35

Interfaces for Communicating with Messaging System

If you use the SAP BusinessObjects Nota Fiscal Eletrônica solution for your communication with the tax authorities, the integration between the back-end system and the messaging system in the SAP BusinessObjects Nota Fiscal Eletrônica solution is largely automatic. If you choose to use SAP BusinessObjects Nota Fiscal Eletrônica, you must activate it in your SAP ERP system. For more information, see Activating SAP BusinessObjects Nota Fiscal Eletrônica. For more information about the solution itself, see http://help.sap.com/grc SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

The following documentation also describes aspects of SAP back-end functions that are relevant for communication between the back-end and other messaging systems. If you choose to use a messaging system other than SAP BusinessObjects Nota Fiscal Eletrônica, your messaging system must be set up to take these aspects into account.

More Information

For information about interfaces that are specific to electronic correction letters (CC-e), see Interfaces for Electronic Correction Letters (CC-e).

Page 36: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 36

Activating SAP BusinessObjects Nota Fiscal Eletrônica Procedure

Using SAP BusinessObjects Nota Fiscal Eletrônica as your messaging system to communicate with tax authorities provides you with a high level of automation for processing both incoming and outgoing electronic fiscal documents, such as NF-e and CT-e. To activate this SAP solution as your messaging system for your SAP ERP system, proceed as follows:

1. In your SAP ERP system, in Customizing for Cross-Application Components, choose General Application Functions Nota fiscal CNPJ Business Places Define

Business Places . 2. For the relevant company code and business place, choose Electronic Fiscal

Document Configuration. 3. Select the SAP Mess. Systm (SAP Messaging System Active) checkbox.

More Information

For more information about SAP BusinessObjects Nota Fiscal Eletrônica, see http://help.sap.com/grc SAP BusinessObjects Nota Fiscal Eletrônica System

Administrator's Guide .

Page 37: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 37

Interface for Outbound Messages

This section is relevant if you are using a messaging system other than SAP BusinessObjects Nota Fiscal Eletrônica.

The SAP back-end system asynchronously sends messages via the outbound interface RFC call to XI for Nota Fiscal Eletrônico (J_1B_NFE_XML_OUT) function module for NF-e or via the outbound interface RFC call to XI for Conhecimento de Transporte Eletrônico (J_1B_CTE_XML_OUT) function module for CT-e. These interfaces provide data of the electronic fiscal documents as required by the authorities according to the XML layout that is currently valid, together with the document status, system communication status, and contingency indicator.

Then, in the messaging system, the document data must be mapped to the layout structure of the XML file.

The document status and the system communication status contain information about the type of outbound message, which could be one of the following:

1. Request for authorization for an electronic fiscal document 2. Submission of a contingency electronic fiscal document 3. Request to authorize the cancellation of an authorized electronic fiscal document 4. Request to skip the number of a rejected electronic fiscal document

The different types of outbound messages are identified by the value of the following interface fields as listed in the table below:

For NF-e:

XML_IN-DOCSTAT XML_IN-SCSSTAT XML_IN-TPEMIS

For CT-e:

IV_DOCSTAT IV_SCSSTAT IS_CTE_IDE-TP_EMIS

Message DOCSTAT SCSSTAT TPEMIS (1) Request for authorization initial 0 1

(2) Submission of a contingency electronic fiscal document initial 0 not equals 1

(3) Request to authorize the cancellation of an authorized electronic fiscal document 1 1 initial

(4) Request to skip the number of a rejected electronic fiscal document 2 3 initial

Page 38: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 38

More Information

For information about the outbound interface specific to electronic correction letters (CC-e), see Interface for Outbound CC-e Messages.

Page 39: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 39

Interfaces for Inbound Messages

This section is relevant if you are using a messaging system other than SAP BusinessObjects Nota Fiscal Eletrônica

Your SAP ERP back-end system can receive messages via the following inbound interfaces (function modules):

Inbound XML - NFe (J_1B_NFE_XML_IN) – for single NF-e processing Process XML inbound for multiple items (J_1B_NFE_XML_IN_TAB) – for batch NF-e

processing Inbound XML - NF-e Gap Skipping Request Status Update

(J_1BNFENUMGAP_STATUS_RFC) – for batch NF-e processing (see Check Number Range Gaps)

The SAP back-end system requires a unique code that identifies the type of inbound message. These codes are defined in the back end. The inbound interfaces can process any of the following message types:

Message Code Message Type 1 Authorization 2 Rejection 3 Denial 4 Authorization to Cancel an Authorized Document 5 Authorization to Cancel a Rejected Document (Skipping) 6 Rejection of a Request for Cancellation 7 Rejection of a Request for Skipping 8 Authorization to Skip a Document with Validation Error 9 Rejection of a Request for Skipping a Document with Validation Error

Mandatory importing parameters are:

Protocol number SEFAZ status code Message type

In addition, the access key of the NF-e (the number that uniquely identifies an NF-e Brazil-wide) must be passed to the back end. Alternatively the SAP internal NF-e document number can be passed (if the NF-e was created by the SAP back-end system, the internal document number is stored in the random-number field of the access key).

Note

If the electronic fiscal document has an error in the messaging system, it is possible to display the reason for such an error in the NF-e/CT-e Monitor. For more information on how to handle errors in the messaging system, see Requesting Authorization for Documents.

End of the note.

Page 40: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 40

More Information

For information about the inbound interface specific to NF-e events, see Interface for Inbound NF-e Event Messages.

Page 41: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 41

Interfaces for Messaging-System Actions

The messaging system can perform the following actions in the SAP back-end system, which are described below:

Activate and deactivate contingency on business-place level Set the messaging-system status in the NF-e/CT-e Monitor Request electronic fiscal document data

Note

The SAP back-end system assumes an NF-e/CT-e message reaches the authorities once it has successfully been sent to the messaging system. The messaging system must not change the content of the message or switch an electronic fiscal document (NF-e/CT-e) received from the back end to contingency, as this would lead to an inconsistency of data between the back end and the tax authorities.

End of the note.

Activate/Deactivate Contingency

The messaging system can activate and deactivate contingency in the SAP back-end system on business-place level. This is possible via the remote-enabled NF-e: Switch Contingency Mode On (J_1B_NFE_CONTINGENCY_SET) function module.

In the interface, the messaging system must specify the fields LAND1, BUKRS, and BRANCH. The field REGIO must remain initial. In addition, it should be specified for which document model (55 for NF-e or 57 for CT-e) the contingency must be activated for. The messaging system may select or deselect the indicator AS_OUT. The back end interprets this indicator. If it is set, the back end switches to contingency for any subsequent document posting. The indicator can be automatically deactivated through the messaging system or manually by a user with the required authorization profile (see Activating Contingency Processing for Business Place).

If the messaging system remotely calls the function module J_1B_NFE_CONTINGENCY_SET, note that the importing parameter IV_FIRE_COMMIT must be set to X.

Set the Messaging-System Status

The NF-e Monitor displays a messaging-system status. The messaging system can set the following status values in the back end by means of the xNFe sets NF-e Status in Back End (J_1B_NFE_SET_STATUS_IN_BACKEND) function module:

Message Type Status Description A Request for authorization received by MS B Cancellation request received by MS C Skipping request received by MS G Error from MS: Request cannot be sent to authorities V Internal validation error returned from MS D Error from MS: Data inconsistency between ERP and MS

Page 42: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 42

Note

Once the messaging-system status has been set for a message, this means that the message has arrived at the messaging system. From this moment on, the processor can no longer resend the respective message requesting authorization, cancellation, or skipping. The processor can only request cancellation again for a document that has been rejected by the tax authorities and accepted in the Monitor (the system communication status in the Monitor is 8).

End of the note.

Request NF-e/CT–e Data

The messaging system can request NF-e/CT-e data from the back end using the NF-e: Messaging System Requests Data (J_1B_NFE_MS_REQUESTS_DATA) function module. The following request type is supported:

Request Type Request Description 1 Send complete NF-e/CT-e data

Page 43: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 43

Business Transactions You need to follow special procedures when handling incoming and outgoing electronic notas fiscais (NF-e). These are described in the following documentation.

Page 44: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 44

Outgoing Electronic Notas Fiscais If your system is configured accordingly [External] (mainly, the nota fiscal types are set as electronic), the system generates an electronic nota fiscal (NF-e) in processes in Materials Management (MM) and Sales and Distribution (SD) and stand-alone creation using the NF Writer as described in Nota Fiscal [Page 1]. Before you can print and send the NF-e, you need to request and receive authorization from the tax authorities (see Requesting NF-e Authorization [External]). The government allows for a special contingency processing in case you cannot wait for authorization and you must continue with your operations: you can switch an individual NF-e [External] already posted under normal conditions to contingency, or activate central contingency processing [External] for your entire region or business place.

Page 45: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 45

Requesting Authorization for Documents

Before you can print and send the printed version of the electronic nota fiscal (called a DANFE) or of the conhecimento eletrônico (DACTE) along with the goods, you need authorization from the tax authorities.

Prerequisites

You have made the required Customizing settings.

Process

1. An electronic fiscal document (such as NF-e or CT-e) is created in one of the following ways:

1. The system automatically generates an electronic fiscal document from applications such as in Materials Management (MM) and Sales and Distribution (SD) as described in Nota Fiscal.

2. You create an electronic fiscal document manually (see Creating a Nota Fiscal) using the Nota Fiscal Writer.

When the electronic fiscal document is created, the system makes an entry in the database. You can monitor the status of the document using the NF-e/CT-e Monitor (see step 4).

2. The system sends the electronic fiscal document to the messaging system (see Customizing for Numbering and Sending NF-es to the Messaging System for different options) that runs a validation check on the document. If the messaging system finds an error in the electronic fiscal document, it returns the corresponding status (see Interfaces for Messaging-System Actions for possible statuses) to the back-end system

In case of a validation error (MSS = V), check the log of the document in the monitor and decide on one of the following options:

o Reset the status of the electronic fiscal document by choosing Fiscal Document Reset Doc Status in the Monitor; correct the document data; and resend it by choosing Fiscal Document Resend .

o Send a skip request to the authorities to cancel the electronic fiscal document.

In case of another message system error (MSS = G or D), have your system administrator check the error in the messaging system.

3. If no error is found in the file, the messaging system sends an outbound message to the tax authorities to request authorization for the electronic fiscal document.

4. You check the status of Document using the NF-e/CT-e Monitor. 5. The tax authorities send one of the following responses (to the initial request for

authorization) via an inbound message: 0. Authorized

Page 46: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 46

The tax authorities send the authorization in form of a 15-digit numeric code, which the system updates in the document. You can see it in the Protocol Number field, via the Monitor or via the Nota Fiscal Writer (under NF-e Data). The system also updates the corresponding document status, system communication status, and official status code (and status code description, if maintained).

1. Rejected

This status indicates an inconsistency in the electronic fiscal document data, which you must correct. You have two options: You can reset the status of the document by choosing Fiscal Document Reset Doc. Status in the NF-e/CT-e Monitor; correct the document data; and resend it by choosing

Fiscal Document Resend . Alternatively, you can send a skip request to the authorities to cancel the electronic fiscal document, as follows:

1. Request cancellation of the original electronic fiscal document (see User Actions for Individual Documents).

2. Wait for a response from the tax authorities. 3. If the tax authorities authorize your request to cancel the electronic

fiscal document, the system cancels the source document (and automatically cancels the corresponding electronic fiscal document) or the standalone electronic fiscal document created in the Nota Fiscal Writer.

It is unlikely that the tax authorities would reject your request to cancel the electronic fiscal document, but if this does occur, repeat your skipping request.

4. Create a new source document or standalone electronic fiscal document, which has to go through the normal authorization process.

5. After you receive authorization for the new document, you can print the it.

2. Denied

This status indicates a serious problem (for example, taxes have not been paid. In this case, the system automatically cancels the electronic fiscal document and its source document.

Note

Note that it is possible that you do not receive a timely response from the tax authorities because, for example, the connection to your messaging system or the authorities’ server is down, and you cannot wait for authorization or it would interrupt your business. In such cases, the government allows you to continue your business process by processing in contingency mode. You are allowed to: 1) switch individual Document already posted under normal conditions to contingency, or 2) activate contingency centrally for your whole business place or region, after which all newly posted electronic fiscal documents are posted directly under contingency.

End of the note.

6. After the electronic fiscal document is authorized, you can print and send it with the goods.

Page 47: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 47

NF-e/CT-e Monitor

You use the NF-e/CT-e Monitor to check the status of your electronic fiscal documents (such as NF-e or CT-e). Based on the current status of a given electronic fiscal document, you can carry out several actions, which are described in the following documentation.

Integration

When you post the relevant document that triggers the automatic creation of the nota fiscal, the system checks your configuration settings (nota fiscal type) and creates either a conventional nota fiscal, an NF-e, or a CT-e. If the system creates an NF-e or a CT-e, it stores all specific data in the J_1BNFE_ACTIVE table, and makes this information available to you via the NF-e/CT-e Monitor. The Monitor also shows the data of electronic fiscal document created manually with the Nota Fiscal Writer.

Prerequisites

You have appropriate authorization for carrying out the various user actions in the Monitor.

Features

The NF-e/CT-e Monitor:

Shows the status at a glance – whether you must take action Shows all relevant data for an NF-e (current data as well as NF-e/CT-e history) Offers user actions possible for each NF-e, depending on its status Allows you to activate or deactivate central contingency processing for entire regions

or business places Enables you to check the status of the messaging system, by choosing

Contingency Check MS Connection Enables you to create and view NF-e events, for example, electronic correction letters

(CC-e) for authorized NF-e. For more information, see Electronic Correction Letters (CC-e).

Activities

On the SAP Easy Access screen, choose Logistics Central Functions Country-Specific Functions Brazil Nota Fiscal NF-e/CT-eMonitor and select electronic fiscal document by specifying selection criteria on the selection screen. Enter, for example, the following kinds of selection criteria:

Document data, such as the date of document creation or the document status Access key fields, such as the CNPJ or posting year Company data, such as the company code or business place NF-e event data, such as the internal event code or the document status of the NF-e

event

The output screen displays all documents that have been created fitting your selection criteria. From there, you monitor the document as required.

Page 48: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 48

More Information

For an overview of the most common processes and how the process steps are reflected in the NF-e/CT-e Monitor, see Statuses in the Monitor.

Page 49: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 49

Checking Document Status

The NF-e/CT-e Monitor enables you to see at a glance the current status for each document entry by means of the action status icon in the first column. Together with the entry in the second column, Required Process Step, these values guide you through any necessary steps that are required for the electronic fiscal document to be processed.

Activities

Check the status of your electronic fiscal document as follows:

Action Status Icon/Meaning Required Process Step

(In Process)

Blank = No manual action required

A = Numbering will be done via batch report – no action required

B = Sending will be done via batch report – no action required

(Completed) C = Completed

(In Process; User Action Required). User must trigger the next step.

2 = Cancel Source Document

3 = Send documents to tax authorities

For example, if you posted an electronic fiscal document under central contingency (see Central Contingency Processing).

6 = Enter protocol number (see Incoming Electronic Notas Fiscais)

7 = Request authorization from tax authorities to cancel/skip document

8 = Internal validation error in messaging system. Send again!

9 = Set document number and send to the tax authorities

0 = Set document number and send to the tax authorities via Batch report

(Error/Inconsistency; User Action Required) . User must trigger the next step.

1 = Cancel electronic fiscal document and post new one/Reset electronic fiscal document and send again

This is for the case that the request for authorization was rejected or denied (see Requesting Authorization for Documents).

Page 50: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 50

Action Status Icon/Meaning Required Process Step 4 = Request to cancel rejected; check the reason

5 = Request to skip rejected; check the reason

Note

Check to see if an log exists, which may provide additional information about the status.

End of the note.

You can also check the history of the individual electronic fiscal document by clicking on the document number. The monitor displays the history at the bottom of the screen.

Note that although you perform the required action, the status does not change to C (Completed) until the entire process is completed, as illustrated in the example below.

Page 51: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 51

Log for Electronic Fiscal Documents

A collection of error or warning messages that the system issues automatically for actions related to an electronic fiscal document (such as an NF-e or CT-e), for example, when the system identifies an invalid user action.

The Monitor displays the log status in the third column of the upper section of the output screen. A red flag icon means that there are log entries for this document. Click on the flag and you branch to the log entries.

Once you have completed the required actions, you can delete the log entries by choosing Fiscal Document Delete Log Entries .

Example

The system records an error entry in an NF-e log in the following cases:

If you try to carry out an inconsistent action, for example, switch to contingency when you have already switched to contingency processing

If you get an inbound message that is inconsistent, for example, if you receive two authorization messages for the same NF-e, or if you receive cancellation authorization and you did not request it

Page 52: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 52

Electronic Fiscal Document Data

The NF-e/CT-e Monitor displays the data of electronic fiscal documents (such as NF-e or CT-e) on the output screen, as listed below. The upper list provides an overview of all electronic fiscal documents you have selected, with the current status of each document. In the lower list you can view one of the following:

History of an individual document (see the Single Document History section) History of NF-e events for individual NF-e (see Event History for Single NF-e section)

You can personalize both of these lists using the standard functions of the SAP List Viewer (see Working with Lists).

Note

You can branch to the electronic fiscal document itself by selecting an entry from the Document Overview list and choosing Fiscal Document Display , or by clicking on the document number from this list.

End of the note.

In the following table, you find an explanation of the columns that can be displayed in the Document Overview : Columns list of the NF-e/CT-e Monitor:

Column Meaning

Action Status Graphically displays if action is required (see Checking Document Status)

Required Process Step Describes what action must be taken (see Checking Document Status)

Log Shows if there are log entries for the document (see Log for Electronic Fiscal Documents)

Document Number Displays the internal electronic fiscal document number

NF-e Events Graphically displays if NF-e events have been created for this NF-e. By clicking on the icon in this column, you can view the NF-e event history for this NF-e in the lower list.

Document Status Displays the current document status, which is relevant for statutory reporting. Values can be, for example, authorized, rejected, or denied.

System Communication Status

Displays the system communication status (such as blank (not sent) or 6 (request to cancel rejected); this value is not relevant for statutory reporting

Messaging System Status

After an electronic fiscal document has been sent for authorization from your SAP ERP system to the messaging system, shows the status sent back by your messaging system (such as A - Request for authorization received by MS)

Switched to Contingency

If set to X, the NF-e was posted normally and later switched manually to contingency (see Contingency Processing of Document Posted in Normal Mode)

Posted under Contingency

If set to X, the electronic fiscal document was posted under central contingency (see Central Contingency Processing)

Page 53: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 53

Column Meaning

Canceled If set to X, the electronic fiscal document was canceled (either automatically after canceling the source document, or manually using the NF Writer)

Canceled Prior to Authorization

If set to X, a user has set this electronic fiscal document for cancellation after an authorization request was sent to the tax authorities. The electronic fiscal document must be cancelled by canceling the source document (see the information about process step 2 in Checking Document Status).

Cancellation Synchronization

If set to X, the electronic fiscal document was canceled and the system determined that the source document for the electronic fiscal document cannot be canceled automatically. The source document has to be canceled manually (see the information about process step 2 in Checking Document Status).

Status Code Shows the official status code used by the tax authorities. This corresponds to the type of response message received from the tax authorities (such as Authorization).

Printed If set to X, the electronic fiscal document was printed

Direction Movement Shows the direction of the goods movement, such as incoming or outgoing returns of stock transfers

Nota Fiscal Form Shows the NF-e form, which defines the model and series used to print the NF-e (such as NF55)

Region of Issuer Shows the region of the issuer of the electronic fiscal document , as contained in the Access key

Year of Document Date

Shows the year when the electronic fiscal document is posted, as contained in the access key

Month of Document Date

Shows the month when the electronic fiscal document is posted, as contained in the access key

CNPJ Number of Issuer

Shows the CNPJ number of the document issuer, as contained in the access key

Nota Fiscal Model Shows the model used for printing the electronic fiscal document (model 55 or 57)

Series Shows the series, which groups notas fiscais for sequential numbering (a company can use different series or just one)

Nine-Digit Number Shows the nine-digit document number, as contained in the access key

Random Number of Access Key

For outgoing electronic fiscal document, contains the internal document number created by the SAP back-end system; for incoming electronic fiscal document, shows a randomly created number filled by the issuing party

Check Digit for Access Key Shows the last digit of the access key

Protocol Number

Shows the code (protocol number) that the authorities issue with each response message.

Note that the upper list stores the protocol number that was issued for the initial response, and the lower list shows the protocol number that was received with each message.

Processing Date Shows the date element of the timestamp that the relevant tax authority (such as SEFAZ) issues with each response message.

Processing Time Shows the time element of the timestamp that the relevant tax authority (such as SEFAZ) issues with each response message.

Created On Shows the date the electronic fiscal document was created Changed On Shows the date that the status of the electronic fiscal document

Page 54: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 54

Column Meaning changed

Changed At Shows the time that the status of the electronic fiscal document changed

Changed By Shows the user who performed an action that leads to a status change in the document status, system communication status, or the canceled indicator

Company Code Shows the company code in which the electronic fiscal document was created

Business Place Shows the business place in which the electronic fiscal document was created

Shipping Point/Receiving Point Shows the physical location from which the related item was shipped

Partner ID Identifies the partner related to the electronic fiscal document, such as the customer or vendor number

Reason for Cancellation/Skipping

Shows the technical key for the reason to cancel or skip an electronic fiscal document (see Customizing Cancellation Reasons)

Canc/Skip Description Shows the reason for cancelling or skipping an electronic fiscal document

Created By Identifies the user who first created the electronic fiscal document

RFC Execution Shows how the electronic fiscal document numbering and the RFC execution for the creation of the XML file are carried out

Type of Environment Identifies the type of system used by the tax authorities for the response message. The two scenarios are production and homologation (test).

SEFAZ Server Active Shows that the SEFAZ server was active when the tax authorities processed the NF-e

SCAN Server Active Shows that the SCAN server was active when the tax authorities processed the NF-e

Time Stamp Shows the Universal Time Coordinated (UTC) time stamp for the response message from the tax authorities. The processing time and processing date are derived from this time stamp.

Issuing Type Indicates how the NF-e was issued: with or without contingency processing (normal processing)

Contingency Reason Shows the two-character internal code for the contingency reason that you entered in Customizing. For more information, see Customizing for Contingency Processing.

Contingency Description

Shows the descriptive text for the contingency reason that is specified by the tax authorities. The NF-e/CT-e Monitor displays the description in up to four consecutive description fields, corresponding to the four lines of text that can be entered in the contingency reason description in Customizing. For more information, see Customizing for Contingency Processing.

Contingency Date Shows the date when the processing mode was switched to contingency, converted to local date of the issuer of the electronic fiscal document

Contingency Time Shows the time when the processing mode was switched to contingency, converted to local time of the issuer of the electronic fiscal document

Time Zone Shows the time zone of the issuing company’s business place, which was used to convert the contingency date and time to the local date and time of the issuer of the electronic fiscal document

Active Service of Tax Authorities

Shows that the server was active when the tax authorities processed the electronic fiscal document. It can be SEFAZ for regular

Page 55: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 55

Column Meaning authorizations of documents, SCAN or SVC for documents issued under contingency.

Single Document History

When you click on the document number for an electronic fiscal document, the lower table displays selected fields from the upper table, plus descriptions of the document status, system communication status, and the status code (if configured).

Note that the lower list stores the protocol number that was received with each message, while the upper list stores the protocol number that was issued for the initial response.

Event History for Single NF-e

If an icon is displayed in the NF-e Events column for an NF-e, NF-e events have been created for this NF-e. When you click on the icon, the lower table displays the data for all NF-e events that have been created for this NF-e. This data includes the official NF-e event code (which indicates the type of NF-e event) and the status of the NF-e event. You can view the actual text of the NF-e event by clicking on the document icon in the Details column.

Page 56: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 56

Access Key

A 44-digit key that uniquely identifies an electronic fiscal document (such as NF-e or CT-e).

When an electronic fiscal document is posted - incoming or outgoing, created manually by you or automatically by the system - the system generates the access key and displays it in the Nota Fiscal Writer, on the NF-e Data specifically for Nf-e or on the Electronic Doc Data tab for other electronic fiscal documents, such as CT-e.

You can use the access key when you communicate to the tax authorities about a particular electronic fiscal document.

Structure

The access key comprises the following elements:

Region of the document issuer Year of document posting date Month of document posting date CNPJ number of document issuer NF model NF series Nine-digit NF-e number Random number Check digit

The system displays the individual elements of the access key in the corresponding fields in the NF-e/CT-e Monitor. For more information, see Electronic Fiscal Document Data.

Page 57: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 57

User Actions for Individual Documents

The NF-e/CT-e Monitor allows users to carry out the following actions for individual electronic fiscal documents (such as NF-e or CT-e), based on the current status of the electronic fiscal document.

Prerequisites

You have assigned the appropriate authorizations.

Activities

Select a line from the Document Overview table and choose the actions as follows:

In the Fiscal Document menu, choose this entry

When you want to perform this action

Display

Display the document in the Nota Fiscal Writer.

You can also branch to the Nota Fiscal Writer by choosing the Document pushbutton.

Switch to Conting.

Switch an electronic fiscal document posted under normal conditions to contingency processing.

See Contingency Processing of Documents Posted in Normal Mode.

Reverse Contg/CnclPA

Reverse the contingency processing for an electronic fiscal document or the cancellation of an electronic fiscal document prior to authorization. Note the following conditions for using this option:

You can only reverse the contingency processing for a document that you have manually switched to contingency by choosing Switch to Conting.

You can only reverse cancellation prior to authorization if the source document has not been canceled.

The system performs checks to ensure that status-relevant actions have not occurred that prevent reversal. When you reverse contingency or cancellation prior to authorization, the system resets the status of the electronic fiscal document to its previous status.

Request Cancellation

Request authorization from the tax authorities to cancel the electronic fiscal document .

See Document Cancellation.

Request Canc. Again Request cancellation of an electronic fiscal document again, if you received a prior rejection.

Reset NF-e Status Reset the status of an electronic fiscal document that received a rejection or a validation error.

Set Number Set the number for individual fiscal documents.

Assign the Nota Fiscal No. to the electronic fiscal document. For

Page 58: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 58

In the Fiscal Document menu, choose this entry

When you want to perform this action

source documents created Sales and Distribution (SD), the system automatically updates the field Reference of the source document in SD with the 9-digit Nota Fiscal number and Series.

See Customizing Numbering and Sending Documents to the Messaging System.

Send

Send electronic fiscal documents to the tax authorities in the case it has not been sent yet

If the system communication status is not sent (for example, if the connection to the messaging server is down), you need to send it. A typical example is when an electronic fiscal document is posted under central contingency (see Central Contingency Processing).

Resend

Resend an electronic fiscal document.

You can resend an electronic fiscal document request for authorization if all of the following conditions are met:

The system communication status is Sent. The messaging system status is not A(receipt of request

confirmed). The document status is initial (no response from the tax

authorities yet).

Delete Log Entries Delete the log entries for the electronic fiscal document

See Log for Electronic Fiscal Documents.

Cancel Source Doc.

Cancel the source document for an electronic fiscal document after you have received authorization for cancellation from the tax authorities or when you switch an electronic fiscal document to contingency. For more information, see Document Cancellation.

Accept Canc. Reject.

Accept the rejection (by the tax authorities) of a request to cancel or skip an electronic fiscal document

See Document Cancellation.

Cancel Prior to Auth Cancel an electronic fiscal document after sending an authorization request but before receiving the response. For more information, see Document Cancellation.

Page 59: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 59

Document Cancellation

You cancel an electronic fiscal document (such as NF-e or CT-e) in the following cases, for which you need to request authorization from the tax authorities (except as noted):

You want to cancel an electronic fiscal document that has already been authorized by the tax authorities.

You have received the Rejected response from the tax authorities (see step 5b of Requesting Authorization for Documents), and you therefore need to cancel the original electronic fiscal document.

In the case of a rejection, you must cancel the original electronic fiscal document and create another document. The tax authorities refer to this processing as “skipping”, since an NF-e number, which is normally sequential and without gaps, is being skipped.

You have received the Denied response from the tax authorities (see step 5c of Requesting Authorization for Documents), and you therefore need to cancel the original electronic fiscal document.

In the case of a denial, you do not need to request cancellation.

You cancel the normal electronic fiscal document as part of contingency processing for individual electronic fiscal documents (see Contingency Processing of Documents Posted in Normal Mode).

You cancel a contingency electronic fiscal document (either the contingency document that is part of the switching process, or a contingency document that was created under central contingency).

You have sent a request for electronic fiscal document authorization but want to cancel the document before you receive the response. For more information, see the Cancellation Prior to Authorization section in this document.

Activities

Note

For a table overview of the steps involved in canceling an electronic fiscal document and the corresponding statuses set in the NF-e/CT-e Monitor, see Monitor Statuses: Authorization with Subsequent Cancellation and Monitor Statuses: Rejection and Subsequent Skipping.

End of the note.

You request cancellation of the electronic fiscal document in the NF-e/CT-e Monitor (see User Actions for Individual Documents). On the subsequent screen, you must specify a reason for canceling the document.

The tax authorities respond to your request for authorization to cancel (or skip) an document in one of the following ways:

Authorizes your cancellation request

Page 60: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 60

The system tries to cancel both the electronic fiscal document and the source document.

o If both have been cancelled, the system updates the electronic fiscal document status to cancelled and the process step is set to Completed.

o If the electronic fiscal document can be cancelled but the source document cannot be cancelled, the system sets the status of the source document to 2– Cancel source document. You must cancel the source document manually.

Rejects your cancellation request

The system updates the document status as follows:

o System communication status: 6 (Request to Cancel Rejected) or 7 (Request to Skip Rejected)

o Required process step: 4 (Request to cancel rejected; check the reason) or 5 (Request to skip rejected; check the reason)

o Action status: Error; user must trigger next step

In this case, you must explicitly accept the cancellation rejection in the system (see User Actions for Individual Documents). After you do so, the system updates the document status to Completed, with system communication status 8 (Rejection to Cancel/Skip Accepted by User).

If you do not agree with the rejection, contact the tax authorities. (Until you accept the rejection in the system, the electronic fiscal document has an error status and is not complete.)

Note

The following are exceptions for electronic fiscal document cancellation related to contingency cases:

A normal electronic fiscal document that was switched to contingency

You can cancel such an electronic fiscal document in the system directly without having received an authorization from the tax authorities to cancel first.

A contingency NF-e

You can cancel such an NF-e without prior authorization – by canceling the related billing document or material document in the respective transaction. To do this, you must have the 85 activity from the F_NFBA authorization object assigned to you (see Assigning Authorizations for User Actions in NF-e/CT-e Monitor).

End of the note.

Cancellation Prior to Authorization

It is also possible to cancel an NF-e after you request authorization but before you receive the response from the tax authorities. You might do this, for example, because you want to switch processing from the SEFAZ to the SCAN server to speed up authorization. You do so in the NF-e/CT-e Monitor by selecting the NF-e and choosing Fiscal Document Cancel Prior to Auth . For more information, see Checking Document Status.

Page 61: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 61

You can reverse a request for cancellation prior to authorization for an individual NF-e. The reversal is only possible if no status changes that would prevent the reversal have occurred in the meantime. See the relevant menu option in User Actions for Individual Documents.

Page 62: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 62

Contingency Processing of Documents Posted in Normal Mode

You have posted an electronic fiscal document (such as NF-e or CT-e) under normal conditions (non-contingency mode), but you have not received authorization from the tax authorities (for example, the authorities’ server is down), and you cannot send your goods with the required electronic fiscal document. The system enables you to switch such an electronic fiscal document posted under normal conditions to contingency processing, which allows you to print a contingency electronic fiscal document to send with your goods.

The SAP back-end system allows you to switch to contingency processing if you have the appropriate authorization; there is no check for the reason of the switch.

To ensure correct processing, you must follow the procedure described below.

Note

You can also reverse contingency processing for an individual electronic fiscal document that you manually switched to contingency processing. See the relevant menu option in User Actions for Individual Documents. The reversal is only possible if no status changes that would prevent the reversal have occurred in the meantime.

End of the note.

Prerequisites

You can only switch an electronic fiscal document to contingency processing if the request for authorization has not been sent, or it was sent with no response received yet from the tax authorities. You can see this by checking the system communication status of the document in the NF-e/CT-e Monitor; it must have the value blank (not sent) or 0 (sent).

You have also made the required settings for printing configuration.

Process

Note

For a table overview of the steps involved in this process and the corresponding statuses set in the NF-e/CT-e Monitor, see Process Flow for NF-e Switched to Contingency.

End of the note.

1. An electronic fiscal document is created, either automatically or manually. 2. A request for authorization has either been a) not sent or b) sent with no response,

either automatically or manually. 3. You switch the document to contingency processing (see User Actions for Individual

Documents).

The system marks an X in the Switched to Contingency column and updates the system communication status to 5 (processing switched to contingency mode).

Page 63: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 63

4. Depending on the settings you have done in Customizing (see Customizing for Cancellation under Contingency), either you must perform actions or the system will automatically perform them for you:

o You must cancel the source document from the application (for example, the billing document in Sales and Distribution (SD))

The system automatically cancels the corresponding electronic fiscal document.

o You must cancel the standalone electronic fiscal document you created manually in the Nota Fiscal Writer

o The system cancels the source document automatically. This triggers the automatic cancellation of the electronic fiscal document. The system automatically creates a new electronic fiscal document with the same data of the previous one. The source document is then linked to the new electronic fiscal document. Unlike the other the variants above mentioned, the system only cancels the previous electronic fiscal document once the cancellation request is authorized by the tax authorities

5. In case you have not selected the last variation in the step above, you must create a document as follows:

1. A new source document in the application, after which the system automatically generates the corresponding nota fiscal

Note that to process a contingency document as an electronic fiscal document, you must print the electronic fiscal document on security paper.

2. A new electronic fiscal document manually in the Nota Fiscal Writer

Create a new contingency electronic fiscal document as a copy from the electronic fiscal document switched to contingency by selecting the menu

Nota Fiscal Contingency Copy Switched NF-e in the Nota Fiscal Writer and entering the document number to be used as a reference to the new contingency electronic fiscal document.

Note

You can also manually create a standalone electronic fiscal document in the Nota Fiscal Writer. You must then set the Posted Cont. indicator on the NF-e Data tab.

End of the note.

6. In the NF-e/CT-e Monitor, the newly created electronic fiscal document is identified as a contingency electronic fiscal document by an X in the Posted under Contingency column.

7. You check the system communication status of the contingency document in the Monitor. If the status is blank, then you need to send the request for authorization manually (see User Actions for Individual Documents).

8. You print the contingency document from the NF Writer. 9. Depending on the tax authorities’ response to the initial request of the original

electronic fiscal document (from step 2, in the case that a request was sent), which you check in the Monitor, proceed as follows:

0. If the tax authorities send the response Authorized or Rejected, then you must request cancellation or skipping of the original electronic fiscal document (see User Actions for Individual Documents) Alternatively, you can configure the system to automatically send the cancellation request to the tax authorities. See Cancellation under Contingency..

Page 64: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 64

If the tax authorities approve the cancellation request, then you do not need to take any further action. Note that for the process to be completed, the system communication status must be either 2 (Authorized & Cancellation Authorized) or 4 (Rejected & Skipping (Cancel) Authorized), and an X must be entered in the Canceled column (from step 4).

1. If the tax authorities send the response Denied, then you do not need to request cancellation of the original electronic fiscal document. All that is required is to cancel the source document or standalone electronic fiscal document, which you already did in step 4.

If no initial request for authorization was made to the tax authorities, either automatically or manually, then you do not have to wait for the response from the tax authorities as described in 9 1-2 above. In this case, you directly request cancellation from the tax authorities. When they authorize this cancellation, they call it “skipping”, since an NF-e number, which is normally sequential and without gaps, is being skipped. But from the SAP side, you cancel the electronic fiscal document, as described in step 4 above.

Result

You can continue your business process for an individual electronic fiscal document by switching it to contingency processing.

Page 65: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 65

Central Contingency Processing

You can activate central contingency if you need to print and send electronic fiscal documents (such as NF-e or CT-e) without waiting for authorization from the tax authorities.

After you activate contingency for your entire business place or region, all electronic fiscal documents are processed in contingency mode – both those generated automatically by the system from the corresponding application and those you create manually in the Nota Fiscal Writer.

The system checks and considers the contingency settings at the moment that a document is numbered. For more information about the numbering of documents, seeCustomizing for Numbering and Sending of NF-e to the Messaging System.

The system allows you to activate central contingency processing if you have the appropriate authorization; there is no check for the reason of the activation.

Prerequisites

You have been assigned the appropriate authorizations. The required settings for printing configuration have been made.

Process

1. You set a region or business place to contingency in the Monitor (J1BNFE transaction). For more information, see:

o Activate contingency processing for region o Activate contingency processing for business place

2. When a document is posted (automatically or manually), the system indicates that the document was processed under contingency by marking the Posted under Contingency column in the Monitor.

3. You can print the contingency document prior to the authorization from the tax authorities.

4. You send the document to the tax authorities (see User Actions for Individual Documents).

Note

For a table overview of the steps involved in this process and the corresponding statuses set in the Monitor, see Process Flow for NF-e Posted under Contingency.

End of the note.

Result

The system continues to post the electronic fiscal documents under central contingency until you deactivate the settings as follows:

Manually for the region Manually or automatically for the business place depending on your activation

settings

Page 66: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 66

Activating Contingency Processing for Regions

You can activate central contingency if you need to print and send electronic fiscal documents without waiting for authorization from the tax authorities. It is possible to activate contingency processing for a region so that all electronic fiscal documents issued for processes within that region are processed under contingency.

Procedure

1. On the output screen of the Monitor (J1BNFE transaction), choose Contingency Contingency: Region .

2. In the Contingency per Region Customizing view, enter BR and select the relevant region.

3. Enter the model of the electronic fiscal document: o (blank): Settings are valid for all possible models of electronic fiscal

documents issued in this region o 55: Settings are valid for NF-e only o 57: Settings are valid for CT-e only

4. Enter the reason for posting under contingency. 5. Make settings for other regions as needed and then save your settings.

More Information

It is also possible to activate contingency centrally for a business place. For more information, see Activating Contingency Processing for Business Places.

Page 67: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 67

Activating Contingency Processing for Business Places

You can activate central contingency if you need to print and send electronic fiscal documents without waiting for authorization from the tax authorities. It is possible to activate contingency processing for a business place so that all electronic fiscal documents issued for processes within that business place are processed under contingency.

Procedure

1. On the output screen of the Monitor (J1BNFE transaction), choose Contingency Contingency: Bus.Pl .

2. In the Contingency for Business Places Customizing view, enter BR as the country. Select the company code and relevant business place.

3. Enter the model of the electronic fiscal document: o (blank): Settings are valid for all possible models of electronic fiscal

documents issued from this business place o 55: Settings are valid for NF-e only o 57: Settings are valid for CT-e only

4. Select one of the following check boxes and, if needed, make the follow-on settings: o Select MS Down (Contingency (Manual/Messaging System Down)) if there is

a problem with the communication between your SAP ERP system and your messaging system.

You can set this indicator manually at any time. If you want your SAP ERP system to set the MS Down indicator automatically when the connection to the messaging system is down, select Act. Cont. Aut. (Activate Contingency Automatically).

The Deact. Cont. ( Deactivate Contingency Manually) indicator controls how processing is switched from contingency to normal processing when your messaging system is back up. If you want to manually control the switch back to normal processing, you select Deact. Cont.. If you want your SAP ERP system to automatically deactivate contingency as soon as the messaging system becomes available again, do not select Deact. Cont..

o Select AS Down (Contingency (Authorities’ Server Down)) if you identify a problem with the tax authorities’ server

Note that you have to manually deselect this indicator; your SAP ERP system cannot select or deselect this indicator automatically.

It is possible to configure your messaging system to automatically react to the selection of the AS Down indicator in this Customizing view, that is, if AS Down is selected for this business place, your messaging system automatically activates contingency when the tax authorities’ system is down. For more information about these settings, (see Messaging-System Control).

5. Enter the reason for posting under contingency. 6. Make settings for other business places as needed and then save your settings.

Page 68: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 68

More Information

It is also possible to activate contingency centrally for a region. For more information, see Activating Contingency Processing for Regions.

Page 69: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 69

Electronic Fiscal Document Processing with Contingency Server

When there are technical problems with the SEFAZ server in your region (state) and the government activates a contingency server, you can send your electronic fiscal documents for authorization to one of the active servers (SCAN or SVC). The server determination is done automatically by the messaging system.

Process

The following figure illustrates how your SAP ERP system and your messaging system interact with government servers when there is a switch between SEFAZ and SCAN or SVC.

Process Flow for SCAN

1. A processor triggers the creation of an outgoing NF-e, either automatically through the NF-e integration with Materials Management or Logistics Execution or manually using the NF-e Writer.

2. The messaging system checks periodically which server is currently available, either SEFAZ or SCAN. When the authorization request reaches the messaging system, it informs SAP ERP which server is available.

3. Based on server availability, the SAP ERP system numbers the NF-e. If the SCAN server is available, an NF-e number is assigned that contains a series number from the number range 900-999.

4. SAP ERP system assigns the ‚issuing type‘ (which is part of the access key) according to the contingency server: 3 – SCAN, 7 or 8 SVC.

5. The SAP ERP system passes the information about the NF-e number and ‚issuing type‘ to the messaging system, which then sends the authorization request to the tax authorities.

6. The tax authorities authorize the NF-e and return the information to the messaging system. If the tax authorities reject or deny the NF-e, the process follows the process flow described in other parts of the documentation. See More Information.

7. The SAP ERP system updates the document status of the NF-e in the NF-e/CT-e Monitor. The following values are displayed in the NF-e/CT-e Monitor:

NF-e: Required Action Step

NF-e Document Status

SEFAZ Server Active

SCAN Server Active

C – Completed 1 – Authorized <blank> X

The figure below illustrates the above mentioned process for SCAN.

Page 70: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 70

Process Flow for SCAN

Process Flow for SVC

The SVC server is currently only used for CT-e authorization in contingency. The process flow for SVC is similar to one for SCAN, only that the step 4 is not necessary for CT-e.

Result

The processor prints the DANFE (NF-e) or DACTE (CT-e) on A4 paper and sends it with the goods.

Print DANFE on A4 Paper

SAP ERP Backend System

Messaging System Tax Authorities

Check Server Availability

Send Request to Authorities Authorize NF-e

SCANSEFAZ

SCAN Serv er AvailableNum ber NF-e

Update NF-e Status

Update NF-e Status in NF-e

Monitor

Trigger Creation of

NF-e

Processor

Send Authorization

Request

Page 71: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 71

Statuses in NF-e/CT-e Monitor

In this section, you find an overview of the statuses displayed in the NF-e/CT-e Monitor during the communication flow for the following processes:

Document authorization Cancellation of authorized documents Authorization process with rejection and subsequent skipping Authorization process with validation error Document switched to contingency Document posted under contingency Cancellation prior to authorization

These process descriptions begin with the creation of an electronic fiscal document, which is then numbered and sent to the tax authorities in the NF-e/CT-e Monitor.

In the following documents, the relevant columns in the Monitor are shown in tables and abbreviated as follows:

Column in NF-e/CT-e Monitor Abbreviated Column Name in Documentation Required Action Step ACTION Document Status DOC STA System Communication Status SCS Messaging System Status MSS Switched to Contingency Swt. C. Posted under Contingency Post C. Canceled Can. Cancel Prior to Authorization Cncl Prior

For more information on the NF-e/CT-e Monitor status fields, see Electronic Fiscal Document Data.

Page 72: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 72

Monitor Statuses: Document Authorization

The following table shows the possible steps involved in sending an electronic fiscal document (such as NF-e or CT-e) for authorization and subsequently canceling the authorized document. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF-e or CT–e) , for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Document sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

Tax authorities authorize request. C – COMPLETED 1 0 A

At this point the authorization process is complete; you can print the DANFE/DACTE and send it with the goods .

Page 73: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 73

Monitor Statuses: Authorization with Subsequent Cancellation

The following table shows the possible steps involved in sending an electronic fiscal document (such as NF–e or CT–e) for authorization and subsequently canceling the authorized document. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF–e or CT–e), for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Document sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

Tax authorities authorize request. C – COMPLETED 1 0 A

You send cancellation request. “ “ – IN PROCESS 1 1 A

Messaging system confirms receipt. “ “– IN PROCESS 1 1 B

Tax authorities authorize cancellation; cancellation is performed automatically.

C – COMPLETED 1 2 B

X

Rejected Cancellation Request

If the tax authorities reject the request to cancel, the NF-e/CT-e Monitor shows the following statuses:

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

Tax authorities reject cancellation request.

4 – Request to cancel rejected; check the reason

1 6 B

You can best determine the cause of the rejection by checking the status code sent back by the government. You can then accept the rejection if you agree with it and no longer intend to cancel the electronic fiscal document:

Step ACTION DOC STA SCS MSS Swt.C Post.C Can. You accept rejection. C – COMPLETED 0 8 A

Alternatively, you analyze the rejection reason and send a cancellation request again:

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You send cancellation request again. “ “ – IN PROCESS 1 1 B

Page 74: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 74

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

Tax authorities authorize cancellation; cancellation is performed automatically.

C – COMPLETED

1 2 B

X

Page 75: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 75

Monitor Statuses: Rejection and Subsequent Skipping

The following table shows the possible steps involved in sending an electronic fiscal document for authorization and skipping the NF-e number after the electronic fiscal doucment is rejected by the tax authorities. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF-e/CT-e), for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Document sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

Tax authorities reject request.

1 – Document contains errors; cancel document and post corrected document or reset document and send the corrected version

2 0 A

You send skipping request. “ “ – IN PROCESS 2 3 A

Messaging system confirms receipt. “ “ – IN PROCESS 2 3 C

Tax authorities authorize skipping; cancellation is performed automatically.

C – COMPLETED 2 4 C

X

Alternatively, if you can correct the error in the electronic fiscal document you can reset and resend it. This process is as follows:

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF-e/CT-e), for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Document sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

Tax authorities reject request.

1 – NF-e contains errors; cancel NF-e and post

2 0 A

Page 76: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 76

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

corrected NF-e or reset NF-e and send the corrected version

You reset document Document sent to

messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

Tax authorities authorize request. C – COMPLETED 1 0 A

Page 77: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 77

Monitor Statuses: Authorization with Validation Error

The following table shows the steps involved in skipping the number of an electronic fiscal document (such as NF-e or CT–e) after a validation error from the messaging system. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF-e/CT-e), for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Messaging system runs the validation tool and finds error.

8 -Internal validation error in messaging system. Send again!

0 V

You send skipping request. “ “ – IN PROCESS

9 V Messaging system confirms

receipt. “ “ – IN PROCESS

9 C

Tax authorities authorize skipping; cancellation is performed automatically.

C – COMPLETED

A C

X

If the validation error can be corrected, you can reset the electronic fiscal document:

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF-e/CT-e), for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Messaging system runs the validation tool and finds error.

8 -Internal validation error in messaging system. Send again!

0 V

You reset document. 3 -Send NF-e to the Tax Authorities

Document sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

Tax authorities authorize request. C – COMPLETED 1 0 A

Page 78: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 78

Monitor Statuses: Document Switched to Contingency

The following tables show the possible steps involved in switching an electronic fiscal document (NF-e or CT-e) to contingency. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You create an electronic fiscal document (NF-e/CT-e), for example, in NF Writer.

9 – Set NF-e number and send to tax authorities

Document sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

You can switch a normal electronic fiscal document to contingency-processing mode at any time, as long as the tax authorities have not responded to the initial request for authorization.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You switch the electronic fiscal document processing to contingency.

2 – Cancel Source Document

5 or 6

A X

You cancel the document by choosing Fiscal Document Cancel Source

Document or use the corresponding transaction in the application (for example, the billing document in Sales and Distribution (SD))

“ “ – IN PROCESS

5 A X

X

If you have defined in Customizing that the system creates a new electronic fiscal document automatically, the system sets 6 instead of 5 in the system communication status column (SCS). For more information, see Customizing for Cancellation under Contingency.

Even though the process for the electronic fiscal document switched to contingency still needs to be completed, you can post a new electronic fiscal document, which is then a contingency document, to continue the business process without authorization from the tax authorities. The next steps are as follows:

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

Tax authorities authorize document

7 – Send request to the tax authorities to cancel/skip document

1 5 A X

X

You send cancellation request. “ “ – IN PROCESS 1 1 A X

X

Messaging system “ “ – IN PROCESS 1 1 B X

X

Page 79: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 79

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

confirms receipt. Tax authorities authorize cancellation; no automatic cancellation.

C – COMPLETED 1 2 B X

X

Page 80: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 80

Monitor Statuses: Document Posted under Contingency

The following table shows the possible steps involved in posting an electronic fiscal document (NF-e or CT-e) under contingency. An electronic fiscal document posted under contingency can refer to either an electronic fiscal document posted under central contingency or an electronic fiscal document that is posted after you switch from normal processing to contingency processing. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can.

You issue electronic fiscal document under contingency.

This contingency document can be printed immediately on security paper without authorization from the tax authorities.

3 – Send NF-e to the tax authorities

X

Document sent to messaging system. “ “ – IN PROCESS

0

X

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

X

Tax authorities authorize request. C – COMPLETED 1 0 A

X

Note

You can cancel a contingency electronic fiscal document without prior authorization from the tax authorities. However, you must send the request to cancel immediately thereafter.

End of the note.

Page 81: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 81

Monitor Statuses: Cancellation Prior to Authorization

The following table shows the possible steps involved in canceling an NF-e before it is authorized by the tax authorities. This cancellation can take place after the NF-e is sent for authorization or when it is has been numbered but the authorization request has not been sent because of a validation error. For a legend explaining the columns in this table, see Statuses in NF-e/CT-e Monitor.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can. Cncl

Prior

You create NF-e, for example, in NF Writer.

9 – Set NF-e number and send to tax authorities.

NF-e sent to messaging system. “ “ – IN PROCESS

0

Messaging system confirms receipt. “ “ – IN PROCESS

0 A

You cancel the NF-e before authorization is received; no automatic cancellation of source document.

2 – Cancel Source Documents

5 A

X

You cancel source document. “ “ – IN PROCESS

5 A

X X

Tax authorities authorize NF-e.

7 – Request Author. To cancel/skip

1 5 A

X X

You request authorization of cancellation from tax authorities.

“ “– IN PROCESS 1 1 B

X X

Tax authorities authorize request. C – COMPLETED 1 2 B

X X

The following table shows the steps involved in canceling an NF-e that has been numbered but not sent for authorization. This means the NF-e was either rejected or received a validation error.

Step ACTION DOC STA SCS MSS Swt.C Post.C Can. Cncl

Prior You reset NF-e. 3 – Send NF-e

You cancel the NF-e before authorization is received; no automatic cancellation of source document.

2 – Cancel Source Documents

5

X

You cancel the source document.

“ “ – IN PROCESS

5

X X

You send the authorization request for the NF-e. “ “– IN PROCESS

0 A

X X

Tax authorities authorize NF- 7 – Request 1 0 A

X X

Page 82: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 82

Step ACTION DOC STA SCS MSS Swt.C Post.C Can. Cncl

Prior e. Author. To

cancel/skip You request authorization of cancellation from tax authorities.

“ “– IN PROCESS 1 1 B

X X

Tax authorities authorize request. C – COMPLETED 1 2 B

X X

Page 83: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 83

Incoming Electronic Notas Fiscais

When your goods are delivered, you must check the validity of the accompanying NF-e before you accept the goods. After you verify that the incoming NF-e is valid, you need to enter the following in the system:

Protocol number Random number Check digit Issuing type, if needed

The system supports the following incoming NF-e cases:

Logistics Invoice Verification (MM-LIV)

For a normal NF-e, you receive the printed, authorized NF-e, called a DANFE. Enter the NF-e data as described under Activities below.

For a contingency NF-e, the authorization is not yet available when the goods arrive. You later check the government system for the protocol number, and enter it as described below. For a contingency NF-e, note also that you must keep the incoming NF-e printed on security paper, as opposed to the DANFE for the normal, non-contingency NF-e, which you do not need to keep.

Sales and Distribution (SD) for the return process (sales order type REB)

In this case, you have issued the NF-e and sent it with the goods. Your customer accepts the goods and posts the NF-e in its system, but later returns the goods. Your customer generates a return NF-e, which is subject to authorization from the tax authorities. You enter the protocol number and random number of the return NF-e in the Nota Fiscal Writer as described below.

Note

You can use SAP BusinessObjects Nota Fiscal Eletrônica (starting with version 10.0) to automate the processing of incoming NF-e from your business partners – NF-e receipt, signature validation, and authorization check, to invoice creation in the back-end system. You can access this new capability through the NF-e Fiscal Workplace and the NF-e Logistics Workplace. You can find incoming NF-e, including NF-e and NF-e cancellation notices from suppliers, in these workplaces, where you can manually or automatically create and post documents in SAP ERP according to your business process.

For more information about the features of incoming NF-e automation in SAP BusinessObjects Nota Fiscal Eletrônica, see http://help.sap.com/grc SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

End of the note.

Page 84: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 84

Activities

You compare the protocol number printed on the NF-e with the protocol number/authorization code of the NF-e stored on the authorities’ server.

In the SAP system, enter the NF-e following the standard procedure (see Entering Invoices and Returns). The system automatically sets the document status for the incoming NF-e as 1 (Authorized).

Afterwards enter the protocol number and random number manually in the Nota Fiscal Writer, on the NF-e Data tab, in the corresponding fields (the system automatically derives all other NF-e data from the NF-e posting). Until you complete this step, the NF-e Monitor displays required process step 6, Enter protocol number, for the NF-e, and processing is incomplete.

Page 85: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 85

Changing Posting Date for Manually-Created Incoming NF-e

Your company received goods from abroad. They need to be transported by land to your plant, but they cannot be transported without a nota fiscal. Because the goods come from a foreigner company, your company must issue an incoming electronic nota fiscal (NF-e) to accompany the goods to your plant.

You manually create an NF-e in the Nota Fiscal Writer and estimate a date for the arrival of the goods at your plant. Once the goods actually arrive at the plant, you may need to change the posting date of the incoming NF-e after the posting period has closed.

Once you execute the Change Nota Fiscal transaction (J1B2N), the system calls the Nota Fiscal System - Check posting period in case of cancel (J_1B_NF_CANCEL_CHECK_PERIOD) function module to check the posting period. If the period is closed, the system will not allow you to change the posting date in the NF-e.

You can change the behavior of the function module to be able to change the posting date in the Change Nota Fiscal transaction.

Activities

In Customizing for Cross-Application Components, choose General Application Functions Nota Fiscal Electronic Notas Fiscais BAdI: Check Period of Notas Fiscais , and

create an implementation for the Set Flag to Check the Period method.

Page 86: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 86

User Decision in Creation of Incoming NF in Mixed Scenarios

If your company handles scenarios with mixed nota fiscal (NF) types, you can allow users who enter the incoming NF to determine whether to post a conventional NF or an electronic nota fiscal (NF-e).

Example

Your company sends goods with an NF-e. Your customer needs to return the goods and sends a conventional NF. You enter the incoming NF from your customer in your system with reference to your NF-e. The system identifies the different types of NFs and creates references between them.

End of the example.

Prerequisites

You have made the settings as described in Customizing NF Type Determination for Mixed Scenarios to enable user decision.

Activities

When you enter the incoming NF following the standard procedure for the relevant goods movement transaction that is involved (such as return or third-party process), the system prompts you to specify conventional NF or NF-e. This dialog box appears after you choose the Nota Fiscal pushbutton.

Page 87: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 87

Reports

The NF-e/CT-e Monitor provides several features that enable you to monitor the numbering of electronic fiscal documents (such as NF-e or CT-e) and ensure that no gaps occur. The nine-digit electronic nota fiscal numbers included in access keys must be assigned to electronic fiscal documents sequentially and without gaps. A gap can occur in document number ranges when the system uses a number from a number range for NF-e numbers but no actual electronic fiscal document is created. If such a gap occurs, you must send a skipping request for the missing NF-e numbers to the tax authorities.

The following reporting functions are available from the NF-e/CT-e Monitor in the Goto menu:

Gap Monitor: You can use the Numbering Gaps Monitor report to see the gaps in the number ranges for a particular company code within a date range that you determine. You can further limit the search by business place and form.

Gap Report: You can use the Check Number Range Gaps report to identify gaps in numbering ranges (test mode) and send skipping requests to the tax authorities (productive mode). For more information, see Check NF-e Number Range Gaps (Gap Report).

Last Checked Number Customizing view. Here you can enter the initial number for each number range that the Gap Monitor and Gap Report should use to start checking for gaps during a report run.

Page 88: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 88

Check Number Range Gaps (Gap Report)

You can use this report to identify gaps in NF-e/CT-e numbering ranges and send skipping requests for the missing numbers to the tax authorities.

Prerequisites

You have assigned the number range defined for an NF number group to the correct business place (see Maintaining Number Ranges).

Note

We recommend that the assignment of the number range group to the respective business place is unique. This means that the same number range group should not be assigned to more than one business place. This enables the system to identify which business place generated a particular number, which must be included in the skipping request to the tax authorities.

End of the note.

Activities

1. Access this report, in the NF-e/CT-e Monitor, by choosing Goto Gap Report . 2. On the Check Number Range Gaps screen, enter the required selection criteria:

company code, business place, NF model, and reason for skipping the number. 3. Before you send the skipping request to the tax authorities, you can run the report in

test mode.

To make a test, you can manually change the last checked number in the Maintain Last Checked Number for Fiscal Document Number Range Customizing activity. To access the view, choose Goto Last Checked Number . Enter the last checked number. Run this report in test mode.

Note

After a test, ensure that you reset the correct last checked number before doing a productive run of the report.

End of the note.

4. To locate the gaps and send the actual skipping requests for the gaps to the tax authorities, select the Execute RFC checkbox and specify the type of RFC communication.

5. Execute the report.

After a productive run of this report, the tax authorities send a response for the skipping requests. To view their response, run this report again. Alternatively, you can use the Numbering Gaps Monitor report ( Goto Gap Monitor ). The response from the tax authorities is displayed as the document status for the skipped document numbers.

Page 89: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 89

NF-e Events

An NF-e event is an action that is related to an electronic nota fiscal (NF-e).

Such actions include authorization, denial, cancellation, and so on. SEFAZ defines what the actions are and who the NF-e event author and recipient are. In Portuguese, this is known as evento.

SEFAZ has identified a wide range of NF-e events, but only some are tracked by the government. These include, for example, the following:

NF-e authorization Denial of NF-e authorization NF-e cancellation Electronic correction letter (CC-e) for an NF-e. For more information about CC-e, see

Electronic Correction Letter (CC-e).

Your SAP ERP system allows you to create and process NF-e events in the NF-e Monitor and track the history of NF-e and their corresponding NF-e events.

Integration

You enable communication between the tax authority systems and your SAP ERP system about NF-e events with a messaging system. You can choose your own messaging system or an SAP product: SAP BusinessObjects Nota Fiscal Eletrônica. SAP BusinessObjects Nota Fiscal Eletrônica can be integrated into your existing system landscape, so that your SAP ERP system provides the data required by the authorities and SAP BusinessObjects Nota Fiscal Eletrônica communicates with the authorities and your customers and suppliers.

For more information about SAP BusinessObjects Nota Fiscal Eletrônica, see http://help.sap.com/grc Nota Fiscal Eletrônica SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

Page 90: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 90

Customizing for NF-e Events

To allow you to create and process NF-e events, such as electronic correction letters (CC-e) or NF-e cancellation, you must record and map the following two kinds of NF-e event codes in Customizing:

The official NF-e event code that is assigned to this NF-e event by SEFAZ The internal NF-e event code that is used for backend processing in your SAP ERP

system

Activities

You make the following settings:

1. In the Enter Official NF-e Event Codes and Map to Internal Codes Customizing activity, you record the official NF-e event code from SEFAZ, enter a descriptive text for the event, and then map it to the respective internal NF-e event code that is delivered with your SAP ERP system. This Customizing activity is found in Customizing for Cross-Application Components under General Application Functions Nota Fiscal Electronic Fiscal Documents NF-e Specifics NF-e Events .

2. In the Group Internal NF-e Event Codes Customizing activity, you create NF-e event groups and assign the internal NF-e event codes of those NF-e events that should be processed by a business place in the same way. This Customizing activity is found in Customizing for Cross-Application Components under General Application Functions Nota Fiscal Electronic Fiscal Documents NF-e Specifics NF-e Events .

3. In the Define Business Places Customizing activity, you assign the corresponding NF-e event group to the relevant business places. This Customizing activity is found in Customizing for Cross-Application Components under General Application Functions Nota Fiscal CNPJ Business Places .

Page 91: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 91

Interfaces for NF-e Events

To communicate with the tax authorities about electronic correction letters (CC-e), you use the following function modules to establish the communication between your SAP ERP system and your messaging system:

Outbound messages o For NF-e events, the system uses the RFC call to the messaging system for

event (J_1BNFE_EVENT_OUT) function module. For more information, see Interface for Outbound NF-e Event Messages

o For electronic correction letters (CC-e) the system uses the RFC call to the messaging system for CCe (J_1BNFE_CCE_OUT) function module.

For more information, see Interface for Outbound CC-e Messages.

Inbound messages o Event Update From Messaging System (J_1BNFE_EVENT_IN) for inbound

messages. For more information, see Interface for Inbound CC-e Messages.

Note

If you use SAP BusinessObjects Nota Fiscal Eletrônica as your messaging solution and have enabled the communication between this solution and your SAP ERP system, no further action is needed for supporting NF-e events.

For more information about SAP BusinessObjects Nota Fiscal Eletrônica, see http://help.sap.com/grc Nota Fiscal Eletrônica SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

End of the note.

Page 92: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 92

Interface for Outbound NF-e Event Messages

Your SAP ERP system asynchronously sends event messages using the outbound interface RFC call to the messaging system for event (J_1BNFE_EVENT_OUT) function module. This interface provides the data required by the tax authorities for registering and processing events issued for NF-e. The interface to the messaging system comprises the following parameters:

IV_NFE_ACCESS_KEY – NF-e: 44-digit access key IV_EVENT_TYPE – Official NF-e event code IV_INTERNAL_SEQUENCE_NUMBER – Event sequence number that is used

internally in your SAP ERP system IV_TIMESTAMP – NF-e event: Timestamp of creation

(YYYYMMDDhhmmssmmmuuun)

IV_TIMEZONE – Time zone of the issuing business place IV_TEXT –Text related to the event, for instance, cancellation reasons IV_RESEND – Flag that is used for resending in the messaging system after RFC

communication fails during the previous call. This is an optional parameter.

Page 93: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 93

Interface for Outbound CC-e Messages

Your SAP ERP system asynchronously sends electronic correction letters (CC-e) using the outbound interface RFC call to the messaging system for CCe (J_1BNFE_CCE_OUT) function module. This interface provides the data required by the tax authorities for registering and processing CC-e issued for NF-e. The interface to the messaging system comprises the following parameters:

IV_NFE_ACCESS_KEY – NF-e: 44-digit access key IV_EVENT_TYPE – Official NF-e event code IV_INTERNAL_SEQUENCE_NUMBER – Event sequence number that is used internally

in your SAP ERP system IV_TIMESTAMP – NF-e event: Timestamp of creation

(YYYYMMDDhhmmssmmmuuun) IV_TIMEZONE – Time zone of the issuing business place IV_CONTENT – Content of the CC-e as a text string IV_RESEND – Flag that is used for resending in the messaging system after RFC

communication fails during the previous call. This is an optional parameter.

Page 94: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 94

Interface for Inbound NF-e Event Messages

Your SAP ERP system can receive messages about NF-e events using the inbound interface of the Event Update From Messaging System (J_1BNFE_EVENT_IN) function module. This interface is used for batch processing of NF-e events.

The IT_EVENTS interface table contains single NF-e events. The interface structure comprises the following fields to be filled:

DOCNUM – NF-e document number that is used in your SAP ERP system EXT_EVENT – Official NF-e event code SEQNUM – Internal sequence number for the NF-e event, which is used in your SAP

ERP system EXT_SEQNUM – Official sequence number for the NF-e event. This is the sequence

number for the NF-e event that is used by the tax authorities. This number is populated by the messaging system and should increase by one for an NF-e event if the previous one has been authorized.

ACCKEY – 44-digit access key for the NF-e AUTHCODE – Protocol number of the NF-e event REPLY_TMPL – Timestamp of reply to authorization request for NF-e in UTC. The

format is as follows: YYYYMMDDhhmmssmmmuuun. CODE – Status code that is related to the NF-e event MSGTYP – Type of inbound message EXT_REPLY_TMPL : timestamp of the reply of the tax authorities to the event in the

local time of the tax authorities.

Your SAP ERP system requires a unique code that identifies the type of inbound message. These codes are defined in the backend. The inbound interfaces can process any of the following message types for NF-e events:

Message Type Description 1 Authorization 2 Rejection

The CT_BAPIRET2 interface table contains the BAPI return information (type BAPIRETTAB) from your SAP ERP system.

More Information

For more information that is not specific to NF-e events, see Interfaces for Inbound Messages.

Page 95: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 95

Event: Electronic Correction Letters (CC-e)

An electronic correction letter (CC-e) is an NF-e event that informs the government and NF-e recipients about incorrect information contained in an NF-e already authorized by the government.

The event author for an electronic correction letter is the NF-e issuer. In Portuguese, this NF-e event is known as Carta de Correção eletrônica.

To enable the processing of CC-e in your SAP ERP system, you must make certain settings in the Customizing for electronic notas fiscais (NF-e). For more information, see Customizing for NF-e Events(CC-e).

You use the NF-e Monitor to create, change and send CC-e for authorization. You can also track the statuses of CC-e in the NF-e/CT-e Monitor.

Page 96: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 96

Process Flow for Electronic Corrections Letters (CC-e)

An electronic correction letter (CC-e) issued to inform the tax authorities of changes to the information in an already authorized electronic nota fiscal (NF-e). This process up the response from the tax authorities is shown in the following figure and explained in more detail in the following documentation:

Creating and Sending a CC-e for Authorization

Process

1. A processor creates and sends a CC-e for an authorized NF-e on the NF-e Monitor screen. For more information, see Creating Electronic Correction Letters (CC-e).

2. Your SAP ERP system sends an authorization request to the messaging system. The system assigns 1 as the internal sequence number.

One of the following error messages may be returned from the messaging system:

o V: The CC-e did not pass the validation checks of the messaging system. You must fix the error and resend the CC-e.

o R: The messaging system is unavailable. You must resend the CC-e later. o G: This message cannot be fixed by the processor in the SAP ERP system. It

must be fixed in the messaging system before the process can continue.

I

3. The messaging system sends the authorization request to the tax authorities.

SAP ERP System

Messaging System Tax Authorities

Validation Check of CC-e

Authorize Request

Check Request

OKError

Send Authorization Request

Update CC-e Status

Reject

Create and Send CC-e

Fix Data

Send Response

ErrorOK

Deny

Resend CC-e

Send CC-e

Processor

Update CC-e Status in NF-e

Monitor

Error = RError = V

Resend CC-e

Page 97: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 97

4. The tax authorities respond to the authorization request in one of the following ways: o Authorize the CC-e o Reject the authorization request for the CC-e

5. The messaging system passes the response to your SAP ERP system. 6. Your SAP ERP system updates the status of the CC-e on the NF-e Monitor.

The following figure shows how you can react to these different responses and is explained in more detail in the following documentation.

After Initial Response from Tax Authorities

Authorization

Your messaging system increases the official NF-e event sequence number to 1 and passes this to your SAP ERP system. On the NF-e Monitor, the status of the CC-e is displayed as Authorized in the NF-e event history for the NF-e. The process for this CC-e is complete. If needed, you can create new CC-e for this NF-e later.

Rejection

Your SAP ERP system displays the relevant status for the CC-e in the NF-e event history for the NF-e on the NF-e Monitor. If possible, the processor makes the necessary changes and resends the CC-e for authorization. The messaging system sends the CC-e to the tax authorities and returns their response to your SAP ERP system. The updated response is displayed on the NF-e Monitor.

SAP ERP System

Messaging System Tax Authorities

Check RequestSend Authorization Request

Update CC-e Status Send Response

Processor

Check Status in NF-e Monitor

RejectedAuthorized

Update CC-e Status

Error fixed

Resend CC-e Resend CC-e

View Updated CC-e Status in NF-e Monitor

Error cannot be fixed

Page 98: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 98

Creating Electronic Correction Letters (CC-e) Procedure

1. Open the NF-e/CT-e Monitor using the J1BNFE transaction. 2. Select the NF-e that you want to change in the Monitor. 3. Choose NF-e Events CC-e Create . 4. Enter the text for the CC-e. The tax authorities have set a minimum limit of 15

characters and a maximum of 1000 characters. If you enter a longer text, the SAP ERP system cuts the text at the limit.

5. Send the CC-e to the tax authorities for authorization.

Result

After you create the CC-e, the system displays an icon in the NF-e Events column for this NF-e. By clicking on the icon, you can display the events for this NF-e. The history shows the communication regarding all NF-e events for this NF-e between your SAP ERP system and the messaging system and the tax authorities.

Page 99: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 99

Event: NF-e Cancellation

The cancellation is an NF-e event that informs the government and the NF-e recipients about the cancellation of an NF-e already authorized by the government.

To enable the processing of NF-e cancellation as an event in your SAP ERP system, you must make certain settings in the Customizing for NF-e Events. For more information, see Customizing for NF-e Events

You use the NF-e/CT-e Monitor to create and send NF-e cancellation for authorization. You can also track the statuses in the Monitor.

Page 100: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 100

Creating NF-e Cancellation Event Procedure

1. Open the NF-e/CT–e Monitor using the J1BNFE transaction. 2. Select the electronic fiscal document that you want to cancel in the Monitor and

request cancellation for it. 3. On the subsequent screen, specify a reason for canceling the electronic fiscal

document and send the request to the tax authorities for authorization.

Result

After you trigger the request for cancellation, the system displays an icon in the NF-e Events column for this electronic fiscal document. By clicking on the icon, you can display the events for this document. The list shows the communication regarding all NF-e events for this document between your SAP ERP system and the messaging system and the tax authorities.

If the tax authorities authorize your request to cancel the electronic fiscal document, the system cancels the source document (and automatically cancels the corresponding electronic fiscal document) or the standalone electronic fiscal document created in the Nota Fiscal Writer.

It is unlikely that the tax authorities would reject your request to cancel the electronic fiscal document, but if this does occur, or if there is an error from the messaging system, you can repeat your skipping request.

Page 101: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 101

Archiving NF-Event Data

When you archive notas fiscais using the J_1BNF archiving object, you also archive the data for the corresponding NF-e events. This NF-e event data is stored in the following tables:

J_1BNFE_EVENT: Table for storing data that is common to all NF-e event types

J_1BNFE_CCE: Table for storing data that is specific to electronic correction letters (CC-e)

Procedure

1. You archive notas fiscais by choosing, from the SAP Easy Access screen, Tools Administration Administration Data Archiving .

2. Enter J_1BNF as the object name.

More Information

For more information about archiving notas fiscais, see Archiving Notas Fiscais.

Page 102: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 102

Conhecimento de Transporte Eletrônico (CT-e)

The conhecimento de transporte eletrônico (CT-e) is an electronic invoice for billing freight costs and their associated taxes. Like the electronic nota fiscal (NF-e), a CT-e needs to first be authorized by the tax authorities before it can be used for shipment. It has also a printed version called the DACTE, which has to accompany the shipment. In your SAP ERP system, you can create and process outgoing CT-e in the required business processes and send the XML direct to the tax authorities for authorization.

The processing of CT-e is similar to that for NF-e in the numbering, the statuses, authorization, and contingency processes. The CT-e differs from the NF-e in the following ways:

Model: The NF-e has 55 as the model. The CT-e has 57 as the model. In Customizing, the model plays an important role in determining which settings are used for NF-e and which are for CT-e. You can also use the model to filter the type of electronic fiscal document that is displayed in the NF-e/CT-e Monitor.

Mode of transport. A CT-e includes information about the mode of transport. The possible modes of transport are road, air, water, rail and pipeline.

Service types. A CT-e has the following service types: normal, subcontracting, redispatch, and intermediate redispatch.

Partners. The following partners are involved in processes that involve CT-e: o Goods sender. This data fills the <rem> tag in the XML of CT-e. o CT-e destination. This data fills the <dest> tag in the XML of CT-e. o Cargo dispatcher. This data fills the <exped> tag in the XML of CT-e. o Cargo receiver. This data fills the <receb> tag in the XML of CT-e.

You must map these CT-e partners to NF partner functions in Customizing.

Service takers. The data for the service taker fills the <toma03> or <toma4> tag in the XML of the CT-e. The system derives the service taker from the NF main partner using the mapping of CT-e partners to NF partner functions that you do in Customizing.

Tax lines: A CT-e can only have one tax line per document. Your SAP ERP system checks during CT-e creation that the document only contains one line item to ensure that this requirement is fulfilled.

References: CT-e usually contain references to other fiscal documents (such as nota fiscal or NF-e)

CT-e types: In addition to normal CT-e, CT-e can be annulled, substituted or created with a complementary value. To enable the processing of these CT-e types in your SAP ERP system, you make must create special nota fiscal types for these CT-e types in Customizing.

Related documents: Electronic correction letters (CC-e) or other NF-e events are not applicable for CT-e.

Integration

You enable communication between the tax authorities’ systems and your SAP ERP system with a messaging system: SAP BusinessObjects Nota Fiscal Eletrônica. SAP BusinessObjects Nota Fiscal Eletrônica can be integrated into your existing system landscape, so that your SAP ERP system provides the data required by the authorities and SAP BusinessObjects Nota Fiscal Eletrônica communicates with the authorities and your customers and suppliers. When connecting SAP ERP to SAP BusinessObjects Nota Fiscal

Page 103: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 103

Eletrônica, all necessary interface implementation is part of the standard delivery. However, you must make certain Customizing settings in SAP ERP and SAP BusinessObjects Nota Fiscal Eletrônica.

For more information about the Customizing in SAP ERP, see Activating SAP BusinessObjects Nota Fiscal Eletrônica. For more information about SAP BusinessObjects Nota Fiscal Eletrônica and the communication with your SAP ERP system, see

http://help.sap.com/grc SAP BusinessObjects Nota Fiscal Eletrônica System Administrator's Guide .

Prerequisites

To process CT-e, you have made the necessary settings in Customizing. In addition to the generic settings for processing electronic fiscal documents, this includes settings that are specific to CT-e. For more information, see Customizing for CT-e.

If you choose to use a messaging system other than SAP BusinessObjects Nota Fiscal Eletrônica, the SAP back-end system asynchronously sends messages to the messaging system of your choice via an outbound interface and receives messages from this via inbound interfaces. For more information, see Interfaces for Communicating with Messaging System.

Features Automatic Generation of CT-e

The system can automatically generate a CT-e from Sales and Distribution (SD). This generation is possible for the following types of CT-e:

Normal: The system creates the CT-e with a sales order during billing. The sales document type has to be assigned to an NF type created for normal CT-e.

Value complementary: The system creates the CT-e with a debit memo request (with reference to a billing document that represents the original CT-e) during billing. The sales document type for the debit memo request has to be assigned to an NF type configured for CT-e value complementary.

Value annulment: There are two variants: o The service taker involved does not contribute ICMS. In this case, the system

creates the CT-e with a credit memo request (with reference to a billing document that represents the original CT-e) during billing. The sales document type for the credit memo request has to be assigned to an NF type configured for CT-e value annulment.

o The service taker involved contributes ICMS. In this case, the service taker issues an NF-e, NF, or even CT-e, as a CT-e value annulment, which needs to be entered in the system as an incoming NF document. This can be done as an SD credit memo type that has been configured for the NF document type return with incoming as the direction and with reference to the original CT-e.

Substitution: The system creates the CT-e with a new sales order during billing that has a reference to a billing document that represents the CT-e annulment or the incoming NF-e/NF/CT-e from the service taker that annuls the original CT-e. The sales document type has to be assigned to an NF type created for CT-e substitution.

Manual Creation with NF Writer

You can also create a CT-e manually using the NF Writer for these types of CT-e:

Normal: You create the CT-e using an NF type for normal CT-e.

Page 104: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 104

Value complementary: You create the CT-e using an NF-type configured for CT-e value complementary. The CT-e has to have a reference to another NF document that represents the original CT-e.

Value annulment: There are two variants: o The service taker involved does not contribute ICMS. In this case, you can

create the CT-e using an NF type configured for CT-e value annulment. The CT-e has to have a reference to the NF document that represents the original CT-e.

o The service taker involved contributes ICMS. In this case, the CT-e can be created using as an incoming NF using the appropriate NF-type (document type “return”, direction “Incoming”) and with reference to the original CT-e.

Substitution: You create the CT-e using an NF type configured for CT-e substitution. The CT-e has to have a reference to the NF document that represents CT-e value annulment or the incoming NF-e/NF/CT-e from the service taker that annuls the original CT-e.

Activities

You monitor your CT-e – from their initial posting through their authorization by the tax authorities – using the NF-e/CT-e Monitor. You can display both NF-e and CT-e in the NF-e/CT-e Monitor or filter for one type by using the model (55 for NF-e or 57 for CT-e).

Most functions in the NF-e/CT-e Monitor that are available for NF-e work in the same way for CT-e. You access the NF-e/CT-e Monitor from the SAP Easy Access Screen by choosing

Logistics Central Functions Country-Specific Functions Brazil Nota Fiscal . Alternatively, you use the J1BNFE transaction.

In the NF-e/CT-e Monitor , you process electronic fiscal documents and monitor the status of these documents. The activities are similar for both NF-e and CT-e and are described in the documentation for NF-e linked below:

Requesting authorization from the tax authorities. CT-e under contingency are processed by the SVC server.

For more information about how to request authorization, see the explanation for NF-e under Requesting Authorization for Documents.

Switching to contingency. As for NF-e, it is possible to switch an individual CT-e posted under normal conditions to contingency or to make the switch centrally for a business place or region. Note that, to comply with requirements from SEFAZ, you cannot switch CT-e value annulment and CT-e substitution to contingency or post such documents under contingency.

For more information, see the explanation in the following documents:

o Contingency Processing of Documents Posted in Normal Mode o Central Contingency Processing

Canceling CT-e and source documents (with authorization request). Note that the cancellation prior to authorization functions available for NF-e are not supported in your SAP ERP system for CT-e.

For more information, see the explanation for NF-e in Document Cancellation.

Skipping CT-e (with authorization request)

For more information, see the explanation for NF-e in Requesting Authorization for Documents.

Page 105: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 105

Checking logs for CT-e

For more information, see Log for Electronic Fiscal Documents.

Page 106: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 106

Customizing for CT-e

To be able to process CT-e in your SAP ERP system, you must first make the Customizing settings that are needed normally for processing NF-e and then you must make additional settings specific to processing CT-e.

You make the settings for NF-e in Customizing for Cross-Application Components under General Application Functions Nota Fiscal . The NF-e settings to be made are

explained in the system documentation for each Customizing activity. For more information, see Customizing for NF-e .

Note that in the following Customizing activities in the Nota Fiscal IMG structure, the Customizing views have been enhanced with additional fields specific to CT-e:

Define Nota Fiscal Types (Customizing view: J_1BAAV) Define Official Status Codes (Customizing view: J_1BSTSCODEV) Define Contingency Reasons (Customizing view: J_1BNFE_CONTINRV) Define Cancellation Reasons (Customizing view: J_1BNFE_CANCELRV)

To make the settings in the Customizing view specific to CT-e, choose in Customizing for Cross-Application Components under General Application Functions Nota Fiscal Electronic Fiscal Documents CT-e Specifics Map CT-e Partners to NF Partner Functions

.

For more information about all of these Customizing settings, see the Customizing activity documentation and the field help for the columns in the Customizing view.

CL_NFE_PRINT Business Add-In (BAdI)

To allow you to implement your own logic to fill fields in the XML for a CT-e, the General Enhancements for Electronic Fiscal Documents (CL_NFE_PRINT) Business Add-In (BAdI), formerly called General Enhancements for NF-e, has a new BAdI method: Fill Additional CT-e Fields (FILL_CTE). You can access this BAdI by choosing in Customizing for Cross-Application Components under General Application Functions Nota Fiscal Electronic Fiscal Documents Business Add-Ins BAdI: General Enhancements for Electronic Fiscal Documents .

Page 107: SAPLibrary NF-e27 Nov 2012

SAP Online Help 27.11.2012

Nota Fiscal 6773 107

Archiving Notas Fiscais

Data Archiving removes from the database application data that is no longer required, and places it in archive files that can be accessed and analyzed at a later date. For more information about archiving, see Introduction to Data Archiving.

The system enables you to archive notas fiscais. They are archived using archiving object J_1BNF, which is supplied with Country Version Brazil. It is used for archiving the data in the following tables:

J_1BNFCPD: Nota Fiscal One-Time Accounts J_1BNFDOC: Nota Fiscal Header J_1BNFFTX: Nota Fiscal Header Message J_1BNFLIN: Nota Fiscal Line Items J_1BNFNAD: Nota Fiscal Partners J_1BNFREF: Nota Fiscal Reference to Header Message J_1BNFSTX: Nota Fiscal Tax Per Item J_1BNFE_ACTIVE: Electronic Nota Fiscal: Actual Status J_1BNFE_HISTORY: Electronic Nota Fiscal – History J_1BNFE_INVALID: Electronic Nota Fiscal: Invalid Status Actions J_1BNFE_EVENT; NF-e Events Table J_1BNFE_CCE: NF-e CCe Table J_1BNFIMPORT_ADI: Nota Fiscal Data for Additions to Import Documents

Procedure

From the SAP Easy Access menu, choose Tools Administration Administration Data Archiving . Enter the object name J_1BNF. From here, you can archive, delete, and read a nota fiscal from the archive.