nfe library v02

40
Electronic Nota Fiscal (NF-e) On State (SEFAZ) and Federal Level Status June 2008 Release SAP ERP 2005/ECC 6.0 (Support Package 15) HELP.CAINTBR

Upload: victorbarros

Post on 02-Oct-2014

245 views

Category:

Documents


11 download

TRANSCRIPT

Page 1: NFe Library V02

Electronic Nota Fiscal (NF-e)On Stat e (S EFAZ) and Federa l L evel

S t a t u s J u n e 2 0 0 8

Release S AP ERP 2005 /ECC 6 .0( S u p p o r t P a c k a g e 1 5 )

HE

LP

.CA

INT

BR

Page 2: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 2

Copyright

© Copyright 2008 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purposewithout the express permission of SAP AG. The information contained herein may bechanged without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietarysoftware components of other software vendors.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of MicrosoftCorporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x,System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM,z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM,Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower,PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner,WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBMCorporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registeredtrademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin aretrademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, WorldWide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license fortechnology invented and implemented by Netscape.

SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessByDesign, and other SAP products and services mentioned herein as well as their respectivelogos are trademarks or registered trademarks of SAP AG in Germany and in several othercountries all over the world. All other product and service names mentioned are thetrademarks of their respective companies. Data contained in this document servesinformational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAPAG and its affiliated companies ("SAP Group") for informational purposes only, withoutrepresentation or warranty of any kind, and SAP Group shall not be liable for errors oromissions with respect to the materials. The only warranties for SAP Group products andservices are those that are set forth in the express warranty statements accompanying suchproducts and services, if any. Nothing herein should be construed as constituting anadditional warranty.

Page 3: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 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 ofinformation at a glance. For more information, see Help on Help General InformationClasses and Information Classes for Business Information Warehouse on the first page of anyversion of SAP Library.

Typographic Conventions

Type Style Description

Example text Words or characters quoted from the screen. These include fieldnames, 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 aprogramming language when they are surrounded by body text, forexample, SELECT and INCLUDE.

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

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

<Example text> Variable user entry. Angle brackets indicate that you replace thesewords and characters with appropriate entries to make entries in thesystem.

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

Page 4: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 4

Nota Fiscal ............................................................................................................................ 6

Electronic Nota Fiscal (NF-e) ............................................................................................. 6

Customizing for NF-e...................................................................................................... 6

NFe-Specific Views and Transactions in Customizing Activities ................................... 6

Mandatory Settings ..................................................................................................... 7

Customizing Nota Fiscal Types................................................................................ 7

Maintaining Number Ranges ................................................................................... 8

Assigning Authorizations for NFe-Related User Actions ........................................... 8

Customizing XML Version ....................................................................................... 9

Maintaining Default Values for the NF-e XML File .................................................. 10

Customizing for Contingency Processing ............................................................... 10

Customizing for Printing Contingency NF as an NF-e ......................................... 10

Customizing for Printing Contingency NF as Conventional NF ............................ 11

Customizing NF Type Redetermination in SD ........................................................ 11

Customizing NF Type Determination for Mixed Scenarios ...................................... 12

Customizing Cancellation Reasons........................................................................ 13

Customizing for CBT Mapping of Base Rates ........................................................ 13

Customizing Alternate Country Keys ...................................................................... 14

Optional Settings ...................................................................................................... 15

Customizing the RFC Destination .......................................................................... 15

Customizing SEFAZ Status Codes ........................................................................ 15

Customizing Automatic Printing of Authorized NF-e ............................................... 16

Customizing for Transition Phase from Conventional NF to NF-e ........................... 16

Customizing IPI Tax Situation for Outgoing NF-e ................................................... 17

Interfaces for Communicating with Messaging System .............................................. 17

Interface for Outbound Messages .......................................................................... 18

Interfaces for Inbound Messages ........................................................................... 18

Interfaces for Messaging-System Actions .............................................................. 19

Business Transactions ................................................................................................. 21

Incoming Electronic Notas Fiscais ............................................................................. 21

User Decision in Creation of Incoming NF in Mixed Scenarios ................................... 22

Outgoing Electronic Notas Fiscais ............................................................................. 22

Requesting NF-e Authorization .............................................................................. 22

Reports ........................................................................................................................ 24

NF-e Monitor ............................................................................................................. 24

Checking NF-e Status ........................................................................................... 25

NF-e Log ........................................................................................................... 26

NF-e Data .......................................................................................................... 26

NF-e Access Key ............................................................................................... 29

Page 5: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 5

User Actions for Individual NF-e ............................................................................ 29

NF-e Cancellation .................................................................................................. 31

Contingency Processing of Individual NF-e Switched Manually .............................. 32

NF-e Processing under Central Contingency ......................................................... 34

Activating Contingency Processing for Region.................................................... 35

Activating Contingency Processing for Business Place ....................................... 35

Process Flows and Corresponding Statuses in NF-e Monitor ................................. 36

Process Flow for Authorization with Subsequent Cancellation ............................ 36

Process Flow for Authorization Process with Rejection and SubsequentCancellation ....................................................................................................... 37

Process Flow for NF-e Switched to Contingency ................................................ 38

Process Flow for NF-e Posted under Contingency.............................................. 39

Check NF-e Number Range Gaps ............................................................................. 40

Page 6: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 6

Electronic Nota Fiscal (NF-e)UseAs of 2007, the Brazilian government introduced electronic notas fiscais (NF-e), whichgradually replace the conventional, hard-copy notas fiscais. Before NF-e are printed and sentwith goods, the state tax authority (SEFAZ) of the state of origin of the NF-e (or, in certaincases, the federal authority) must grant authorization.

PrerequisitesTo work with NF-e, you have made the settings described in the section Customizing for NF-e.

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

ActivitiesYou monitor your NF-e – from its initial posting through its authorization by SEFAZ – using theNF-e Monitor, described in the following documentation.

Customizing for NF-eYou need to make a number of Customizing settings to process electronic notas fiscais (NF-e). These are described in the following documentation.

Settings are classified as follows:

Mandatory

Optional

Related to the configuration of the messaging system you use for communication withthe authorities

NFe-Specific Views and Transactions inCustomizing Activities

Note

If you implement the electronic nota fiscal (NF-e) solution via SAP Note (and not by applyingthe respective support package), the NFe-specific Customizing activities referred to in thefollowing documentation are not available in your system. In this case, you can make theCustomizing settings by using transaction SM30 and entering the relevant view or by usingthe specified transaction.

Page 7: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 7

Below is a list of the technical names of the NFe-specific views and transactions used inCustomizing activities:

Customizing Activity Technical Name ofView

NF-e Configuration for Business Place J_1BNFE_CUST3_4V

Assign XML Version to Region J_1BNFE_XMLV_V

Define SEFAZ Status Codes J_1BSTSCODEV

Define NF Type Redetermination for Goods Movements J_1BNFTYPEREDMMV

Define NF Type Determination for Vendors J_1BNFTYPEREDLFV

