+ All Categories
Home > Documents > 06. NF NFe CTe Library March2013

06. NF NFe CTe Library March2013

Date post: 29-Oct-2015
Category:
Upload: rogerbx
View: 206 times
Download: 4 times
Share this document with a friend
Popular Tags:
91
HELP.CAINTBR Nota Fiscal PUBLIC | CUSTOMER | INTERNAL | CONFIDENTIAL | STRICTLY CONFIDENTIAL Document Version: 6773 – March 6, 2013
Transcript
Page 1: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 1

HELP.CAINTBR

Nota Fiscal

PUBLIC | CUSTOMER | INTERNAL | CONFIDENTIAL | STRICTLY CONFIDENTIAL Document Version: 6773 – March 6, 2013

Page 2: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 2

Copyright © Copyright 2013 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. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies (“SAP Group”) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Page 3: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 3

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 4: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 4

This document contains a preliminary version of the SAP Library documentation regarding the topics Nota Fiscal (NF), Electronic Nota Fiscal (NF-e) and Conhecimento de Transporte Eletrônico (CT-e) and corresponds to the functions shipped as of January 2013 for SAP ERP 6.0/ECC6.00, SP23. Expected delivery date of the documentation on the Service Marketplace and the SAP Help Portal on April, 2013.

Page 5: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 5

Nota Fiscal ............................................................................................................................ 7

1 Nota Fiscal Type ............................................................................................................. 8 2 Nota Fiscal Item Type ..................................................................................................... 9 3 Nota Fiscal Number ...................................................................................................... 16 4 Nota Fiscal Writer ......................................................................................................... 18

4.1 Nota Fiscal Data ..................................................................................................... 18 4.2 Creating Notas Fiscais ............................................................................................ 21 4.3 Creating Notas Fiscais with MS Excel Upload ......................................................... 22 4.4 Changing/Displaying Notas Fiscais ......................................................................... 23 4.5 Printing Notas Fiscais ............................................................................................. 23 4.6 Nota Fiscal Printout ................................................................................................ 23

4.6.1 Nota Fiscal Printing Configuration .................................................................... 24 4.6.2 Nota Fiscal Form .............................................................................................. 25 4.6.3 Nota Fiscal Layout Set ..................................................................................... 25

4.7 Canceling Notas Fiscais ......................................................................................... 26 4.8 Nota Fiscal: ArchiveLink ......................................................................................... 26 4.9 Authorization Checks .............................................................................................. 26

5 Electronic Fiscal Documents (DF-e) .............................................................................. 28 5.1 Electronic Nota Fiscal (NF-e) .................................................................................. 28

5.1.1 Customizing for NF-e ....................................................................................... 29 5.1.1.1 Mandatory Settings .................................................................................... 30

5.1.1.1.1 Customizing Nota Fiscal Types ............................................................ 31 5.1.1.1.2 Maintaining Number Ranges ............................................................... 31 5.1.1.1.3 Customizing Numbering and Sending Documents to the Messaging System .............................................................................................................. 31 5.1.1.1.4 Assigning Authorizations Related to Electronic Fiscal Documents ........ 32 5.1.1.1.5 Customizing XML Layout Version ........................................................ 33 5.1.1.1.6 Maintaining Default Values for the XML File ......................................... 34 5.1.1.1.7 Customizing for Contingency Processing ............................................. 34

5.1.1.1.7.1 Customizing for Printing Contingency Document on Security Paper ...................................................................................................................... 35

5.1.1.1.8 Customizing Cancellation Reasons ...................................................... 35 5.1.1.1.9 Customizing Tax Jurisdiction Codes .................................................... 36

5.1.1.2 Optional Settings ....................................................................................... 36 5.1.1.2.1 Customizing Official Status Codes ....................................................... 36 5.1.1.2.2 Customizing Automatic Printing of Authorized Documents ................... 37 5.1.1.2.3 Customizing for Cancellation under Contingency ................................. 37 5.1.1.2.4 Customizing Tax Situations ................................................................. 38 5.1.1.2.5 Customizing NF Type Redetermination in SD ...................................... 38 5.1.1.2.6 Customizing NF Type Determination for Mixed Scenarios .................... 39 5.1.1.2.7 Customizing BCB Country Codes ........................................................ 40 5.1.1.2.8 Customizing for SCAN ......................................................................... 40 5.1.1.2.9 Customizing for ICMS Exemption Reasons .......................................... 41 5.1.1.2.10 Business Add-Ins (BAdIs) for Electronic Fiscal Documents ................ 41

5.1.1.3 Interfaces for Communicating with Messaging System ............................... 42 5.1.1.3.1 Activating SAP BusinessObjects Nota Fiscal Eletrônica ....................... 42 5.1.1.3.2 Interface for Outbound Messages ........................................................ 43 5.1.1.3.3 Interfaces for Inbound Messages ......................................................... 44 5.1.1.3.4 Interfaces for Messaging-System Actions ............................................ 45

5.1.2 Business Transactions ..................................................................................... 46 5.1.2.1 Outgoing Electronic Notas Fiscais .............................................................. 46

5.1.2.1.1 Requesting Authorization for Documents ............................................. 47 5.1.2.2 NF-e/CT-e Monitor ..................................................................................... 49

5.1.2.2.1 Checking Document Status ................................................................. 50 5.1.2.2.1.1 Log for Electronic Fiscal Documents.............................................. 51 5.1.2.2.1.2 Electronic Fiscal Document Data ................................................... 51 5.1.2.2.1.3 Access Key ................................................................................... 55

5.1.2.2.2 User Actions for Individual Documents ................................................. 56 5.1.2.2.3 Document Cancellation ........................................................................ 58

Page 6: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 6

5.1.2.2.4 Contingency Processing of Documents Posted in Normal Mode .......... 60 5.1.2.2.5 Central Contingency Processing .......................................................... 62

5.1.2.2.5.1 Activating Contingency Processing for Regions ............................. 63 5.1.2.2.5.2 Activating Contingency Processing for Business Places ................ 64

5.1.2.2.6 Electronic Fiscal Document Processing with Contingency Server ......... 65 5.1.2.2.7 Statuses in NF-e/CT-e Monitor ............................................................ 66

5.1.2.2.7.1 Monitor Statuses: Document Authorization .................................... 67 5.1.2.2.7.2 Monitor Statuses: Authorization with Subsequent Cancellation ...... 68 5.1.2.2.7.3 Monitor Statuses: Rejection and Subsequent Skipping .................. 69 5.1.2.2.7.4 Monitor Statuses: Authorization with Validation Error ..................... 70 5.1.2.2.7.5 Monitor Statuses: Document Switched to Contingency .................. 71 5.1.2.2.7.6 Monitor Statuses: Document Posted under Contingency ............... 73 5.1.2.2.7.7 Monitor Statuses: Cancellation Prior to Authorization ..................... 73

