Académique Documents
Professionnel Documents
Culture Documents
Introduction :
Companies selling products in Brazil must send each invoice electronically to the
government for validation before shipping their goods.
Companies purchasing goods in Brazil must check the electronic invoice at the government
before receiving the goods.
Bottom line: The government wants to be sure they are getting all of their tax revenue.
Companies need to handle these activities with an automated solution that can scale to high
volumes of invoices and meet their business process requirements.
Software Components:
NFE Core application : Software Component SAPBO SLL NFE 10.0 for the core application
of SAP Business Objects NFE. This includes three software units :
SAP_ABA 7.02
SAP_BASIS 7.02
PI_BASIS 7.02
PI ESR Content SAPBO SLL-NFE 10.0 on SAP Net Weaver PI system.
Adobe Document services (ADS) installation is optional for displaying preview of the forms to
be printed.
Integration:
Based on the system landscape we can connect one or several logistics system to NFE such as
SAP ERP.
Integration Steps:
Setup of system communication between SAP ERP NFE SAP PI:
RFC connections need to be setup in SM59 so that the three systems can communicate with
each other for data communication.
Business partners in SAP NFE :
Business partners that will be taking part in the electronic exchange of NFE need to be setup
in the core application. Status code information is also stored in the core application.
SLD Setup :
The SLD is mandatory for using SAP Nota Fiscal Electronica content in SAP Net Weaver PI.
This is required to maintain details of the business systems/technical systems which will be
involved in the process.
ESR Import :
SAP Standard software component SLL-NFE 10.0 import is required in SAP Net weaver PI.
Note : The ESR content will be SAP standard so there is no need to develop integration
objects in ESR.
Integration Directory Configuration :
ID configuration is required to create configuration scenarios based on integration scenarios
from ESR. We have to maintain the adapter configuration like SOAP/HTTP/XI which are
required for end to end communication between SAP , Authorities and business partners.
Digital Signature Service :
The authorities require that all request messages like authorization, cancellation, and
skipping requests are digitally signed. A web service for signing the messages need to be
deployed at a Net Weaver java server. This service can then be reached by SAP PI for
signing the documents.
Summary :
By integrating to the relevant systems, SAP Nota Fiscal Electronica is a centralized data store for the
message exchange, regarding the communication with the authorities, and other companies
systems in the B2B scenarios. SAP NFE is the central platform for the legally required storage of the
exchanged files.
Gaurav Ranjan
NFe Outbound / NFe 10.0 / NFe
GRC Part 1
Date: July 12, 2015Author: leandropia
https://sapbr.com/
The first NFe (Electronic Nota Fiscal) was issued in Brasil in September, 2006
and that became mandatory for most of the companies in 2009/2010.
While official Layout changed from 1.00 to 2.00 and then to 3.10 (actual) along of
those years, SAP delivered and has been enhancing over the years the NFe
Solution to follow those changes and meet the legal requirements.
Many people that I know still reject to engage in a NFe Project because they are
afraid to fail for not having the opportunity to do it before.
The idea of this (and the next postings) it is to show you that implementing the
NFe changes can be simple if you think simple.
Before coming to this blog, there are several other sources of information that
you can go first.
SCN NF-e & SPED Community Content is in portuguese but you can always
use google translator or use that as an excuse to learn Portuguese (Im kidding,
dont waste your time learning portuguese)
NFE Boas discusses Leia antes de postar Here a list of several different
topics, a little bit out of date but still good to review
Before you start configuring, I also recommend to review the OSS Notes below:
2057942 Guideline for NF-e layout 3.10 implementation in ERP and SAP NFE
2123768 KBA [3.10] NF-e 3.10 go-live checklist for SAP NF-e GRC
2125859 KBA [3.10] NF-e 3.10 go-live checklist for SAP ERP
And dont forget to implement the latest SLL-NFE Support Package (currently
SP21)
I am not going to discuss a scenario in specific. You will see here only the
general concept, but keep in mind that before start configuring, you should work
on an assessment, map the scenarios, the different processes and requirements
for issuing NFe in your company/customer.
So, lets see how to configure the NFe system (Aka GRC NFe). Most (but not all
of them) of the Configuration in SPRO are organized as following:
1) Maintain Own Tax Numbers
It couldnt be simpler than that: Here you enter your companys CNPJ (one entry
per business place), Type a description (Business Place Name for instance), and
the UF region in which the CNPJ is registered.
Table: /XNFE/V_TCNPJ
SPRO > Nota Fiscal Eletronica > General Settings > Maintain Own Tax Numbers
This is usually maintained by Basis, so, if you are not comfortable handling it or
you dont have the proper authorization, dont get shy asking someone on Basiss
team to do that for you
For every Secure Store and Forward (SSF) application, you must import the
certificates that you have purchased from the authorities. This is done in the
Trust Manager. Here define and monitor the personal security environments
(PSEs) in the SAP system, which are used for digital signatures and encryption
in SAP systems.
SPRO > Nota Fiscal > General Settings > Signature > Maintain System Security
Information
You receive an overview of existing SSF applications and you must create
entries for each of your own tax numbers. Here you specify the application-
independent parameters for using the SSF (secure store and forward) functions.
The applications that use the SSF functions do not all have to use the same
security environment.
SPRO > Nota Fiscal > General Settings > Signature >Maintain Application-
Dependent SSF Information
Here is one more activity that it is usually maintained by someone on Basis team,
the RFC connection. Starting from naming the logical destinations, create the
Logical Destination entries to be used in the RFC connection in this customizing.
SPRO > Nota Fiscal > Communication to ERP Back End System > Name the
Logical Destination
Define the logical systems to which you want to connect your SAP Nota Fiscal
Eletronica (SAP NFE) system. A logical system needs to be defined for each
back-end (ERP) system to enable your SAP Nota Fiscal Eletronica system to
establish a connection with the ERP system.
You need an RFC destination for each logical system that you want to connect
with your SAP Nota Fiscal Eletronica system.
You use the tax number of your company to define the storage location of the
digital certificate that you will use for digital signatures, and whether or not you
use the productive or homologation system environment, the digital certificate is
required.
SPRO > NOTA FISCAL > OUTBOUND > MAINTAIN SYSTEM RESPONSE FOR
OWN TAX NUMBERS
For each CNPJ, maintain the Business Place description, KeyStorageView, Key
Storage Element and SSF Application (ask Basis if you dont know).
8) Define Authoritys Tax Code
Here it is defined the codes and their descriptions that the authorities can use as
answers to an electronic message in communication for handling notas
fiscais. Based on this list, you can see in the application how official code affects
the status of the NF-e. The assignment of a code to a clear description makes it
easier for you to initiate follow-on activities and fix issues.
SPRO > Nota Fiscal > Outbound > NFe > NF-e: Define Authoritys Status Code
Table /XNFE/TSTAT
You can find an updated list here in this link:
Here you can make the settings for the process steps processing the NF-e, CT-e,
events. The process steps are derived from the business process that is
assigned to the document.
You can for example, deactivate the B2B Output to an specific scenario (NFe
issued w/o batch) or do that to an specific receiver CNPJ/Sender CNPJ.
See below an example suggested by Jose Nunes in this SCN Post:
To deactivate the B2B Events (Correction Letter and Cancellation) only to the
Partner Carrier
Step 1: SM30
Via SM30, select table /XNFE/PROCSTEP and click Maintain. Go to Menu ->
Selection -> By contents, select Process Step ID = B2BOUTCA
Uncheck the field Nec. Step. That will make possible to deactivate this step via
SPRO.
Step 2: SPRO
SPRO > Nota Fiscal Eletronica -> Outbound -> Maintain Control Parameters for
Process Flow
Here is where you will determine the business partners with whom you want to
exchange electronic documents.
You will maintain here for example the Customers that will receive B2B
communication when you are issuing a NFe (Like the XML via email for
example). To do that, add customers CNPJ and Select X Communication via
PI.
To process stock transfer orders (STO) Plant to Plant into same Company
Code you must enter the B2B communication to DB for every branchs CNPJ.
You dont have to go through PI for that, since your branches share the same
Database.
SPRO > Nota Fiscal Eletronica -> Outbound -> Activate B2B Scenarios for
Business Partners
Same as above, however you maintain here CPF (Natural Person IDs)
SPRO > Nota Fiscal Eletronica -> Outbound -> Activate B2B Scenarios
for Natural Persons
12) NF-e: Maintain Connected Government Systems
This is a new customizing that came with the 3.10 Layout changes on SAP.
It cant be simpler than that: you configure the settings that the system needs for
deciding to which government system your messages are to be sent.
SPRO > Nota Fiscal Eletronica -> Outbound -> NF-e -> NF-e: Maintain
Connected Government Systems
On Logical Destination you enter the RFC Logical Destination (Steps 5 and 6 on
previous post in this blog). Companys Own CNPJ, thats easy your business
place CNPJs; CUF is the Region where the Business Place is located and
Environment you will use Homologation and Productive system accordingly.
NFe Outbound / NFe 10.0 / NFe
GRC Part 3
Here it is determined which XML version is used for individual message types
when communicating with authorities.
SPRO > Nota Fiscal Eletronica -> Outbound -> NF-e -> NF-e: Maintain Version
of Message Types (/XNFE/V_XMLVERNF)
If you are issuing Outbound NFe you need to maintain the entries below:
If you are also using the Receiver Acknowledgment you need to maintain 4 new
EVE:
Enter here the settings to automatic query of system availability for NF-e
on SEFAZ and the responsible contingency system. You are required to query
this status and can control the status query dependent on your batch planning or
document volume.
SPRO > Nota Fiscal Eletronica -> Outbound -> NF-e -> NF-e: Define Query for
Service Status for Authority (/XNFE/V_TCUFNF)
To each cUF where you will issue a NF from you have to maintain an entry here.
Maintain the Interval in seconds and the timezone according to where the
Business Place region is located and for contingency system you maintain 43, 91
or SC where:
SC SCAN
cUF using SVC-AN (91) Sefaz Virtual de Contingncia Ambiente
Nacional: AC, AL, AP, DF, ES, MG, PB, RJ, RO, RR, RS, SC, SE, SP, TO
cUF using SVC-RS (43) Sefaz Virtual de Contingncia Rio Grande do Sul:
AM, BA, CE, ES, GO, MA, MS, MT, PA, PE, PI, PR, RN
You can still use the SCAN in parallet with the SVC contingency mode (I will talk
later about SVC)
Define the parameters for collecting NF-es in batches and perform the batch
request for each region used in your company.
These parameters have a high influence on the CPU usage, disk usage, and
overall performance of SAP NFE. Therefore, change the parameters according to
your business needs and try to create the batches with the highest NF-e number
in an acceptable time. Be aware that using small values for Max. Collecting Time,
Max. Batch Size or Max. Number of NF-es increases the number of batches.
This can provoke processing performance problems. The creation of NF-e
batches is also influenced by the way you scheduled the job for the batch report.
SPRO > Nota Fiscal Eletronica -> Outbound -> NF-e -> NF-e: Maintain Batch
Parameters (/XNFE/V_BATCHPAR)
If you are using the settings below:
If you issue 100 NFes on ECC there are 100 NFes to be signed which means +/-
4 Messages exchanged with PI to each document, or a total of 400 XML (the
signature is individual)
In a scenario of 1 NF per batch as above, 100 batches , each batch will have +/-
6 messages sent to XI to be sent to SEFAZ and +/- 6 Messages at the XI to
answer back to the GRC, that gives you 1200 XML between PI and GRC and
200 communications between PI x SEFAZ.
In the proposed (recommended) scenario below, with 50 NFes per batch to the
same 100 NFes:
For more details of every individual process, refer to the link below (where I copied
the information above because I was too lazy to explain with my own words):
The monitoring options in SAP NFE gives you the ability to tracking the status of
NF-es, batches, Service Status and etc, via communication process between
NFE application and SEFAZ system. You can also use the monitors to, in case of
errors, troubleshooting, resending and rechecking of NF-es, batches, events and
etc.
To activate the monitors (and that has to be done at the client level), go to SICF,
Select Service Name XNFE and hit enter. Use the navigation tree for the Virtual
Hosts/Services : default_host > sap > bc > webdynpro > xnfe
You will have to activate (by right clicking and selecting Activate) the following
monitors to NFe Outbound:
NF-e
/nfe_monitor_new
/nfe_outb_monitor
/event_monitor
/batch_monitor_new
/nfe_batch_monitor
/event_batch_monitor
/STATUS_MONITOR_NEW
/nfe_servsta_monitor
/NFE_LISTSTA_MONITOR
/nfe_analytics_out
Administration
/download_mass_xml
/ssf_maintenance
/nfe_monitor_arch
/NFE_OUTB_MONITOR_arch
/nfe_fisc_workplace_arch
18) NFe Outbound Roles and Authorization
SAP NFE contains the following roles with their relevant authorization objects.
/XNFE/WP_NFE_OUT_MONITOR
This role does not contain authorizations and is therefore only meant to create
and set up the user menu for the NFE Outbound Monitors. You can copy this role
to adjust the user menu according to your requirements. This role can be
combined with other roles in a composite role.
/XNFE/WP_NFE_ADMIN
This role is intended for the NFE Administrator. It does not contain
authorizations and is therefore only meant to create and set up the user menu.
You can copy this role to adjust the user menu according to your requirements.
This role can be combined with other roles in a composite role.
You will have to schedule the jobs below. You can do that using SM37:
And yes, be prepared to many issues. NFe is not like vanilla ice cream you will
have to work also on BAdI enhancements to the XML and DANFE Printing, but
thats is whole another subject
This posting is a summary of subjects that you will see on the next posts here
in this blog. Maybe not on this sequence, since I am planning mix concepts with
technical details and examples.
These reports are submitted to Municipal (City), State and/or Federal Tax
Authorities. As interpretation of the law changes from company to company
according to the business, size, special requirements and several other
combination of possibilities, this always will make it more difficult to SAP develop
a solution that will work 100% for your company. For that reason you must keep
in mind that: you will need to have the right resources (like FI, CO, MM, SD,
ABAP) to configure and make the standard reports work and to the ones that are
not delivered by SAP you will need to develop it on SAP (or use a 3rd partner
software doing interface on SAP for these reports).
Before start talking about what is delivered by SAP and what it is not, I want to
bring to your attention that, using a 3rd partner software as tax solution for the
reports that are not delivered by SAP should be the LAST option. In a future post
I will explain why you should not start considerign to use a bolt-on or interface for
that instead using SAP as much as possible.
It is very difficult to list ALL legal / tax reports and files mandatory for all
companies in Brazil, but I will list the most common in use:
CIAP Fixed Asset Tax Credit Control (CIAP Controle de Crdito do Ativo
Permanente)
LALUR/CSLL
DIPJ (DIPJ)
FCONT
GIA ICMS Information File Monthly and Yearly (GIA Guia de Informao do
ICMS (Mensal e Anual))
IRPJ / LALUR
Yes, but I have to say that it is missing many others. Some of them are very
specific for some industries, for example, Gas & Oil, Pharmaceuticals,
Chemicals, Transportation, Services providers, and etc., they all have very
specific reports to their kind of businesses. Only 30% of the reports above are
covered in Standard by SAP, nevertheless it will be necessary to configure and
adjust to your business model; The others 70% if your company is required to
report, you must consider develop it on SAP using ABAP development.
On the next posts I will talk about the reports that are delivered by SAP and the
most important ones, such as: SPED Accounting ECD, SPED Contributions EFD
(PIS/COFINS), SPED Fiscal EFD (ICMS/IPI).
These are others legal requirements for most of the companies in Brazil, they are
not a legal report, but legal documents, webservice based communication and
real time process required to keep your business running, invoicing your
customers and receiving goods in your company:
I will talk about these Legal Obligations above in separated posts, otherwise,
this post will never finish