Assign RFC Dest. for Outbound Messages to Co. Code and Bus.Place

J_1BNFE_RFCD_V

Define Cancellation Reasons J_1BNFE_CANCELRV

Define NF Type Redetermination per Business Place J_1B_NFTYPEBRCHV

Define NF Type Redetermination per Region J_1B_NFTYPEREGV

Customizing Activity Transaction

Maintain Number Ranges for NF-e J_1BTJ1BI

Mandatory SettingsThe following documentation describes the settings you must make to process electronicnotas fiscais (NF-e).

Customizing Nota Fiscal TypesUseThe system identifies a process that is relevant for electronic nota fiscal (NF-e) processingbased on the nota fiscal (NF) type assigned to the corresponding nota fiscal.

ActivitiesIn Customizing for Cross-Application Components, choose General Application FunctionsNota Fiscal Define Nota Fiscal Types, and set the Electronic NF indicator for those NFtypes that are used for NF-e.

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

Page 8: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 8

Maintaining Number Ranges

You need to maintain one or several number ranges for the external document numbers ofelectronic notas fiscais. You do so in Customizing for Cross-Application Components, bychoosing General Application Functions Nota Fiscal Electronic Notas Fiscais (NF-e)

Maintain Number Ranges for NF-e .

Note

You must assign a unique number range group to each business place. This enables thesystem to identify which business place generated a particular external NF-e number. (Formore information, see Check NF-e Number Range Gaps.)

Assigning Authorizations for NFe-Related UserActions

Many of the user actions that are possible from the NF-e Monitor are subject to authorizationchecks. You make the settings described below to enable the appropriate users to carry outthese tasks.

Note

The NF-e Monitor does not carry out authorization checks when users check the connectionto the messaging system, check an NF-e log, or display an NF-e in the NF Writer.

ActivitiesFrom the SAP Easy Access menu, choose Tools Administration User Maintenance

Role Administration Roles , and assign the following activities of authorization objectF_NFBA to the role you use for Financial Accounting (FI) functions:

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

85 (reverse)

Request an authorization to cancel an authorized NF-e

Set contingency per region or per business place

Request an authorization to cancel a rejected NF-e

35 (output)

Send NF-e with system communication status blank (not sent)

Set contingency per NF-e

Reset contingency per NF-e

Delete NF-e log entries

Page 9: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 9

Resend an NF-e

Request cancellation again for an NF-e

Note

Although it is not for an action that is possible from the NF-e Monitor, you must also enableappropriate users to cancel a contingency NF-e by canceling the related material or invoicedocument in Materials Management (MM) or Sales and Distribution (SD) without prior cancelauthorization from SEFAZ. To do so, assign activity 85 (reverse).

Customizing XML Version

You maintain the XML version that is used to create the XML file to be sent to SEFAZ. Youassign the XML version that is currently valid for the state of origin of your goods or servicesper region or per business place.

SEFAZ has separate servers for production and homologation (test) scenarios. It is possibleto have different versions for these systems at a given point in time in one specific region. It isalso possible to have different versions for these systems in different regions at a given pointin time.

ActivitiesAssign the XML version in one of the following ways:

At business-place level

To do so, in Customizing for Cross-Application Components, choose GeneralApplication Functions Nota Fiscal CNPJ Business Places Define BusinessPlaces . For the relevant company code and business place, choose NFeConfiguration, enter Nota Fiscal - Model 55 in the NF model field, and the date it isvalid from. Then enter the version in the XML Version field.

At region level

To do so, in Customizing for Cross-Application Components, choose GeneralApplication Functions Nota Fiscal Electronic Notas Fiscais (NF-e) Assign XMLVersion to Region and enter the version.

Note

If you assign an XML version at both the business place and region levels, the system usesthe version entered for the business place.

Page 10: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 10

Maintaining Default Values for the NF-e XML File

You maintain default values that must be included in the NF-e XML file that the system sendsto SEFAZ.

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

company code and business place, choose NFe Configuration and specify values for thefollowing fields:

System ID (Type of Environment (Test or Production))

NFe Appl. Vers. (NF-e Application Version )

Value Normal (NF-e Issuing Type Normal)

Value Conting. (NF-e Issuing Type Contingency)

Proc.Identific. (NF-e Issuing Process Identifier)

For. UF Value (NFe - Field value for XML field UF for foreign partners)

For. CMUN Value (NFe - Field value for XML field CMUN for foreign partners)

For. XMUN Value (NFe - Field value for XML field XMUN for foreign partners)

For more information, refer to the respective field help.

Customizing for Contingency ProcessingUseWhen you process an electronic nota fiscal (NF-e) under contingency – either as oneswitched from normal processing to contingency processing [External], or as one postedunder central contingency [External] – you must configure how the system determines whichnumber range and printer to use, based on how you decide to print the nota fiscal:

As an electronic nota fiscal (NF-e), which must be printed on security paper using alaser printer

As a conventional (nonelectronic) nota fiscal, which is printed on a dot-matrix printer.

Accordingly you need to make settings for the case that you print the contingency NF as anNF-e [Page 10], or you print the contingency NF as a conventional NF [Page 11].

Customizing for Printing Contingency NF as anNF-eTo configure printing a contingency nota fiscal as an electronic nota fiscal (NF-e), make thefollowing settings in Customizing for Cross-Application Components, under GeneralApplication Functions Nota Fiscal Output Assign Numbering and PrintingParameters:

Page 11: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 11