5.1.2.3 Incoming Electronic Notas Fiscais .............................................................. 75 5.1.2.3.1 Changing Posting Date for Manually-Created Incoming NF-e ............... 76 5.1.2.3.2 User Decision in Creation of Incoming NF in Mixed Scenarios ............. 76

5.1.3 Reports ............................................................................................................ 77 5.1.3.1 Check Number Range Gaps (Gap Report) ................................................. 77

5.1.4 NF-e Events ..................................................................................................... 78 5.1.4.1 Customizing for NF-e Events ..................................................................... 79 5.1.4.2 Interfaces for NF-e Events ......................................................................... 80

5.1.4.2.1 Interface for Outbound NF-e Event Messages ..................................... 80 5.1.4.2.2 Interface for Outbound CC-e Messages ............................................... 81 5.1.4.2.3 Interface for Inbound NF-e Event Messages ........................................ 81

5.1.4.3 Event: Electronic Correction Letters (CC-e) ................................................ 82 5.1.4.3.1 Process Flow for Electronic Corrections Letters (CC-e) ........................ 83

5.1.4.3.1.1 Creating Electronic Correction Letters (CC-e) ................................ 85 5.1.4.4 Event: NF-e Cancellation ........................................................................... 85

5.1.4.4.1 Creating NF-e Cancellation Event ........................................................ 85 5.1.4.5 Archiving NF-Event Data ............................................................................ 86

5.2 Conhecimento de Transporte Eletrônico (CT-e) ...................................................... 86 5.2.1 Customizing for CT-e ....................................................................................... 89

6 Archiving Notas Fiscais ................................................................................................. 91

Page 7: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 7

Nota Fiscal

Definition See nota fiscal [External].

As of 2007, companies must generate an electronic nota fiscal; the related processes are described under Electronic Nota Fiscal [External].

Use The nota fiscal is used in the following ways:

Delivery note In Brazil, taxes are levied on the movement of goods – and not on the sale, as is customary in other countries. For this reason, a nota fiscal, which represents a legal document, must accompany each delivery of goods.

Invoice In most cases, the nota fiscal also serves as a financial document, meaning that customers view the nota fiscal as an invoice against which they make payment. They do not request a separate invoice (called a fatura in Portuguese). This type of nota fiscal that serves as the invoice is commonly referred to as the nota fiscal fatura (and, in the system, is simply called the nota fiscal).

On occasion, customers request a separate invoice in addition to the nota fiscal that arrives along with the goods. Vendors then send what is called a fatura, which can be used to group one or more notas fiscais.

The nota fiscal includes all tax-related information [External], which is required for reporting to the tax authorities.

Integration The SAP System automatically generates a nota fiscal when you:

Create an invoice in Logistics Invoice Verification [External] (MM-IV) Enter a goods movement in Inventory Management [External] (MM-IM) Create a sales order in Billing [External] (SD-BIL)

You can also create a nota fiscal manually using the Nota Fiscal Writer [External].

Customizing A number of Customizing settings must be configured for the nota fiscal functions to work. In particular, you must define:

Nota fiscal number ranges Nota fiscal types CFOP codes Screen control group assignments

You can refer to this overview of all nota fiscal Customizing [External] activities.

See also: Nota Fiscal Types [Page 8] Archiving Notas Fiscais [External]

Page 8: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 8

1 Nota Fiscal Type Definition A classification of a nota fiscal that describes the business process, for instance, nota fiscal incoming. Use Each nota fiscal must be assigned a nota fiscal type. In Sales and Distribution (SD), the system determines the nota fiscal type automatically; however, you must enter it manually in Logistics Invoice Verification and in the Nota Fiscal Writer. The nota fiscal type is used to determine important attributes of a nota fiscal.

Structure You define nota fiscal types in Customizing, under Cross-Application Components General Application Functions Nota Fiscal Define Nota Fiscal Types. For each nota fiscal type, enter data as required:

Nota fiscal entrada You set this indicator if an incoming nota fiscal is issued by the customer instead of the customary vendor.

Electronic NF You set this indicator if the related nota fiscal is subject to electronic nota fiscal [External] (NF-e) processing.

NF cancellation type Here you define the cancellation type to be associated with the nota fiscal type. If you cancel a nota fiscal, the system creates a new nota fiscal with the type Cancel; it automatically assigns the appropriate nota fiscal cancellation type that is defined here for the corresponding nota fiscal type.

NF contingency type Here you enter the nota fiscal type that is used in the case of contingency [External] processing when the nota fiscal is printed as a nonelectronic nota fiscal.

Direction of movement Here you specify whether the nota fiscal is incoming or outgoing.

Document type You must specify one of the following document types for the nota fiscal type: nota fiscal, complementar, correction, conhecimento (single or multiple), cancel, or return.

Invoice Verification data NF partner function (main partner for nota fiscal header) NF partner type (vendor, business place, or customer) NF item type (for special processes, for example, third-party deliveries, future

deliveries, consignments) Text key (determination of automatic texts – IPI return handling)

Nota fiscal form You need to assign a nota fiscal form [Page 25] to the nota fiscal type; it is necessary for printing notas fiscais.

Nota fiscal model Here you specify the nota fiscal model for the nota fiscal type; the model is defined by Brazilian tax authorities and must be specified in legal files.

Page 9: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 9

2 Nota Fiscal Item Type Definition A code that describes the business transaction at item level within a given process. An example of a nota fiscal (NF) item type within the business process of subcontracting is subcontracting component shipment item.

Use The system uses the NF item type primarily for:

CFOP determination

Posting of taxes

Definition of relationship between notas fiscais

Legal reporting The standard system comes complete with all the NF item types required for the Brazilian business processes modeled in the system. If you need to create additional NF item types, you do so in Customizing for Cross-Application Components, under General Application Functions > Nota Fiscal > Define Nota Fiscal Item Types. For each new NF item type, you need to define a number of rules that correspond to each of the applications in which the system generates or processes notas fiscais. Accordingly, the Customizing activity is divided into the following areas described below.

Structure General Here you maintain how ICMS and IPI statistical tax values are handled, which, in turn, influences reporting results. If the St.Tax (Statistical tax item) indicator is set for a tax item, the base and tax values for the respective tax type will not appear in the legal books [External]; and if it is set for an IPI tax type, then blanks will appear in the “IPI value” column of the respective line printed on the nota fiscal. Statistical taxes are, however, included in the “total value” (the total gross value, including all taxes) of the document. The values you specify here are transferred to the St.Tax indicator of the ICMS and IPI tax item for notas fiscais created via Logistics Invoice Verification (MM-IV-LIV). The following settings are possible for both tax types, ICMS and IPI: Setting Effect on Tax Items Not statistic The indicator is not set in tax items Statistic for all usages The is set in tax items Statistic for consumption The indicator is set in tax items if the material