For number-range determination in Sales and Distribution (SD) and MaterialsManagement (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 theOutput Device field in the NF-e group box.

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

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

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

Customizing for Printing Contingency NF asConventional NFTo configure printing a contingency nota fiscal as a conventional nota fiscal (NF), make thefollowing settings for number-range determination and printer determination in Customizingfor Cross-Application Components, by choosing General Application Functions Nota Fiscal

Define Nota Fiscal Types

Assign a nonelectronic contingency NF type to the electronic NF type in the NF Contin.Type field. You may use an existing NF type; it just cannot be an electronic NF type.

Output Assign Numbering and Printing Parameters

Assign the NF number range for the nonelectronic contingency NF type in the No.Range No. field in the Normal NF group box.

Do not enter a printer in the Output Device field in the NF-e group box; the system thendetermines the dot-matrix printer based on the configuration related to thenonelectronic contingency NF type.

Make sure the Numbering Contin. indicator in the NF-e group box is not set for therelevant IMG entry.

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

ActivitiesFor 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 ofthe following activities in Customizing for Cross-Application Components, under GeneralApplication Functions Nota Fiscal Sales and Distribution – Billing Documents

Assign Nota Fiscal Type to Sales Document Types

Page 12: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 12

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 theBusiness Add-In in the activity BAdI: Redetermination of Nota Fiscal Type per Line Item(under same path as above).

Customizing NF Type Determination for MixedScenarios

You need to make the settings described below if your company handles scenarios withmixed nota fiscal (NF) types. The settings below enable you to specify whether the user candecide what type of NF should be created – conventional NF or NF-e – when you enter anincoming 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.

ActivitiesMake 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 andmovement type. To do so, in Customizing for Cross-Application Components, choose

General Application Functions Nota Fiscal Electronic Notas Fiscais (NF-e)Define NF Type Redetermination for Goods Movements and maintain entries for

plant, movement type, and NF type, and select the User Decision checkbox.

Note

You have assigned NF types to movement types for normal NF processing in theCustomizing activity Assign Nota Fiscal Category to Sales Document Types. Whenboth activities are maintained, the system uses the following logic:

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

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

NF type determination for vendors

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

In Customizing for Cross-Application Components, choose General ApplicationFunctions Nota Fiscal Electronic Notas Fiscais (NF-e) Define NF Type

Page 13: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 13

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 andvendor without specifying the plant.

Note

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

Customizing Cancellation Reasons

When you request authorization from SEFAZ to cancel or skip an electronic nota fiscal (NF-e), you must specify a reason.

ActivitiesIn Customizing for Cross-Application Components, choose General Application Functions

Nota Fiscal Electronic Notas Fiscais (NF-e) Define Cancellation Reasons and makesettings as required.

In the Cancel Reason field, specify a technical key for the reason to cancel or skip the NF-e.In the column Description, specify the reason, which will be sent in the XML file. You mayassign pre-defined reversal reasons from logistics invoice verification and/or goodsmovements in the columns Reason LIV and Reason GM respectively.

Note

If the cancellation of an NF-e occurs automatically in the background upon receipt of anauthorization to cancel/skip, the system uses the reversal reason for Logistics InvoiceVerification (LIV) or the goods movement as defined in this activity to cancel the relatedinvoice or material document.

Customizing for CBT Mapping of Base Rates

You only need to make the settings described below for mapping base rates if you usecondition-based tax calculation (CBT) for Brazilian company codes (see CalculationProcedure).

Note

The described steps of this section are only necessary for companies that have to calculateSubstituição Tributária.

End of the note.

Page 14: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 14

ActivitiesIn Customizing for Financial Accounting (New), choose Financial Accounting GlobalSettings (New) Tax on Sales/Purchases Calculation Settings for Tax Calculation inBrazil Access Tax Manager’s Workplace (or via Transaction J1BTAX) Condition Setup(...)

Condition Types Condition Types MM

Condition Types Condition Types SD

For either of the options above, create new condition types as follows: create BX45by copying BX44 and entering the short text BR NF Base Rate1, and create BX46 bycopying BX45 and entering the short text BR NF Base Rate2.

Calc. Procedures Calc. Procedures MM

Calc. Procedures Calc. Procedures SD

For either of the options above, maintain calculation procedure TAXBRA as follows:Insert two new steps in the next possible free slot after the step with condition BX44as copy from step with BX44. In the first new step, insert condition BX45, and in thesecond BX46.

Repeat the same steps used for SD calculation procedures.

Condition Mapping Internal Codes

Create the following new internal codes:

NF_SUBTRIB_BASERED1 Federal base reduction rate

NF_SUBTRIB_BASERED2 State base reduction rate

Condition Mapping Assign Conditions to Internal Codes

Assign internal codes to conditions as follows:

Internal Code Application Condition

NF_SUBTRIB_BASERED1 TX BX45

NF_SUBTRIB_BASERED1 V BX45

NF_SUBTRIB_BASERED2 TX BX46

NF_SUBTRIB_BASERED2 V BX46

Customizing Alternate Country KeysUseYou need to maintain the following alternate country keys as defined by the Brazilian Instituteof Geography and Statistics (IGBE) for the system to determine the correct country code andset it for the XML file.

Page 15: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 15

ActivitiesIn Customizing for SAP NetWeaver, choose General Settings Set Countries DefineCountries in SAP Systems, and ensure that the following alternate country keys are enteredin the corresponding field for the following countries:

Country Name Alternate Country Key

BR Brazil 508

CL Chile 512

PY Paraguay 520

UY Uruguay 524

AR Argentina 528

Optional SettingsThe following documentation describes the optional settings you can make to processelectronic notas fiscais (NF-e).

Customizing the RFC Destination

You can assign a different RFC destination for outbound messages than ENF_BR_2006,which is hard-coded.

ActivitiesIn Customizing for Cross-Application Components, choose General Application Functions

Nota Fiscal Electronic Notas Fiscais (NF-e) Assign RFC Dest. for Outbound Messagesto Co. Code and Bus. Place , and make settings as required.

Note

You can also configure the RFC destination that is valid as of a certain date in Customizingfor Cross-Application Components under General Application Functions Nota Fiscal

CNPJ Business Places Define Business Places . For the relevant company code andbusiness place, choose NFe Configuration and enter the RFC destination.

Customizing SEFAZ Status CodesUseThe NF-e Monitor [External] displays the official SEFAZ status codes, such as 100. If youenter a description for the codes in Customizing, the NF-e Monitor additionally displays thedescription in the Single NF-e History section. For example, next to code 100, it displays thedescription Authorized.

Page 16: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 16

ActivitiesEnter the official status codes as defined by SEFAZ and descriptions as required inCustomizing for Cross-Application Components, by choosing General Application Functions

Nota Fiscal Electronic Notas Fiscais Define SEFAZ Status Codes.

Customizing Automatic Printing of Authorized NF-eUseYou must first wait for authorization from SEFAZ to print an electronic nota fiscal (NF-e).Once SEFAZ approves your NF-e and returns a corresponding protocol number, the systemdoes not print the NF-e automatically. You can configure automatic printing by implementing aBusiness Add-In.

ActivitiesIn Customizing for Cross-Application Components, choose General Application FunctionsNota Fiscal Electronic Notas Fiscais BAdI: General Enhancements for NF-e, and createan implementation for the Call Print Program method (CALL_RSNAST00).

Customizing for Transition Phase fromConventional NF to NF-eUseDuring a transition phase from conventional nota fiscal (NF) posting to electronic (NF-e)processing, the legally relevant notas fiscais are nonelectronic, that is, of model 1/1A.However, the NF data is sent to SEFAZ as an XML message as if the posted NF were an NF-e. The model in the XML message must be 55. The NF number is the six-digit nonelectronicnumber.

It is not required to receive an authorization prior to printing the NF. You must print the NF-e(called a DANFE), with or without the protocol number (authorization) from SEFAZ. You sendit, together with the NF of model 1/1A, with the goods. To enable this process, you must makethe settings described below.

ActivitiesMake the following settings as required:

Enable creation of an outbound XML message

In Customizing for Cross-Application Components, choose General ApplicationFunctions Nota Fiscal Output Processing Program, and enter the followinginformation for the relevant output type:

Medium = 1 (Print output)

Program = J_1BNFEXMLOUTPARALLEL

FORM Routine = ENTRY

Form = leave blank

SAP delivers report J_1BNFEXMLOUTPARALLEL, and you can also implement it withSAP Note 1017488. You may optionally implement checks or logic in the report to fill

Page 17: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 17

fields in the XML file: you can fill anything in the file that is not filled by SAP, such asthe XML version during the transition phase. We recommend that you copy this report,and create and modify a Z-version of the report. In this case, insert the Z-report in theactivity above instead.

Customizing the RFC Destination [Page 15] for the parallel phase and, in yourmessaging system, link it to the test system of the government

Enable printing of the DANFE...

a. Upload SAPscript form ZDANFE as described in SAP Note 955155.

b. Extend the printer configuration by creating another entry in the ProcessingProgram activity listed above, with the following data:

Medium = 1

Program = J_1BNFPR

FORM Routine = ENTRY

Form = ZDANFE

Customizing IPI Tax Situation for Outgoing NF-eUseThe XML layout contains separate fields for the IPI tax situation for incoming and outgoingelectronic notas fiscais (NF-e). You can maintain a different IPI tax situation for outgoing NF-ethan the one you have defined for incoming notas fiscais.

The IPI tax situation is also relevant for conventional notas fiscais, so you haveprobably already maintained the value for incoming notas fiscais. The new fieldfor outgoing tax situation has been added because the XML layout contains twofields for tax situation, for both incoming and outgoing NF-e. You only need toenter an outgoing value if it differs from the incoming value.

ActivitiesIn Customizing for Financial Accounting, choose Financial Accounting Global Settings Taxon Sales/Purchases Basic Settings Brazil Define IPI Tax Laws. In the Tax Sit. IPI Outfield, enter an IPI tax situation for outgoing NF-e as required in the appropriate IPI tax law.

Interfaces for Communicating with MessagingSystem

The following documentation describes aspects of SAP back-end functions that are relevantfor communication between the back-end and messaging systems. The messaging systemmust be configured taking these aspects into account.

Page 18: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 18

Note

This section is only relevant if you do not use the SAP GRC NFE solution. The integrationbetween the back-end system and the messaging system in the SAP GRC NFE solution isautomatic. For more information about SAP GRC NFE, see SAP Note 1139220.

Interface for Outbound Messages

The SAP back-end system asynchronously sends messages via the outbound interface RFCcall to XI for Nota Fiscal Electronica (J_1B_NFE_XML_OUT) function module. This interfaceprovides the NF-e data as required by the authorities according to the XML layout that iscurrently valid, together with the NF-e document status, NF-e system communication status,and contingency indicator.

Then, in the messaging system, the NF-e data must be mapped to the layout structure of theXML file.

The NF-e document status and the NF-e system communication status contain informationabout the type of outbound message, which could be one of the following:

1. Request for authorization

2. Submission of a contingency NF-e

3. Request to authorize the cancellation of an authorized NF-e

4. Request to skip the number of a rejected NF-e

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

XML_IN-DOCSTAT

XML_IN-SCSSTAT

XML_IN-CONTING

Message DOCSTAT SCSSTAT CONTING

(1) Request for authorization initial 0 initial

(2) Submission of a contingency NF-e initial 0 X

(3) Request to authorize the cancellation of anauthorized NF-e

1 1 initial

(4) Request to skip the number of a rejected NF-e 2 3 initial

Interfaces for Inbound Messages

Page 19: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 19

The SAP 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-eprocessing

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

Message Code Message Type

1 Authorization of NF-e

2 Rejection of NF-e

3 Denial of NF-e

4 Authorization to Cancel an Authorized NF-e

5 Authorization to Cancel a Rejected NF-e (Skipping)

6 Rejection of a Request for Cancellation

7 Rejection of a Request for Skipping

Mandatory importing parameters are:

Protocol number

SEFAZ status code

Message type

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

Interfaces for Messaging-System Actions

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

Activate and deactivate contingency on business-place level

Set the messaging-system status in the NF-e Monitor

Request NF-e data

Note

The SAP back-end system assumes an NF-e message reaches the authorities once it hassuccessfully been sent to the messaging system. The messaging system must not change

Page 20: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 20

the content of the message or switch an NF-e received from the back end to contingency, asthis would lead to an inconsistency of data between the back end and SEFAZ.

Activate/Deactivate Contingency

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

In the interface, the messaging system must specify the fields LAND1, BUKRS, andBRANCH. The field REGIO must remain initial. The messaging system may select or deselectthe indicator AS_OUT. The back end interprets this indicator. If it is set, the back endswitches to contingency for any subsequent NF-e posting. The indicator can be automaticallydeactivated through the messaging system or manually by a user with the requiredauthorization profile (see Activating Contingency Processing for Business Place).

If the messaging system remotely calls the function moduleJ_1B_NFE_CONTINGENCY_SET, note that the importing parameter IV_FIRE_COMMITmust be set to X.

Set the Messaging-System Status

The NF-e Monitor displays a messaging-system status. The messaging system can set thefollowing 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 MS Received: Request for Authorization

B MS Received: Cancellation Request

C MS Received: Skipping Request

Note

Once the messaging-system status has been set for a message, this means that themessage has arrived at the messaging system. From this moment on, you can no longerresend the respective message requesting authorization, cancellation, or skipping. You canonly request cancellation again for an NF-e that has been rejected by SEFAZ and accepted inthe NF-e Monitor (the system communication status in the NF-e Monitor is 8).

Request NF-e Data

The messaging system can request NF-e data from the back end using the NF-e: MessagingSystem Requests Data (J_1B_NFE_MS_REQUESTS_DATA) function module. The followingrequest type is supported:

Request Type Request Description

1 Send complete NF-e data

Page 21: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 21

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

Incoming Electronic Notas Fiscais

When your goods are delivered, you must check the validity of the accompanying NF-e beforeyou accept the goods. After you verify that the incoming NF-e is valid, you need to enter theprotocol number and random number in the system.

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. Enterthe 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 asdescribed below. For a contingency NF-e, note also that you must keep the incomingNF-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 customeraccepts the goods and posts the NF-e in its system, but later returns the goods. Yourcustomer generates a return NF-e, which is subject to authorization from SEFAZ. Youenter the protocol number and random number of the return NF-e in the NF-e Writeras described below.

ActivitiesYou compare the protocol number printed on the NF-e with the protocol number/authorizationcode of the NF-e stored on the authorities' server.

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

Afterwards enter the protocol number and random number manually in the NF Writer, on theNF-e Data tab, in the corresponding fields (the system automatically derives all other NF-edata from the NF-e posting). Until you complete this step, the NF-e Monitor displays requiredprocess step 6, Enter protocol number and random number, for the NF-e, and processing isincomplete.

Note

The system only checks whether the Protocol No. field is filled. Therefore, you may haveentered the random number, but the system still issues the required process step 6.

Page 22: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 22

User Decision in Creation of Incoming NF in MixedScenarios

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

Example

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

PrerequisitesYou have made the settings as described in Customizing NF Type Determination for MixedScenarios to enable user decision.

ActivitiesWhen you enter the incoming NF following the standard procedure for the relevant goodsmovement transaction that is involved (such as return or third-party process), the systemprompts you to specify conventional NF or NF-e. This dialog box appears after you choosethe Nota Fiscal pushbutton.

Outgoing Electronic Notas FiscaisIf your system is configured accordingly [Page 6] (mainly, the nota fiscal types are set aselectronic), the system generates an electronic nota fiscal (NF-e) in processes in MaterialsManagement (MM) and Sales and Distribution (SD) and stand-alone creation using the NFWriter as described in Nota Fiscal.

Before you can print and send the NF-e, you need to request and receive authorization fromthe state tax authority, SEFAZ (see Requesting NF-e Authorization [Page 22]).

The government allows for a special contingency processing in case you cannot wait forauthorization and you must continue with your operations: you can switch an individual NF-e[External] already posted under normal conditions to contingency, or activate centralcontingency processing [External] for your entire region or business place.

Requesting NF-e AuthorizationPurposeBefore you can print and send the printed version of the electronic nota fiscal (called aDANFE) along with the goods, you need authorization from the state tax authority, SEFAZ.

PrerequisitesYou have made the required Customizing settings [Page 6].

Page 23: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 23

Process Flow2. An electronic nota fiscal (NF-e) is created in one of the following ways:

a. The system automatically generates an NF-e from applications in MaterialsManagement (MM) and Sales and Distribution (SD) as described in Nota Fiscal.

b. You create an NF-e manually using the Nota Fiscal Writer.

When the NF-e is created, the system makes an entry in the NF-e database. You canmonitor the status of the NF-e using the NF-e Monitor [External] (see step 3).

3. The system automatically sends an outbound message to SEFAZ to requestauthorization for the NF-e.

4. You check the status of NF-e [External] using the NF-e Monitor.

5. SEFAZ sends one of the following responses (to the initial request for authorization) viaan inbound message:

a. Authorized

SEFAZ sends the authorization in form of a 15-digit numeric code, which thesystem updates in the NF-e database. You can see it in the Protocol Numberfield, via the NF-e Monitor or via the NF Writer (under NF-e Data). The systemalso updates the corresponding document status, system communication status,and SEFAZ status code (and status code description, if maintained).

b. Rejected

This status indicates an inconsistency in the NF-e data, which you must correctin the NF database. You must cancel the original NF-e, and create another NF-e.

To do so (after correcting the inconsistency in the NF-e data), you must:

i. Request cancellation of the original NF-e (see User Actions for IndividualNF-e [External]).

ii. Wait for response from SEFAZ:

iii. If SEFAZ authorizes your request to cancel the NF-e, you cancel thesource document (and system automatically cancels the correspondingNF-e) or the standalone NF-e created in the NF-e Writer.

iv. If SEFAZ rejects your request to cancel the NF-e, you must confirm therejection in the system (see User Actions for Individual NF-e [External]).

v. Create a new source document or standalone NF-e, and the systemautomatically sends a request for authorization for the new NF-e

vi. After you receive authorization for the new NF-e, you can print the newNF-e

c. Denied

This status indicates a serious problem (for example, taxes have not been paid),and you need to contact SEFAZ to find out why they denied the authorization. Inthis case, you must also cancel the original NF-e (see User Actions for IndividualNF-e [External]), but you do not need to request authorization to cancel. Youcancel the source document or standalone NF-e.

Note

Note that it is possible that you do not receive a timely response from SEFAZbecause, for example, the connection to your messaging system or theauthorities’ server is down, and you cannot wait for authorization or it wouldinterrupt your business. In such cases, the government allows you to continueyour business process by processing in contingency [External] mode. You areallowed to: 1) switch individual NF-e [External] already posted under normal

Page 24: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 24

conditions to contingency, or 2) activate contingency centrally [External] for yourwhole business place or region, after which all newly posted NF-e are posteddirectly under contingency.

6. After the NF-e is authorized, you can print and send it with the goods.

ReportsCountry Version Brazil comes with the NF-e Monitor [External], a report that enables you tomonitor all electronic notas fiscais (NF-e).

NF-e Monitor

UseYou use the NF-e Monitor to check the status of your electronic notas fiscais (NF-e). Basedon the current status of a given NF-e, you can carry out several actions, which are describedin the following documentation.

IntegrationWhen 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 aconventional nota fiscal or an NF-e. If the system creates an NF-e, it stores all NF-e-specificdata in table J_1BNFE_ACTIVE, and makes this information available to you via the NF-eMonitor. The NF-e Monitor also shows the data of NF-e created manually with the NF Writer.

PrerequisitesYou have appropriate authorization for carrying out the various user actions in the NF-eMonitor.

FeaturesThe NF-e Monitor:

Shows the status at a glance - whether you must take action

Shows all relevant data for an NF-e (current data as well as NF-e history)

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

Allows you to activate or deactivate central contingency processing for entire regionsor business places

Enables you to check the status of the messaging system, by choosingContingency Check MS Connection

Page 25: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 25