usage is consumption The following item types delivered with the standard system are marked as statistic for ICMS:

41, Future delivery invoice item without ICMS

43, Future delivery invoice item without ICMS/IPI

51, Consignment invoice item

64, Third party future delivery invoice item from supplier And the following item types delivered with the standard system are marked as statistic for IPI:

43, Future delivery invoice item without ICMS/IPI

51, Consignment invoice item

Invoice Here you can set a number of indicators related to the invoice and corresponding nota fiscal that is generated within Logistics Invoice Verification: Indicator/Field Meaning Special Note Delivered Item

Page 10: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 10

Types with this Field Active

Default Item Type The system typically derives the NF item type from the purchase order item category (see Customizing [External]) or, if it is not maintained, then from the nota fiscal type [Page 8]. If neither of these settings is maintained, then the system takes the default item type maintained here.

Set only one NF item type as the default.

01 (Standard item)

GI/GR Check In Brazil, it is recommended that you use goods-receipt (GR)-based invoice verification [External]. If the GI/GR check indicator is set, the system checks that the GR- based invoice verification indicator is not set in the corresponding purchase order items. If the check determines that it is set, then the system displays the following error: “GR-based IV not allowed for future delivery.”

You should activate the GI/GR check for NF item types used in processes in which you post the invoice before the goods receipt (such as future delivery or third-party future delivery item from supplier).

- 41 (Future delivery invoice item without ICMS) - 64 (Third party future delivery item from supplier)

Ignore Reference IM

You need to set this indicator for NF item types that are used for processes in which a combination of several NF item types is possible. If it is set, the system checks whether, for the marked item type, the combination with the main item type is allowed (main item types are maintained in the bottom group box on the screen).

Take, for example, delivered item type 21 for a returnable transport packaging (RTP [External]) item. In this case, the material used for RTP has a different item type than the purchased material. For the item type used for RTP, the Ignore Reference IM indicator must be set, and the item type used for the purchased material must be entered under “Main Item Types.”

- 21 (Returnable packaging shipment item) - 42 (Future delivery invoice item with IPI) - 51 (Consignment invoice item) - 52 (Consignment shipment item) - 61 (Third-party invoice item from vendor) - 62 (Third-party invoice item from supplier) - 64 (Third-party future delivery invoice item from supplier)

Unique Item Type If you set this indicator, it means that all items of a nota fiscal created via Logistics Invoice Verification must have the same item type. If a nota fiscal includes several items with different item types, and this indicator is set for at least one of them, the system issues an

Do not activate both the Unique Item Type and the Ignore Reference IM indicators.

- 31 (Subcontracting invoice item) - 51 (Consignment invoice item) - 61 (Third party invoice item from vendor) - 62 (Third party invoice item from supplier)

Page 11: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 11

error message. Reference Check If you set this indicator, then

the system checks during Logistics Invoice Verification that a reference nota fiscal exists. If no reference exists, the system issues an error message.

Set the Reference Check indicator only in combination with the Unique Item Type indicator.

- 21 (Returnable packaging shipment item) - 33 (Subcontracting component symbolic shipment item) - 41 (Future delivery invoice item with ICMS)

Inventory Management Here you can make settings related to the material document and corresponding nota fiscal that is generated within Inventory Management (MM-IM): Indicator/Field Meaning Special Note Delivered Item

Types with this field active

Transfer Item Type

You must set this indicator for item types used in stock transfer processes with a stock transport order [External].

Set this indicator for one item type only.

02 (Stock Transfer Item)

Reference Mat. Doc.

When you post a goods receipt and enter the nota fiscal number [External] in the Delivery Note field, the system checks if the number already exists for the vendor on the same date. By setting this indicator, this check is deactivated. For example, the subcontracting process is an exception in that there may be more than one document number for the same vendor and date. So in this case, you want the check to be deactivated.

– 32 (Subcontracting component shipment item)

Unique MM-IM If you set this indicator, it means that all items of a nota fiscal created when posting a goods receipt must have the same item type. If a nota fiscal includes several items with different item types, and this indicator is set for at least one of them, the system issues an error message.

Do not enter any main item types if the Unique MM-IM indicator is set.

- 31 (Subcontracting invoice item) - 32 (Subcontracting component shipment item) - 41 (Future delivery invoice item with ICMS) - 43 (Future delivery invoice item without ICMS/IPI) - 44 (Future delivery invoice item with ICMS/IPI) - 51 (Consignment invoice item)

Page 12: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 12

- 61 (Third-party invoice item from vendor) - 62 (Third-party invoice item from supplier) - 63 (Third-party shipment item from supplier) - 64 (Third-party future delivery invoice item from supplier) - 65 (Third-party future delivery symbolic shipment item from supplier)

ICMS Excl/Other Base

For certain item types, no taxes are calculated in Inventory Management – but the tax items must be filled with the tax base as the default value. If this indicator is set, the system stores the tax base for ICMS in the “excluded base” or “other base” amount.

– - 32 (Subcontracting component shipment item) - 33 (Subcontracting component symbolic shipment item)

IPI Excl/Other Base

For certain item types, no taxes are calculated in Inventory Management – but the tax items must be filled with the tax base as the default value. If this indicator is set, the system stores the tax base for IPI in the “excluded base” or “other base” amount.

– 21 (Returnable packaging shipment item)

Check Observations

If this indicator is set, it means that the Observations field is required for the corresponding item type when a nota fiscal is created via Inventory Management transactions. If this indicator is set in the standard applications which generate a nota fiscal automatically (Logistics Invoice Verification, Inventory Management), then the header text field must be inserted.

– - 33 (Subcontracting component symbolic shipment item) - 63 (Third-party shipment item from supplier) - 65 (Third-party future delivery symbolic shipment item from supplier)

3rd Party Suppl.Ship

You must set this indicator for third-party shipment items from supplier. If it is set, then during entry of a goods receipt, the system checks if the supplying vendor is maintained in the purchase order.

– - 63 (Third-party shipment item from supplier)

Page 13: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 13

Check Direction Refers to the goods movement direction that is checked when a corresponding item type is specified for a new nota fiscal item; the system performs a reference check to the original nota fiscal.

This field can contain the following values: - No check - 1, Check all directions - 2, Check incoming direction - 3, Check outgoing direction