ActivitiesCall transaction J1BNFE, and select NF-e by specifying selection criteria on the selectionscreen. The output screen displays all NF-e that have been created that fit your selectioncriteria. From there, you monitor NF-e as required.

Note

For an overview of the most common processes and how the process steps are reflected inthe NF-e Monitor, see Process Flows and Corresponding Statuses in NF-e Monitor.

Checking NF-e Status

The NF-e Monitor enables you to see at a glance the current status for each NF-e entry bymeans of the action status icon in the first column. Together with the entry in the secondcolumn, Required Process Step, these values guide you through any necessary steps thatare required for the NF-e to be processed.

ActivitiesCheck the status of your NF-e as follows:

Action Status/Meaning Required Process Step

In process Blank = No manual action required

Completed C = Completed

Normal processing;user must trigger nextstep

2 = Cancel NF-e For example, if you switch to contingency, thenyou must cancel the NF-e (see step 4 of Contingency Processingof Individual NF-e Switched Manually).

3 = Send NF-e to SEFAZ For example, if you posted NF-e undercentral contingency (see step 4 of NF-e Processing underCentral Contingency).

6 = Enter protocol number and random number (see IncomingElectronic Notas Fiscais)

7 = Request authorization from SEFAZ to cancel/skip the NF-e

Error; user musttrigger next step

1 = NF-e contains errors; cancel NF-e and post corrected NF-eThis is for the case that the request for authorization wasrejected or denied (see steps 4b-c of Requesting NF-eAuthorization).

4 = Request to cancel rejected; check the reason

5 = Request to skip rejected; check the reason

Note

Page 26: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 26

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

You can also check the history of the individual NF-e 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.

Example

You switch an individual NF-e to contingency processing. You must manually cancel the NF-eby canceling the corresponding Sales and Distribution (SD) document. The system displays ayellow exclamation mark and step 2 (cancel NF-e). Although you cancel the correspondingSD document in the back-end system, the process step remains as 2 and the correspondingaction status icon remains a yellow exclamation point until you receive the necessarycancellation authorization from SEFAZ. After you receive this authorization, the process iscompleted, and the system updates the process step to C and changes the action status tothe flag icon.

NF-e LogDefinitionA collection of error or warning messages that the system issues automatically for actionsrelated to an electronic nota fiscal (NF-e), for example, when the system identifies an invaliduser action.

UseThe NF-e Monitor displays the log status in the third column of the upper section of the outputscreen. A red flag icon ( ) means that there are log entries for this NF-e. 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 choosingNF-e 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 whenyou have already switched to contingency processing

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

NF-e Data

Page 27: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 27

UseThe NF-e Monitor displays the data of electronic notas fiscais (NF-e) on the output screen, aslisted below. The upper list provides an overview of all NF-e you have selected, with thecurrent status of each NF-e. If you click on a document number from this list, the systemdisplays the history of the individual NF-e in the lower list, with all actions that have occurredthat caused a status change for the NF-e, such as the system communication status. You canpersonalize both of these lists using the standard functions of the SAP List Viewer (seeWorking with Lists).

Note

You can branch to the NF-e itself by selecting an entry from the NF-e Overview with CurrentStatuslist and choosing NF-e Display , or by clicking on the NF-e number from this list.

NF-e Overview with Current NF-e Status: Columns

Column Meaning

Action status icon Graphically displays if action is required (see Checking NF-e Status)

Required process step Describes what action must be taken (see Checking NF-e Status)

NF-e log Shows if there are log entries for an NF-e (see NF-e Log)

Document number Displays the internal nota fiscal document number

Document status Displays the current document status, which is relevant for statutoryreporting. Values can be: waiting for response, authorized, rejected,or denied.

Systemcommunication status

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

Messaging systemstatus

Displays the messaging system status (such as A (MS Received:Request for Authorization))

NF-e switched tocontingency

If set to X, means an NF-e posted normally was later switchedmanually to contingency (see Contingency Processing of IndividualNF-e Switched Manually)

NF-e posted undercontingency

If set to X, means an NF-e was posted under central contingency(see NF-e Processing under Central Contingency)

Canceled If set to X, means that the NF-e was canceled (either automaticallyafter canceling the source document, or manually via NF Writer)

Status code Shows the official status code of SEFAZ, which corresponds to thetype of NF-e response message (such as Authorization)

Printed If set to X, means the NF-e was printed

Direction of goodsmovement

Shows the direction of the goods movement, such as incoming oroutgoing returns of stock transfers

Nota fiscal form Shows the NF-e form, which defines the model and series used to

Page 28: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 28

print the NF-e (such as NF55)

Region of NF-e issuer Shows the region of the NF-e issuer, as contained in the NF-eaccess key

Year of NF-e postingdate

Shows the year when the NF-e is posted, as contained in the NF-eaccess key

Month of NF-e postingdate

Shows the month when the NF-e is posted, as contained in the NF-eaccess key

CNPJ number of NF-eissuer

Shows the CNPJ number of the NF-e issuer, as contained in the NF-e access key

Nota fiscal model Shows the model used for printing the NF-e (model 55)

Nota fiscal series Shows the series, which groups notas fiscais that have onesequentially printed numbering (a company can use different seriesor just one)

NF-e number Shows the nine-digit NF-e number, as contained in the NF-e accesskey

Random number For outgoing NF-e, contains the internal document number createdby the SAP back-end system; for incoming NF-e, shows a randomlycreated number filled by the issuing party

Check digit for NF-eaccess key

Shows the last digit of the NF-e access key

Protocol number Shows the code (protocol number) that the authorities issue witheach response message.

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

Created on Shows the date the NF-e was created

Date of NF-e statuschange

Shows the date the NF-e was changed

Time of NF-e statuschange

Shows the time the NF-e was changed

User who triggers NF-e status change

Shows the user who performed an NF-e action that leads to a statuschange in the NF-e document status, system communication status,or the canceled indicator

Company code Shows the company code that created the NF-e

Business place Shows the business place that created the NF-e

Shipping point Shows the physical location from which the related item wasshipped

Partner ID Identifies the partner related to the NF-e, such as the customer orvendor number

Single NF-e History

Page 29: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 29

The lower table displays selected fields from the upper table, plus descriptions of thedocument status, system communication status, and the status code (if configured).

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

NF-e Access KeyDefinitionA 44-digit key that uniquely identifies an electronic nota fiscal (NF-e).

UseWhen an NF-e is posted – incoming [External] or outgoing [Page 22], created manually byyou or automatically by the system – the system generates the access key and displays it inthe NF Writer, on the NF-e Data tab.

You can use the access key when you communicate to SEFAZ about a particular NF-e.

StructureThe access key comprises the following elements:

Region of the NF-e issuer

Year of NF-e posting date

Month of NF-e posting date

CNPJ number of NF-e 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 inthe NF-e Monitor. For more information, see NF-Data [Page 26].

User Actions for Individual NF-e

The NF-e Monitor allows users to carry out the following actions for individual electronic notasfiscais (NF-e), based on the current status of the NF-e.

PrerequisitesYou have assigned the appropriate authorizations.

Page 30: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 30

ActivitiesSelect a line from the NF-e Overview with Current NF-e Status table and choose the actionsas follows:

Choose NF-e When You Want To

Display Display the NF-e document in the NF Writer.

You can also branch to the NF Writer by choosing the NF-e Documentpushbutton.

Switch toConting.

Switch an NF-e posted under normal conditions to contingency processing.

See Contingency Processing of Individual NF-e Switched Manually.

ReverseContingency

Reverse the contingency processing for an NF-e. Note that you can onlychoose this option for NF-e that you manually switched to contingency bychoosing Switch to Conting.

The system performs checks to ensure that status-relevant actions have notoccurred that prevent reversal. When you reverse contingency, the systemsets the prior status for the NF-e.

RequestCancellation

Request authorization from SEFAZ to cancel the NF-e.

See NF-e Cancellation.

RequestCanc. Again

Request cancellation of an NF-e again, if you received a prior rejection.

Send Send NF-e to SEFAZ in the case it has not been sent yet

If the system communication status is not sent (for example, if theconnection to the messaging server is down), you need to send it. A typicalexample is when an NF-e is posted under central contingency (see NF-eProcessing under Central Contingency).

Resend Resend an NF-e.

You can resend an NF-e request for authorization if all of the followingconditions 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 SEFAZ yet)

Delete LogEntries

Delete the log entries for the NF-e (see NF-e Log)

Accept Canc.Reject.

Accept the rejection (by SEFAZ) of a request to cancel or skip an NF-e

See NF-e Cancellation.

Page 31: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 31

NF-e Cancellation

You cancel an electronic nota fiscal (NF-e) in the following cases, for which you need torequest authorization from SEFAZ (except as noted):

You want to cancel an NF-e that has already been authorized by SEFAZ.

You have received the Rejected response from SEFAZ (see step 4b of RequestingNF-e Authorization), and you therefore need to cancel the original NF-e.

In the case of a rejection, you must cancel the original NF-e and create another NF-e.SEFAZ refers to this processing as "skipping," since an NF-e number, which isnormally sequential and without gaps, is being skipped.