Item type (Description), Direction checked: - 42 (Future delivery shipment item with ICMS/IPI), All - 44 (Future delivery shipment item with IPI), All - 51 (Consignment invoice item), All - 62 (Third party invoice item from supplier), Outgoing - 65 (Third party future delivery symbolic shipment item from supplier), Incoming

Billing Here you can set two indicators related to the invoice and corresponding nota fiscal that is generated within Billing (SD-BIL): Indicator/Field Meaning Special Note Delivered Item

Types with this Field Active

Excluded/Other Base

If this indicator is set and if, for the used tax code, base reductions are maintained, then the sum of all tax bases (normal, excluded, and other) is stored in the “other base amount” in Billing, and the “base” and “excluded base” fields contain zero.

– 21 (Returnable packaging shipment item)

Redetermine Tax Code

Means that the system uses the tax code from the preceding document. For instance, when you create a sales document, the system copies the tax code from the sales order.

– All delivered item types except for: - 42 (Future delivery shipment item with IPI), and - 44 (Future delivery shipment item with ICMS/IPI)

Reporting Here you can make a number of settings related to the nota fiscal and reporting: Indicator/Field Meaning Special Note Delivered Item

Types with this Field Active

Ignore Total (under General)

For certain item types, tax base amounts are ignored in the reporting for the sum of total per CFOP. If this indicator is set, the tax base is not included in the sum for CFOP total.

The function is used in Modelos 1, 2, 8, and 9, and Arquivo Magnético.

- 41 (Future delivery invoice item with ICMS) - 43 (Future delivery invoice item without ICMS/IPI) - 51 (Consignment invoice item)

Page 14: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 14

- 63 (Third party shipment item from supplier) - 64 (Third party future delivery invoice item from supplier)

Skip Item (under General)

Certain item types are not taken into account in reporting. If this indicator is set, the system does not process nota fiscal items with the corresponding item type.

This function is used in Modelos 8 and 9.

- 41 (Future delivery invoice item with ICMS) - 43 (Future delivery invoice item without ICMS/IPI) - 63 (Third party shipment item from supplier) - 64 (Third party future delivery invoice item from supplier)

Text Number (under Modelo 1/2)

Text number assigned to a text that is printed in Modelo 1 or Modelo 2. The text must be defined as a text element in the report itself (Modelo 1 or 2) or in the table J_1BMODTEXT. The system checks for a table entry first.

You only need to make an entry here if you have defined your own item types.

Clear Reference (under Modelo 1/2)

Triggers the clearing of the refence document number in Modelos 1 and 2.

– Modelo 1 - 61 (Third-party invoice item from vendor) - 62 (Third party invoice item from supplier) Modelo 2 - 62 (Third party invoice item from supplier)

Main Item Types Certain item types are not allowed to be combined with other item types, meaning that all item types in a nota fiscal must have the same item type. In this case, do not specify any main item types in this section. For those item types which may be combined with others, here you enter the item types that are allowed in combination with the one you are maintaining. For example, the delivered item type 21 (Returnable packaging shipment item) can be combined with the following item types:

1, Standard item

31, Subcontracting invoice item

32, Subcontracting component shipment item

42, Future delivery invoice item with IPI

44, Future delivery invoice item with ICMS/IPI

52, Consignment shipment item

63, Third-party shipment from supplier

Page 15: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 15

Page 16: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 16

3 Nota Fiscal Number

The number printed on the nota fiscal. This is a six-digit number for a conventional nota fiscal, and a nine-digit number for an electronic fiscal documents (such as NF-e and CT-e).

Do not confuse the nota fiscal number, also referred to as the external number, with the internal document number generated by the system for each nota fiscal.

By itself, the nota fiscal number is not a unique number, but it becomes unique when it is combined with a legal entity and a series, as described in the following cases:

When you issue a nota fiscal, the system generates the nota fiscal number automatically. In the case of outgoing notas fiscais, the number becomes unique in the combination of business place + series + nota fiscal number.

When you receive a nota fiscal, the nota fiscal number is printed on the form you receive. In the case of incoming notas fiscais, the number becomes unique in the combination of partner + series + nota fiscal number.

Structure The nota fiscal number consists of a number, series, and subseries. In the Nota Fiscal Writer, the three elements appear in three consecutive fields, only the first one of which is labeled NF no. (Nota fiscal number).

When you receive a nota fiscal with delivered goods, you need to enter the number of the incoming nota fiscal. In Logistics Invoice Verification, for instance, you enter this in the goods receipt transaction in the Delivery note field. In these cases when you enter the nota fiscal number in a single field, you must enter it in one of the following formats; the various elements are described in the table below:

xxxxxx (conventional) or xxxxxxxxx (NF-e/CT-e)

xxxxxx-sss (conventional) or xxxxxxxxx-sss (NF-e/CT-e)

xxxxxx-Suu (conventional) or xxxxxxxxx-Suu (NF-e/CT-e)

Format Element Description

xxxxxx or xxxxxxxxx Nota fiscal number (conventional/NF-e/CT-e)

Sss Series (without subseries)

S Series (letter between A and Z)

Uu Subseries

Integration The system can automatically assign the nota fiscal number when you print the nota fiscal [Page 23]. This automatic assignment depends on your Customizing settings for nota fiscal output, in particular the number groups, number ranges, and nota fiscal numbers and form

Page 17: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 17

sizes (see Nota Fiscal: Customizing, under Output [External]). Note that you can also configure the system so that manual entry of nota fiscal numbers is possible (see Nota Fiscal Printing Configuration [Page 24])

For electronic fiscal documents (such as NF-e or CT-e), the nota fiscal number assignment occurs before the electronic fiscal document is sent for authorization (see Customize Numbering and Sending Documents to the Messaging System [Page 31])

Page 18: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 18

4 Nota Fiscal Writer

You use the Nota Fiscal Writer to:

Create a nota fiscal or electronic fiscal documents (such as NF-e or CT-e) manually

You should only create notas fiscais with the Nota Fiscal Writer if the system does not automatically generate them via the integration into Invoice Verification [External] and Inventory Management [External] in Materials Management (MM), or Billing [External] in Sales and Distribution (SD). Note that the Nota Fiscal Writer does not update other components automatically; this means for each nota fiscal you create manually with the Nota Fiscal Writer, you must post taxes and material movements in Financial Accounting (FI) and MM separately.

Display or change a nota fiscal – that was either created manually or generated automatically

Print or reprint a nota fiscal

Cancel a nota fiscal that was created in the NF Writer

Features The Nota Fiscal Writer enables you to enter all data [External] relevant to notas fiscais.

Activities To access this report, on the SAP Easy Access screen, choose Logistics Central Functions Country-Specific Functions Brazil Nota Fiscal Nota Fiscal Writer .