You have received the Denied response from SEFAZ (see step 4c of Requesting NF-e Authorization), and you therefore need to cancel the original NF-e.

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

You cancel the normal NF-e as part of contingency processing for individual NF-e(see Contingency Processing of Individual NF-e Switched Manually).

You cancel a contingency NF-e (either the contingency NF-e that is part of theswitching process, or a contingency NF-e that was created under centralcontingency).

Activities

Note

For a table overview of the steps involved in canceling an NF-e and the correspondingstatuses set in the NF-e Monitor, see Process Flow for Authorization with SubsequentCancellation and Process Flow for Authorization Process with Rejection and SubsequentCancellation.

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

SEFAZ responds to your request for authorization to cancel (or skip) an NF-e in one of thefollowing ways:

Authorizes your cancellation request

The system automatically cancels the NF-e and updates the NF-e status toCompleted.

Rejects your cancellation request

The system updates the NF-e status as follows:

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

o Required process step = 4 (Request to cancel rejected; check the reason) or5 (Request to skip rejected; check the reason)

Page 32: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 32

o Action status = Error; user must trigger next step

In this case, you must explicitly accept the cancellation rejection in the system (seeUser Actions for Individual NF-e). After you do so, the system updates the NF-estatus to Completed, with system communication status 8 (Rejection to Cancel/SkipAccepted by User).

If you do not agree with the rejection, contact SEFAZ. (Until you accept the rejectionin the system, the NF-e has the status of an error and is uncompleted.)

Note

The following are exceptions for NF-e cancellation related to contingency cases:

A normal NF-e that was switched to contingency

You can cancel such an NF-e in the system directly without having received anauthorization from SEFAZ to cancel first.

A contingency NF-e

You can cancel such an NF-e without prior authorization – by canceling the relatedbilling document or material document in the respective transaction. To do this, youmust have the authorization 85 (see Assigning Authorizations for User Actions in NF-e Monitor).

Contingency Processing of Individual NF-eSwitched Manually

You have posted an electronic nota fiscal (NF-e) under normal conditions, but you have notreceived authorization from SEFAZ, for example, the authorities' server is down, and youcannot send your goods with the required NF-e. The system enables you to switch such anNF-e posted under normal conditions to contingency processing, which allows you to print acontingency NF-e to send with your goods.

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

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

Note

You can also reverse contingency processing for an individual NF-e that you manuallyswitched to contingency processing. See the relevant menu option in User Actions forIndividual NF-e. The reversal is only possible if no status changes that would prevent thereversal have occurred in the meantime.

PrerequisitesYou can only switch an NF-e to contingency processing if the request for authorization hasnot been sent, or it was sent with no response received yet from SEFAZ. You can see this by

Page 33: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 33

checking the system communication status of the NF-e in the NF-e Monitor; it must have thevalue blank (not sent) or 0 (sent).

You have also made the required settings for printing configuration.

Process

Note

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

1. An NF-e 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 NF-e to contingency processing (see User Actions for Individual NF-e).

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

4. You cancel one of the following documents as applicable:

1. The source document from the application (for example, the billing documentin Sales and Distribution (SD))

The system automatically cancels the corresponding NF-e.

2. The standalone NF-e you created manually in the NF Writer

In both cases, the system sets an X in the Canceled column in the NF-e Monitor afterthe corresponding NF-e is canceled.

5. You create a document as follows:

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

The printer determination controls whether an NF-e (model 55) orconventional NF (model 1/1A) is created and later printed. Note that toprocess a contingency nota fiscal as an NF-e, you must print the NF-e onsecurity paper.

If your configuration is set up that you print the contingency NF as aconventional NF, then you print it with the NF Writer as model 1/1A, andcontinue with step 8 below.

2. A new NF-e manually in the NF Writer

You must manually set the Posted Cont. indicator on the NF-e Data tab.

6. In the NF-e Monitor, the newly created NF-e is identified as a contingency NF-e by anX in the NF-e Posted under Contingency column.

7. You check the system communication status of the contingency NF-e in the NF-eMonitor. If the status is blank, then you need to send the request for authorizationmanually (see User Actions for Individual NF-e).

Page 34: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 34

8. You print the contingency NF-e from the NF Writer.

9. Depending on the SEFAZ response to the initial request of the original NF-e (fromstep 2, in the case that a request was sent), which you check in the NF-e Monitor,proceed as follows:

1. If SEFAZ sends the response Authorized or Rejected, then you must requestcancellation or skipping of the original NF-e (see User Actions for IndividualNF-e).

If SEFAZ approves the cancellation request, then you do not need to takeany further action. Note that for the process to be completed, the systemcommunication status must be either 2 (Authorized & CancellationAuthorized) or 4 (Rejected & Skipping (Cancel) Authorized), and an X mustbe entered in the Canceled column (from step 4).

2. If SEFAZ sends the response Denied, then you do not need to requestcancellation of the original NF-e. All that is required is to cancel the sourcedocument or standalone NF-e, which you already did in step 4.

If no initial request for authorization was made to SEFAZ, either automatically ormanually, then you do not have to wait for the response from SEFAZ as described in8a/b above. In this case, you directly request cancellation from SEFAZ. When SEFAZauthorizes this cancellation, they call it "skipping," since an NF-e number, which isnormally sequential and without gaps, is being skipped. But from the SAP side, youcancel the NF-e, as described in step 4 above.

ResultYou can continue your business process for an individual NF-e by switching it to contingencyprocessing.

NF-e Processing under Central Contingency

You can activate central contingency if you need to print and send notas fiscais withoutwaiting for authorization from SEFAZ.

After you activate contingency for your entire business place or region, all electronic notasfiscais are processed in contingency mode - both those generated automatically by thesystem from the corresponding application and those you create manually in the NF Writer.

The SAP back-end system allows you to activate central contingency processing if you haveappropriate authorization; there is no check for the reason of the activation.

PrerequisitesYou have assigned appropriate authorizations and made required settings for printingconfiguration.

Process1. You set a region or business place to contingency in the NF-e Monitor:

o Activate contingency processing for region

o Activate contingency processing for business place

Page 35: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 35

2. When an NF-e is posted (automatically or manually), the system checks the printerdetermination to determine whether to print it as 1/1A (conventional) or 55 (NF-e).

The system identifies the NF-e as a contingency NF-e in the NF-e Monitor by an X inthe NF-e: Posted under Contingency column.

3. You can print the contingency NF-e without the normal authorization.

4. Send the NF-e to SEFAZ (even though you do not require authorization) (see UserActions for Individual NF-e).

Note

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

ResultThe system continues to post NF-e under central contingency until you deactivate the settingsas follows:

Manually for the region

Manually or automatically for the business place depending on your activationsettings

Activating Contingency Processing for Region7. On the output screen of the NF-e Monitor [External], choose Contingency

Contingency: Region.

8. For each region for which you want to activate contingency, enter country BR andselect the appropriate region.

Activating Contingency Processing for BusinessPlace...