Alternatively, you can execute the following transactions:

Action Transaction

Create a nota fiscal J1B1N

Create a nota fiscal with many line items, for example, a nota fiscal for imports, by uploading data from an MS Excel file

For more information, see Creating Notas Fiscais with MS Excel Upload [Page 22].

J1B1N_IMP

Change a nota fiscal J1B2N

Display a nota fiscal J1B3N

Print a nota fiscal J1B3N

4.1 Nota Fiscal Data

Page 19: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 19

The initial screen of the Nota Fiscal (NF) Writer differs, depending on whether you are creating [External] a nota fiscal (with or without the upload of data from an MS Excel file), or changing or displaying [Page 23] one. Once you enter the transaction, the following information is available:

Tab Page Name

Information Displayed Additional Subscreens

Overview This tab page provides an overview of all nota fiscal items. Here you can enter data, such as the material and quantity, as well as many other types of information. You can branch to the item information by double-clicking an item or choosing the pushbuttons: Item Detail, Taxes, or Item Messages (see next column)

Item Detail: Contains item data such as material, quantity, price, discount, freight, tax control information, tax laws, NCM code, and so on. You can also enter data here.

Taxes: Contains the tax details such as tax type, base amount, excluded base amount, rate, tax amount, and so on. All taxes must be entered here: You can enter tax amounts manually, or the system can calculate them for selected items using the base amount and the rate via the tax calculation function (under Edit Calculate ).

Item Messages: Displays all messages that are linked to the specified item. For messages that were created manually, you can specify the links by choosing the Links pushbutton on the Messages tab page.

Total Values This tab page summarizes all tax values calculated for the nota fiscal items. You cannot enter any data here.

None

Partners Here you can specify partners other than the main partner, such as a carrier.

To view the partner details, double-click the Partner ID or choose the Details pushbutton. Detailed information on the specified partner is displayed, such as the address, tax numbers, and so on. You cannot enter any data here – except when creating notas fiscais for one-time partners.

Messages Here you can enter specific nota fiscal texts (header and line texts). You can create new texts, but you cannot change automatically generated texts (tax law, for instance).

Long Text: If a header or an item text has more than one line, you can enter all lines on this screen. To do so, choose the pencil pushbutton.

Links: You must link an item text to the particular item. Select a message and choose the Links

Page 20: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 20

pushbutton. The system displays all items; select the items that are to be linked to the message.

Transport Displays transportation data None

Financial Data Displays financial data, including withholding tax information

None

Administration Displays administrative data, such as the name of the user who created the nota fiscal, whether it has been printed, and so on

None

NF-e Data Displays information related to electronic notas fiscais [External]. The system automatically fills all NF-e data except for the protocol number and random number, which you must enter manually.

None

Import Documents

If you use the J1B1N transaction to create a nota fiscal, the system only displays this tab page if you enter nota fiscal (NF) items that are relevant for imports, that is, their CFOP begins with 3. For such NF items, you enter the relevant import document data and then assign the NF items to the corresponding import document and addition.

For information about filling the data on this tab page using the upload function in the J1B1N_IMP transaction, see Creating Notas Fiscais with MS Excel Upload [Page 22].

If you have implemented the FILL_ITEM method of the CL_NFE_PRINT Business Add-in (BAdI), the method will overwrite any data that is entered manually on this tab page in the NF-e Writer.

None

CT-e This tab page provides details of the goods being transported and the methods of transport for the CT-e.

This tab is only displayed if the CT-e belongs to a nota fiscal with NF model 57 (as indicated in the Administration tab).

None

Page 21: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 21

The details are displayed in the following tables:

References

All goods being transported are listed in a nota fiscal (NF) or electronic nota fiscal (NF-e). This table associates the NF or NF-e of the goods being transported to the CT-e. For each NF or NF-e transported, a new entry in this table must be created on either the NF tab or the NF-e tab.

Only one type of nota fiscal – an NF or an NF-e – can be associated with a CT-e.

Resources

This displays all of the information about the resources used during transport. This includes details of each type of resource (for example, truck, container, or pallet) used for transport.

4.2 Creating Notas Fiscais Procedure To create a nota fiscal (NF) using the Nota Fiscal Writer:

1. Run the J1B1N transaction.

For the procedure for creating notas fiscais using the upload function in the J1B1N_IMP transaction, see Creating Notas Fiscais with MS Excel Upload [Page 22].

2. Enter the following information on the initial screen, then choose Enter:

o Nota fiscal type [Page 8]

Based on the NF type, the system determines whether a conventional NF or an electronic fiscal document (such as NF-e or CT-e)) is created. If the system creates an NF-e or a CT-e, then it sets the Electronic NF indicator on the initial screen of the NF Writer.

o Your company code and business place [External]

o Partner function (such as ship-to party) and the partner ID

You can create notas fiscais for one-time partners (for more information, see one-time accounts for customers [External] and vendors [External]); the only difference is that you must maintain bank data in the respective FI document, not in the NF Writer.

Page 22: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 22

o Whether values entered in the nota fiscal are to include ICMS and ISS tax (if yes, set the Incl. ICMS/ISS indicator)

3. Enter all relevant data [External] for the nota fiscal, then choose Save.

Result The system automatically creates a print request for the nota fiscal according to the rules defined for the nota fiscal form. You can then print [Page 23] the nota fiscal if you need to.

4.3 Creating Notas Fiscais with MS Excel Upload

To manually create notas fiscais with many line items more easily, for example, for notas fiscais for imports, you can upload import data in a special view of the Nota Fiscal Writer from an MS Excel file.

Prerequisites You have made the necessary Customizing settings in Customizing for Cross-Application Components under General Application Functions Nota fiscal NF Document Maintenance Define MS Excel Layouts for Dat Upload . For more information about these Customizing settings, see the system documentation for the Customizing activity in the IMG structure.

Procedure 1. Run the J1B1N_IMP transaction.

2. On the initial screen, enter the nota fiscal type, the organizational data, and ICMS/IPI information. For more details about these entries, see Creating Notas Fiscais [Page 21].

3. In the MS Excel Upload group box, browse to the location of the MS Excel file on your hard drive.

4. Select the layout for this MS Excel file. Note that you can only select from layouts that have been recorded in your Customizing.

5. Enter the rows in the file where the import data to be uploaded (not column header data!) starts and ends.

6. Choose Continue.

The system uploads the data from the MS Excel file and fills the fields on the following screens that have been mapped to the columns in this MS Excel layout in Customizing. On the Import Data tab page, the system lists the document IDs for the import documents, if available.

You can also enter in the MS Excel new columns for assigning specific tax types. In this case, after uploading the MS Excel, the system overwrites the customizing by the value you have added in the MS Excel file.