1. On the output screen of the NF-e Monitor [External], choose ContingencyContingency: Bus.Pl.

2. Enter the country, company code, and business place, and set one of the followingindicators, noting the dependencies between indicators:

MS Down (NF-e: Contingency (Manual/Messaging System Down))

You can set this indicator manually for any reason.

Note that if you set the Act. Cont. Aut. (NF-e: Activate ContingencyAutomatically) indicator, the back-end system can set the MS Down indicatorautomatically when the connection to the messaging system is down. The back-end system can also deactivate contingency automatically as soon as themessaging system becomes available again, as long as the Deact. Cont. (NF-e:Deactivate Contingency Manually) indicator is not set. You set the Deact. Cont.indicator if you want to manually control the switch back to regular NF-eprocessing.

Page 36: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 36

AS Down (NF-e: Contingency (Authorities’ Server Down))

You can set this indicator manually if you identify a problem with the authorities’server. Note that you have to manually deselect this indicator; the back-endsystem does not select or deselect this indicator automatically, but you canconfigure the messaging system to automatically activate contingency via thisindicator (see Messaging-System Control [External]).

Process Flows and Corresponding Statuses in NF-e Monitor

In this section, you find the process flow of the following common communication processesinvolving the electronic nota fiscal (NF-e) and the respective statuses in the NF-e Monitor:

Authorization process with subsequent cancellation

Authorization process with rejection and subsequent cancellation

NF-e switched to contingency

NF-e posted under contingency

Process Flow for Authorization with SubsequentCancellation

The following tables show the steps involved in the process that ends in authorization beinggranted from SEFAZ for an NF-e and then a subsequent cancellation, with the NF-e Monitorstatuses of each step. For more information on the NF-e Monitor status fields, see NF-e Data.

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

NF-e issued 0 ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

0 A ‘ ‘ – IN PROCESS

SEFAZ authorizes 1 0 A C – COMPLETED

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

If you want to cancel the authorized NF-e, you first need authorization to cancel from SEFAZ,which involve the following steps and corresponding NF-e Monitor statuses:

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

Page 37: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 37

Cancellation request sent 1 1 A ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

1 1 B ‘ ‘ – IN PROCESS

If SEFAZ rejects the request to cancel, the NF-e Monitor shows the following statuses:

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: Required ActionStep

SEFAZ rejectscancel request

1 6 B ‘4’ – Request to cancelrejected; check the reason

You analyze the reason and accept the rejection if you agree with it and no longer intend tocancel the NF-e:

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: Required ActionStep

Rejectionaccepted

1 8 B C – COMPLETED

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

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

Cancellation request sentagain

1 1 B ‘ ‘ – IN PROCESS

SEFAZ authorizescancellation, but it is notperformed automatically

1 2 B ‘2’ – Cancel NF-e

You cancel NF-e 1 2 B X C – COMPLETED

Process Flow for Authorization Process withRejection and Subsequent Cancellation

The following table shows the steps involved in the authorization process of an NF-e withrejection and subsequent cancellation, with the NF-e Monitor statuses of each step. For moreinformation on the NF-e Monitor status fields, see NF-e Data.

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: Required ActionStep

NF-e issued 0 ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

0 A ‘ ‘ – IN PROCESS

Page 38: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 38

SEFAZ rejects 2 0 A ‘1’ – NF-e containserrors; cancel NF-e andpost corrected NF-e

Skipping request sent 2 3 A ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

2 3 C ‘ ‘ – IN PROCESS

SEFAZ authorizescancellation; it isperformedautomatically

2 4 C X C – COMPLETED

Process Flow for NF-e Switched to Contingency

The following tables show the steps involved when you switch a normal NF-e to contingencyprocessing, with the NF-e Monitor statuses of each step. For more information on the NF-eMonitor status fields, see NF-e Data.

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

NF-e issued 0 ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

0 A ‘ ‘ – IN PROCESS

You can switch a normal NF-e to contingency-processing mode at any time, as long asSEFAZ has not responded yet to the initial request for authorization.

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

NF-e switched tocontingency

5 A X ‘2’ – Cancel NF-e

You cancel NF-e 5 A X X ‘ ‘ – IN PROCESS

Even though the process for the NF-e switched to contingency still needs to be completed,you can post a new NF-e, which is then a contingency NF-e, to proceed with the businessprocess without authorization from SEFAZ. The next steps then are:

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

SEFAZ authorizes thecancellation of the initial

1 5 A X X ‘7’ – Sent request toSEFAZ to cancel/skip

Page 39: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 39

NF-e NF-e

Cancellation requestsent

1 1 A X X ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

1 1 B X ‘ ‘ – IN PROCESS

SEFAZ authorizescancellation, but it is notperformed automatically

1 2 B X ‘2’ – Cancel NF-e

You cancel NF-e 1 2 B X X C – COMPLETED

Process Flow for NF-e Posted under Contingency

The following tables show the steps involved when you post an NF-e under contingency, withthe NF-e Monitor statuses of each step. For more information on the NF-e Monitor statusfields, see NF-e Data.

Note

An NF-e posted under contingency can refer to either an NF-e posted under centralcontingency or an NF-e that is posted after you switch from normal processing to contingencyprocessing.

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

Contingency NF-e issued,but not necessarily sent

X ‘3‘ – Send NF-e toSEFAZ

This contingency NF-e can be printed immediately on security paper without authorizationfrom SEFAZ.

The next steps are:

Action DOC

STA

SCS MSS Swt.

C

Post.

C

Can. NF-e: RequiredAction Step

You send NF-e 0 X ‘ ‘ – IN PROCESS

Messaging systemconfirms receipt

0 A X ‘ ‘ – IN PROCESS

SEFAZ authorizes 1 0 A X C – COMPLETED

Page 40: NFe Library V02

SAP Online Help 07.11.2008

Nota Fiscal 6765 40

Note

You can cancel a contingency NF-e without prior authorization from SEFAZ. However, youmust send the request to cancel subsequently.

Check NF-e Number Range Gaps

The external electronic nota fiscal (NF-e) number must be sequential and without gaps. Youcan have a number gap when an external NF-e number is used, but no actual NF-e iscreated. In such cases, you need to send a skipping request to SEFAZ.

You can use the Check NF-e number Range Gaps (J_1BNFECHECKNUMBERRANGES)report to identify gaps in the NF-e numbering range and send skipping requests to SEFAZ.

PrerequisitesYou have assigned the number range defined for an NF number group to the correct businessplace (see Maintaining Number Ranges).

Note

The assignment of the number range group to the respective business place must be unique.This means that the same number range group must not be assigned to more than onebusiness place. This enables the system to identify which business place generated aparticular external NF-e number, which must be included in the skipping request to SEFAZ.

ActivitiesEnter the required selection criteria: company code, business place, NF model, and reasonfor skipping the NF-e. If you wish to send the skipping request to SEFAZ, select the RFC Callcheckbox and specify the type of call. If you want to view the results, select the ALV Listcheckbox.