7. Enter all other relevant data.

8. Save your entries.

Page 23: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 23

Result The system automatically creates a print request for the nota fiscal according to the rules defined for the nota fiscal form. You can then print the nota fiscal if needed.

4.4 Changing/Displaying Notas Fiscais To change a nota fiscal, run transaction J1B2N; to display, transaction J1B3N. Enter the internal nota fiscal document number on the initial screen. If you do not know it, you can choose the input help and search by:

Nota fiscal number Original SD document Original Invoice Verification document

If you change or display a nota fiscal that was generated automatically in MM or SD, you can view the original document (such as the billing or material document) from the item level, by choosing the Source pushbutton.

Similarly, you can branch from the MM or SD document directly to the generated nota fiscal (displayed in the Nota Fiscal Writer), by choosing the Accounting pushbutton from the respective document screen.

4.5 Printing Notas Fiscais ...

1. Go to the display mode of the Nota Fiscal Writer by calling transaction J1B3N. 2. Enter the internal nota fiscal document number on the initial screen. If you do not know

it, you can choose the input help and search by:

Nota fiscal number Original SD document Original Invoice Verification document Original material document Original Logistics Invoice Verification document

3. Choose Nota Fiscal Output.

The system automatically assigns a nota fiscal number [External].

See also: Nota Fiscal Printout [Page 23]

4.6 Nota Fiscal Printout Use Most Brazilian companies have very specific requirements for printing a nota fiscal; they usually have different layouts and data on the nota fiscal form. The system uses SAPscript to print a nota fiscal. Country Version Brazil includes a sample layout set [Page 25], J_1BNOTA_FISCAL, whose form layout and data fulfill Brazilian legal requirements. If you need to make changes to fit your company's needs, copy the sample layout set and change as necessary. For more information, see SAPscript Overview [External].

Customizing Before you can print notas fiscaís, you need to work through the Nota Fiscal Customizing settings [External] related to the forms and numbering (under Output and Output

Page 24: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 24

Determination). Refer to the IMG documentation for more information on the activities, as well additional configuration notes [Page 24].

Day-to-Day Activities From the display mode of the Nota Fiscal (NF) Writer [External] (transaction J1B3N), you can print a nota fiscal in the following cases:

After the system has automatically generated a nota fiscal in Materials Management (MM) or Sales and Distribution (SD) Go to the NF Writer, and the system proposes the nota fiscal that was just generated. Choose Nota Fiscal Output.

After you have manually created a nota fiscal When you save the nota fiscal, the system automatically creates a print request, which you then need to print. Choose Nota Fiscal Output.

If you want to reprint a nota fiscal Choose Nota Fiscal Reprint.

Once you have printed (output) a nota fiscal, the NF Writer sets the Printed indicator on the Administration tab.

4.6.1 Nota Fiscal Printing Configuration The nota fiscal Customizing activities [External] offer several settings for you to flexibly configure and print notas fiscaís.

Nota Fiscal Number Typically you configure the system to automatically assign a nota fiscal number [External] when you print a nota fiscal, by means of internal number ranges. But note that it is also possible to specify external number assignment for a number range (by setting the Ext indicator in number range maintenance), which then enables you to manually enter the nota fiscal number in the Nota Fiscal Writer – either for a manually created nota fiscal or for one generated automatically by an application. In this case, the NF no. field is open for entry; if the Ext indicator is not set, the field is not open. Numbering and Printing Parameters In the activity Assign Numbering and Printing Parameters, you can define printing parameters by company code, business place, and nota fiscal form. For each combination of these three key fields, you can enter a number range group, number range number, series and subseries, output device, number of text lines allowed in the header message, number of line items allowed, and whether the nota fiscal is a fatura.

Although you can assign a printer directly in this activity, you must still create a condition record for the printer (under Output Condition Records Create).

In addition, you can define the parameters by a fourth key field - called the dynamic key – if the existing three key fields do not meet your company’s requirements for printing notas fiscaís.

Assume, for example, that one of your company’s business places has two shipping points, and you need to print the same form from these two shipping points, using two different printers and different number ranges, series, and subseries. In this case, you can specify shipping point as the dynamic key, and under the Key-Specific Printing Parameters, assign a printer directly to the shipping point.

Since you are able to assign more than one printer to a single nota fiscal form, in turn this enables you to assign more than one nota fiscal form to the same nota fiscal type. If these four fields are still not sufficient for your printing requirements, you can create a Business Add-In implementation – under Output BAdI: Numbering and Printing Parameters – to send whatever printing parameters you need back to the print program.

Page 25: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 25

For additional details and examples, refer to SAP Note 743361. Single-Page Notas Fiscais See Enabling Split Invoices (Nota Fiscal Split) [External].

4.6.2 Nota Fiscal Form Definition Form used for printing a nota fiscal.

Use The nota fiscal form controls a number of factors related to output of the nota fiscal:

Generation of the nota fiscal number, based on the assigned number group Size of a nota fiscal page (important for single-page notas fiscais) Series and subseries for the nota fiscal number Whether the nota fiscal is a nota fiscal fatura (see Nota Fiscal [Page1]) Print program and layout set used to print the nota fiscal Whether automatic print is initiated via SAP message control (NAST with output

application NF)

Customizing To maintain nota fiscal forms, choose Cross-Application Components General Application Functions Nota Fiscal Output Define Forms. If you create a new nota fiscal form, you must also:

Assign it as required to the nota fiscal types (Customizing activity Define Nota Fiscal Types)

Assign it to a business place (activity Define Nota Fiscal Numbers and Form Sizes) Specify the processing programs and SAPscript layout set for printing (activity

Processing Programs) Define output types for the form (Condition Types, under Output Determination).

Note that you must maintain the output device (see Nota Fiscal Printing Configuration [Page 24]).

4.6.3 Nota Fiscal Layout Set You can use most SAPscript functions to adapt the nota fiscal layout set to meet your company’s needs. The following communication structures are used to transfer data relevant to the nota fiscal (NF). Use the Repository Information System [External] for information about the available fields of the structures.

J_1BPRNFDE - Destination data: This structure contains data about the NF destination (such as address, CNPJ number, and state tax number).

J_1BPRNFFA - Fatura data: This structure contains data about the payment terms of the different installment payments. Up to five different installments are supported.

J_1BPRNFHD - Document header: This structure contains data about the NF header (such as NF type, NF number, and issue date).

J_1BPRNFIS - Issuer data: This structure contains data about the NF issuer (such as address, CNPJ number, and state tax number). The sending plant is usually the issuer.

J_1BPRNFLI - Line information: This structure contains data about the NF line (such as material, material description, ICMS, and IPI).

J_1BPRNFRE - Bill-to party data: This structure contains data about the bill-to party (such as address, CNPJ number, and state tax number).

J_1BPRNFRG - Payer data: This structure contains data about the payer (such as address, CNPJ number, and state tax number).

Page 26: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 26

J_1BPRNFST - Subtotals at top/bottom of page: This structure is used to print the totals of the previous page in the case of printing multiple pages.

J_1BPRNFTR - Transport data: This structure contains data about the carrier (such as address, CNPJ number, and state tax number).

J_1BPRNFTX - Texts: This structure contains NF texts. It is used to print up to 16 lines in the text window. The number of printed lines depends on the NF form. All other texts are printed in the window MAIN.

There are a few restrictions when you define windows and text elements: ...

1. The window MAIN must contain the text elements HEADER (print header information), LINE (print line information), INTERTOTALS (totals per tax situation and ICMS rate), and TEXTS (print additional text which does not fit into the text window).

2. The window SUBTOTAL must contain the text element FOOTER (subtotals on the bottom of a page in the case of multiple-page nota fiscal).

4.7 Canceling Notas Fiscais

You can use the Nota Fiscal (NF) Writer to cancel a nota fiscal that was created manually with the NF Writer.

Electronic fiscal documents cannot be cancelled in the NF Writer. For more information, see Document Cancellation [Page 58]

Procedure 1. Run transaction J1B3N (display mode of NF Writer).

2. Specify the internal nota fiscal document number.

3. Choose Nota Fiscal Cancel .

Result The system creates a new nota fiscal with the type Cancel. In addition, it updates the administrative data of the original nota fiscal, setting the Canceled indicator.

4.8 Nota Fiscal: ArchiveLink ArchiveLink functions are available for notas fiscais in the Nota Fiscal Writer [External]. For example, you can scan an incoming nota fiscal and attach it to the nota fiscal you entered into the system.

See also: ArchiveLink [External]

4.9 Authorization Checks

The Nota Fiscal Writer performs authorization checks before users can execute the functions listed below. You need to assign the following activities of the F_NFBA authorization object to the role you use for Financial Accounting (FI) functions:

Page 27: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 27

Function Activity

Create Activity 01

Create using data upload from an MS Excel file Activity 85

Change Activity 02

Display Activity 03

Output Activity 35

Reverse Activity 85

Reprint Activity AA

To do this, from the SAP Easy Access screen, choose Tools Administration User Maintenance Role Administration Roles .

More Information Users and Roles (BC-SEC-USR) [External]

Page 28: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 28

5 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) [Page 28]

Conhecimento de Transporte Eletrônico (CT-e) [Page 86]

5.1 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 [Page 29].

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 [Page 29].

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

Page 29: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 29

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.

5.1.1 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) [Page 79].

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

Page 30: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 30

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

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 79].

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

rbx2014
Highlight
Page 31: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 31

5.1.1.1.1 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.

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

5.1.1.1.2 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 .

5.1.1.1.3 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.

Page 32: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 32

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 [External].

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.

You number and send the document manually in the NF-e/CT-e Monitor [Page 49], 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.

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.

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 [External]).

5.1.1.1.4 Assigning Authorizations Related to Electronic Fiscal Documents

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

rbx2014
Highlight
Page 33: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 33

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 [External].

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

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).

5.1.1.1.5 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:

Page 34: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 34

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.

5.1.1.1.6 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.

5.1.1.1.7 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 [External], or as one posted under central contingency [External] – 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

Page 35: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 35

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 35].

5.1.1.1.7.1 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.

5.1.1.1.8 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.

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.

Page 36: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 36

5.1.1.1.9 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.

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

5.1.1.2.1 Customizing Official Status Codes

The NF-e/CT-e Monitor [External] 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.

Page 37: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 37

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 .

5.1.1.2.2 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.

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.

5.1.1.2.3 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:

Page 38: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 38

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.

5.1.1.2.4 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.

5.1.1.2.5 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.

Page 39: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 39

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).

5.1.1.2.6 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 [Page 76].

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.

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.

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

Page 40: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 40

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.

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

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.

5.1.1.2.7 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 .

5.1.1.2.8 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.

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.

Page 41: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 41

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.

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.

5.1.1.2.9 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.

5.1.1.2.10 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

Page 42: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 42

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.

5.1.1.3 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 80].

5.1.1.3.1 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.

rbx2014
Highlight
Page 43: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 43

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 .

5.1.1.3.2 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

rbx2014
Highlight
rbx2014
Highlight
Page 44: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 44

(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

More Information For information about the outbound interface specific to electronic correction letters (CC-e), see Interface for Outbound CC-e Messages [Page 81].

5.1.1.3.3 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 [Page 77])

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

Page 45: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 45

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).

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 [External].

More Information For information about the inbound interface specific to NF-e events, see Interface for Inbound NF-e Event Messages [Page 81].

5.1.1.3.4 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

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.

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 [External]).

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.

Page 46: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 46

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

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).

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

5.1.2 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.

5.1.2.1 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 47: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 47

5.1.2.1.1 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 [External].

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 [Page 1].

2. You create an electronic fiscal document manually (see Creating a Nota Fiscal) [External] 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 [External] (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 [Page 31] 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 [Page 45] 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 [External] 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

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).

Page 48: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 48

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 [External]).

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 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 [External] mode. You are allowed to: 1) switch individual Document [External] already posted under normal conditions to contingency, or 2) activate contingency centrally [External] for your whole business place or region, after which all newly posted electronic fiscal documents are posted directly under contingency.

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

goods.

Page 49: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 49

5.1.2.2 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 [External].

Prerequisites You have appropriate authorization [External] for carrying out the various user actions in the Monitor.

Features The NF-e/CT-e Monitor:

Shows the status [Page 50] at a glance – whether you must take action

Shows all relevant data for an NF-e [Page 51] (current data as well as NF-e/CT-e history)

Offers user actions possible for each NF-e [External], depending on its status

Allows you to activate or deactivate central contingency processing [External] 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 event [External]s, for example, electronic correction letter [External]s (CC-e) for authorized NF-e. For more information, see Electronic Correction Letters (CC-e) [Page 82].

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 50: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 50

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 66].

5.1.2.2.1 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 [External]).

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

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 51: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 51

[External]).

4 = Request to cancel rejected; check the reason

5 = Request to skip rejected; check the reason

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

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.

5.1.2.2.1.1 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

5.1.2.2.1.2 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)

Page 52: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 52

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 [External]).

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.

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 [External])

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

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

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 [Page 60])

Posted under Contingency

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

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 [Page 50]).

Page 53: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 53

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 [Page 50]).

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 [External]

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

Page 54: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 54

Changed On Shows the date that the status of the electronic fiscal document 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 [Page 35])

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 [Page 34].

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 [Page

Page 55: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 55

34].

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 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 [External]).

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.

5.1.2.2.1.3 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 [External] or outgoing [Page 46], created manually by you or automatically by the system - the system generates the access key and displays it in the Nota Fiscal Writer [External], 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

Page 56: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 56

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 [External].

5.1.2.2.2 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 [External] of the electronic fiscal document.

Prerequisites You have assigned the appropriate authorizations [External].

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 [External].

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 [Page 60].

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.

Page 57: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 57

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 [External].

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 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 [Page 31].

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 [External]).

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 [External].

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 [Page 58].

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

See Document Cancellation [External].

Page 58: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 58

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 58].

5.1.2.2.3 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 [External]), 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 [External]), 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 [Page 60]).

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

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 [Page 68] and Monitor Statuses: Rejection and Subsequent Skipping [Page 69].

You request cancellation of the electronic fiscal document in the NF-e/CT-e Monitor (see User Actions for Individual Documents [External]). 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:

Page 59: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 59

Authorizes your cancellation request

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 [External] 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 [External]). 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.)

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 [Page 32]).

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 50].

Page 60: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 60

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 56].

5.1.2.2.4 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.

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 [External]. The reversal is only possible if no status changes that would prevent the reversal have occurred in the meantime.

Prerequisites You can only switch an electronic fiscal document to contingency processing if the request for authorization [External] 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 [Page 49]; it must have the value blank (not sent) or 0 (sent).

You have also made the required settings for printing configuration [External].

Process

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 [Page 71].

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 [External]).

Page 61: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 61

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

4. Depending on the settings you have done in Customizing (see Customizing for Cancellation under Contingency [Page 37]), 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 [External]

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.

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.

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 [External]).

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:

Page 62: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 62

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 [External]) Alternatively, you can configure the system to automatically send the cancellation request to the tax authorities. See Cancellation under Contingency..

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.

5.1.2.2.5 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 [External].

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 [Page 31].

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 [External].

The required settings for printing configuration [External] have been made.

Process 1. You set a region or business place to contingency in the Monitor (J1BNFE

transaction). For more information, see:

Page 63: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 63

o Activate contingency processing for region [External]

o Activate contingency processing for business place [External]

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 [External]).

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 [Page 73].

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

5.1.2.2.5.1 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.

Page 64: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 64

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 64].

5.1.2.2.5.2 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.

Page 65: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 65

For more information about these settings, (see Messaging-System Control [External]).

5. Enter the reason for posting under contingency.

6. Make settings for other business places as needed and then save your settings.

More Information It is also possible to activate contingency centrally for a region. For more information, see Activating Contingency Processing for Regions [Page 63].

5.1.2.2.6 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

Page 66: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 66

The figure below illustrates the above mentioned process for SCAN.

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 Server AvailableNumber NF-e

Update NF-e Status

Update NF-e Status in NF-e

Monitor

Trigger Creation of

NF-e

Processor

Send Authorization

Request

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.

5.1.2.2.7 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 [Page 67]

Cancellation of authorized documents [Page 68]

Authorization process with rejection and subsequent skipping [Page 69]

Authorization process with validation error [Page 70]

Document switched to contingency [Page 71]

Document posted under contingency [Page 73]

Cancellation prior to authorization [Page 73]

Page 67: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 67

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 51].

5.1.2.2.7.1 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 [Page 66].

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 68: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 68

5.1.2.2.7.2 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 [Page 66].

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.

Page 69: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 69

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

Tax authorities authorize cancellation; cancellation is performed automatically.

C – COMPLETED

1 2 B X

5.1.2.2.7.3 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 [Page 66].

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;

C – COMPLETED 2 4 C X

Page 70: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 70

cancellation is performed automatically.

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 corrected NF-e or reset NF-e and send the corrected version

2 0 A

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

5.1.2.2.7.4 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 [Page 66].

Step ACTION DOC STA

SCS MSS Swt.C Post.C Can.

You create an 9 – Set NF-e

Page 71: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 71

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

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

5.1.2.2.7.5 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 [Page 66].

Page 72: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 72

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 [Page 37].

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 confirms receipt.

“ “ – IN PROCESS 1 1 B X X

Tax authorities authorize cancellation; no automatic cancellation.

C – COMPLETED 1 2 B X X

Page 73: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 73

5.1.2.2.7.6 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 [Page 66].

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

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.

5.1.2.2.7.7 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 [Page 66].

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

Page 74: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 74

STA 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

Page 75: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 75

Tax authorities authorize NF-e.

7 – Request Author. To cancel/skip

1 0 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

5.1.2.3 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 [External] as described below.

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

Page 76: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 76

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 .

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 [External] and Returns [External]). 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 [External], Enter protocol number, for the NF-e, and processing is incomplete.

5.1.2.3.1 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 [External] 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.

5.1.2.3.2 User Decision in Creation of Incoming NF in Mixed Scenarios

Page 77: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 77

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).

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.

Prerequisites You have made the settings as described in Customizing NF Type Determination for Mixed Scenarios [Page 39] 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.

5.1.3 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) [Page 77].

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.

5.1.3.1 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.

Page 78: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 78

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

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.

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.

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

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.

5.1.4 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.

Page 79: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 79

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) [Page 82].

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 .

5.1.4.1 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 .

Page 80: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 80

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 .

5.1.4.2 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 [Page 80]

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 [Page 81].

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.

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 .

5.1.4.2.1 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

Page 81: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 81

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.

5.1.4.2.2 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.

5.1.4.2.3 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

Page 82: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 82

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 44].

5.1.4.3 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) [Page 79].

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 83: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 83

5.1.4.3.1 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:

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

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) [Page 85].

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.

Page 84: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 84

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.

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

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.

Page 85: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 85

5.1.4.3.1.1 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.

5.1.4.4 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 [Page 79]

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.

5.1.4.4.1 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.

Page 86: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 86

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.

5.1.4.5 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 [External].

5.2 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.

Page 87: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 87

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 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 [Page 42]. 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 [Page 89].

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.

Page 88: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 88

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.

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.

Page 89: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 89

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 [Page 47].

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 [Page 60]

o Central Contingency Processing [External]

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 [Page 58].

Skipping CT-e (with authorization request)

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

Checking logs for CT-e

For more information, see Log for Electronic Fiscal Documents [External].

5.2.1 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

Page 90: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 90

in the system documentation for each Customizing activity. For more information, see Customizing for NF-e [Page 29] .

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 91: 06. NF NFe CTe Library March2013

SAP Library 3/6/2013

Nota Fiscal 6773 91

6 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 [External].

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.


Recommended