Sunteți pe pagina 1din 13

How to implement Nfe (GRC PI).

This document considers some requisites and needed configurations to let the GRC, ECC and PI/XI systems configured to work correctly in Nfe sceneries.

Project Requirements
// Infra-structure
1. Provide the servers with SAP NetWeaver / GRC NFE installed (including internal security requirements already applied). We recommend the installations of SAP Netweaver 2004s SR3 (this installation should include SAP PI and may have SAP Portal for the future). Below, some requirements: Abap Environment: Component version a. SAP_ABA 0014 b. SAP_BASIS 0014 c. PI_BASIS 0014 d. SAP_BW 0016 Java Environment: Service package 14 System landscape directory: Model Version (sld/active): 1.5.32 SAP CR Content Version (sld/active): SAP_CR 4.0 (produced 04/24/2008) or newer version The GRC NFE can be installed as an additional client in the same SAP ABAP instance as SAP PI.

2. Provide landscape detail, including SAP R/3, SAP PI, SAP Portal, number of users for each application, SAP Web Dispatcher, etc 3. Proxy users creation for the project team (Internet external access); 4. Proxy user creation for external access to SAP PI. This user is used for Secretarias de Fazenda (SEFAZ) communication and its password must never expire, otherwise, the communication with will be compromised. 5. What is the planned DEV/QA environment structure? There will be more than one environment or a single one? If the company has opted to use SAP portal, it will be installed on the same server or another?

How to implement Nfe (GRC PI).


// Fiscal
Digital Certificate

1. Partner definition for digital certificate acquisition; 2. List of root CNPJs that will be used for printing notas fiscais; 3. Prepare documentation for the companys acquisition of digital certificate (for example, in the CertiSign case): a. Commercial register, in the individual company case; b. Constitutive act, statute or contract in force, properly registered, in the case of commercial companies or civil, and, in the case of companies limited by shares, together with documents of election of its directors; c. Proof of registration in the Cadastro Nacional de Pessoas Jurdicas (CNPJ); d. Proof of registration in the Cadastro Especfico do INSS (CEI), if applicable. 4. The requisition of the item 3 is made by a person legally responsible for the company, which generally must submit the following documents: a. Photo 3x4 recent; b. Identity card or Passport, if foreigner; c. Cadastro de Pessoa Fsica - CPF; d. Proof of residence; e. Nmero de Identificao Social-NIS (Cadastro do Programa de Integrao Social-PIS, Cadastro do Programa de Formao do Patrimnio do Servidor Pblico-PASEP or Cadastro de Contribuintes Individuais do INSS-CI), se aplicvel; f. Cadastro Especfico do INSS-CEI, if applicable; g. Ttulo de eleitor, if applicable; 5. Agenda of the companys legal responsibility as the person responsible for digital certificate for signing of terms of ownership and responsibility. This terms guarantee that the company is itself. The legal responsible should be legal in the contract of the company.
States

1. Validate any peculiarities on issuing the notas fiscais (for example, addition of any additional stamp for the note, printing more than one copy of the DANF-e, etc.); 2. Understand special arrangements (regimes especiais) that the company has today within the states; 3. Validate the states where the company printing nota fiscal (RJ, ES, MG); 4. Request the registration of the companies to begin the printing the nota fiscal in jul/2009. Please include the full CNPJs.

// Currency Paper (Papel-Moeda)

1. Definition of the suppliers who could assist the company in the acquisition of this papers; 2. According to the model the DANF-e (landscape or portrait), set quantities to be purchased by company. Different definitions company could impact these acquisitions;

How to implement Nfe (GRC PI).


3. Validation of place of printing of tax stamps and numbering of the currency paper to close the programming of SmartForms within the SAP (agreements with graphics, too, if necessary)
Technical Requirements

1. Creation of users to customize the environment of SAP DEV (may be interesting to providing assistance for DEBUG rights of the tests when the project). We believe that it will require the provision of 5 users SAP (with the right to be 2 developer); 2. Creation of user within the development environment SAP for integration with GRC NFE (user system / communication). We suggest that this user has initially SAP ALL role, if necessary we can try to narrow its rights along the project (this task should be supported by a basis professional from the customer). 3. Planning for the creation of users for other environments (QAS and PROD) and the rights available in each environment. 4. Internal policies for creating requests and transport of objects between environments.

DANF-e

1. Validation and deployment of internal programs for printing notes tax (programs SAPScript); 2. Definition of use of the model portrait or landscape for companies of the group (portrait model favors the print of more items and possibly more additional lines in the texts, while the landscape design allows greater spacing for the columns, especially if the notes contain high values); 3. Validation of additional information in the printing moment; 4. Printing of additional elements in the tax notes as invoice banks, certificates of quality and others.

SAP Notes

1. List of notes that must be implemented within the SAP environment for communication with the GRC NFE (listed in this document); 2. Validation of internal mechanisms for implementation of Notes (Snot, manual, etc.); 3. Validation of internal procedure for setting up key elements of the marketplace within the SAP (the application of certain notes can request new keys to development).

// NF-e Authorization
New authorization object that has to be associated to our users:

User Action Request an authorization to cancel an authorized NF-e Request an authorization to cancel a rejected NF-e Set Contingency per Region or per Business Place Delete NF-e log entries

Auth. Object F_NFBA F_NFBA F_NFBA F_NFBA

Activity 85 [reverse]) 85 [output]) 85 [reverse]) 35 [output])

How to implement Nfe (GRC PI).


Send NF-e with SCS ' ' (not sent) Set Contingency per NF-e Reset Contingency per NF-e Check XI connection Check NF-e log Display NF-e in NF writer F_NFBA F_NFBA F_NFBA no check no check no check 35 [output]) 35 [output]) 35 [output])

Project Configuration
1) SAP NLL-NFe product has to be registered in SLD.(BASIS Team) Done!

Before the configuration of the NFE XI Content can be executed in the Integration Directory (as indicated in the RKT), some tasks need to be performed in the SLD. As indicated above, there are two application components for the GRC NFE internal components: 1 for the Java component, 1 for the Core component (ABAP Add-on). Hence, two Business Systems (1 of type WAS Java and 1 of type WAS ABAP) are necessary in SLD, to represent these components. Also, in order to properly configure all the scenarios (with the relevant routing conditions), it is necessary to add the NFE Product & Software Components versions to the Technical/Business Systems. You find these in the Software Catalog of SLD. The association should be as shown below.

How to implement Nfe (GRC PI).

The SAP Nota Fiscal Electronica 1.0 Product Version and the nested Software Component Versions are included in SAP Component Repository Content (SAP CR Content) starting on version 3.10. To check the current SLD CR Content version, in SLD home page, go to: Administration -> Details -> Data tab, and check the SAP CR Content Version value. As of SLL-NFE SP02, the NFe Schema Validation was released. This validation makes sure that no wrongly formatted data is included in the NFe XML messages. In order to activate the validation for a configured branch, just mark the "Validation" flag in the Configure System Response for Each Tax Number (CNPJ) customizing view for NFE, in SAP IMG (transaction code SPRO), as shown below.

If an NFe sent from backend is invalidated, an automatic message is sent back to the ERP with a rejection status, so that the necessary corrective measures are taken, and the further processing steps (digital signature, batch association etc.) are not executed. In order to check the validation log (with the invalidated fields), click on the "Log Display" button of the NF-e

How to implement Nfe (GRC PI).


Details screen, as shown below. A popup with the validation log will be open.

2) Communication User Details (BASIS TEAM). As of SLL-NFE SP03, two new user roles were released in order to make it easier to configure the communication between the several components of the NF-e data exchange process. These user roles can also be created through manual steps, following the recomendations of SAP Note 1223469. On a simplified view, the communication process is as follows:

How to implement Nfe (GRC PI).

Each communication step is described below. I - RFC Communication between ERP & GRC NFE a) Communication from ERP to GRC NFE In ERP, it is necessary to create a RFC Destination of type 3 (R/3), in order to send the NF-es to GRC NFE. In this RFC Destination, define a service user from the GRC NFE system which contains the /XNFE/RFCSERV role.

A dialog user can be used temporarily for debugging & testing purposes, but should be avoided for productive scenarios.

b) Communication from GRC NFE to ERP In GRC NFE, it is also necessary to create a RFC Destination of type 3. This RFC Destination must be defined with a service user from the ERP system with the necessary authorizations for the ERP processes (at least, the S_RFC & F_NFBA authorization objects are necessary).

A dialog user can be used temporarily for debugging & testing purposes, but should be avoided for productive scenarios.

There is also the necessity to associate this RFC Destination with the ERP Logical System Name (as described in the RKT), in BD97 transaction (if necessary, create the ERP Logical System Name in the GRC NFE system through BD54 transaction). II - Proxy Communication between ERP & GRC NFE a) Communication from GRC NFE to XI In order for GRC NFE to communicate with XI, it is necessary to maintain a HTTP Destination (RFC Destination of type H) in the GRC NFE system, pointing to the XI system. It needs to have the path prefix as /sap/xi/engine? type=entry.

This HTTP Destination should use the PIAPPLUSER in order to log on PI.

b) Communication from XI to GRC NFE (Andr Ramalho PI/XI Consultant) In order for XI to return the response messages to the GRC NFE system, it is necessary to create a HTTP Destination in the XI system pointing to the GRC NFE system, with the same path prefix as above. As for the user, create a service user with the /XNFE/PRXYSERV role.

How to implement Nfe (GRC PI).


In the Integration Directory, in the Receiver XI Communication Channel pointing to the GRC NFE system, use this HTTP Destination, as shown below:

III - SOAP Communication between XI & Digital Signer (BASIS Team) Create an user with at least the SAP_J2EE_GUEST role needs to be used. The Digital Signer Web Service address is always in the following format: http://<server>:<port>/DigitalSignature/ws?style=document Important information where <server> and <port> are relative to the J2EE Engine where the Digital Signer was deployed. IV - SOAP Communication between XI & Government Systems The authentication for the communication from XI to the Government Systems is done through the use of digital certificates, as described in the RKT, so no user details are needed. 3) Notes to be implemented on ECC and GRC systems (Responsible are described in attached document).

Relao_Notas_ECC _GRCNFe_972003.xls

4) Deploy SLL-NFE-JWS (BASIS Team). For the deploy of the Java component of SAP GRC NFE (SLL-NFE-JWS), please check the SAP GRC NFE 1.0 Master Guide (http://service.sap.com/instguides -> G -> SAP GRC Nota Fiscal Electronica -> Using SAP NFE 1.0);

How to implement Nfe (GRC PI).


5) Import XI Content to Integration Repository (Andr Ramalho PI/XI Consultant). 6) Implement Support Packages (BASIS Team).

These are the sup. Packages to be installed.

7) Configure SPRO transaction with the CNPJ /SEFAZ/Status Code ( SD team) and in transaction SNUM, configure /XNFE/BAID range number( BASIS Team). This document will explain peer-to-peer how to implement the 7th process.
SAP_Nota_Fiscal_Ele ctronica-SAP_NFE1.0_Custom izing.pdf

8) Grc Monitor (BASIS Team). In transaction PFCG adjust the role /XNFE/USERMENU with server and port In transaction SICF, activate Items: default_host/sap/bc/webdynpro/xnfe, /sap/public/bc (ur, icons, icons_rtl, pictograms, webdynpro e webicons), /sap/public/myssocntl e /sap/xi (adapter_plain, cache, cache_ssl e engine).

9) Create HTTP destination connection in ABAP System, PI Integration Server(INTEGRATI

How to implement Nfe (GRC PI).


and to PI Application System(BASIS Team). 10)

Access transaction bd54 to add Logical Systems from R/3 DEV, QAS and PRD (B

11) Access transaction bd97 to associate RFC Destination in Logical System corresp This document will provide the solution to implement the 9 th , 10th and 11th processes
system _com m unicati on.pdf

12)

In transaction SXMB_ADM -> Integ. Engine Config., check the Is and AS, Insert t Integration Server(BASIS).

(Eg.:dest://INTEGRATION_SERVER_PID) and habilitate the successful messages log in sxi_mo

13) 14)

Register and activate queues in transaction SXMB_ADM e SMQR(Andr Ramalho

Create BS in SLD to refer PI IS and PI AS with installed Nf-e Product(Andr Rama

15) In integration Builder:Configuration, create parties with communication channel Communication between ERP and SEFAZ ( Andr Ramalho PI/XI Consultant).

16) Assign the Business System of SAP NFe and create new communication channel and SIGN_SOAP_RCV (Andr Ramalho PI/XI Consultant). 17) 18) 19) 20)

Configure Governance and signature sceneries (Andr Ramalho PI/XI Consulta

Create Receiver Det of sync communications to Governance (Andr Ramalho P Create Jobs of Service Status Check and Process Reports(Andr Ramalho PI/XI Create users (BASIS Team):

How to implement Nfe (GRC PI).


In R/3 to RFC Destination of PI; In PI to RFC Destination from R/3. Create Destinations(BASIS Team):

21)

ABAP conection in R/3 to PI Application System; ABAP Connection in PI to R/3.

RISKS:

NF-e process is very consistent. We just have to be careful about proxy and user authenticat these proxies.

Considerations:

Nf-e process in SAP works like the follow picture:

NFe flows:

Nf-es:

How to implement Nfe (GRC PI).

Contingency:

How to implement Nfe (GRC PI).

Created by Andr Ferreira Ramalho SP Brazil SAP ABAP PI/XI GRC Consultant, Mobile: +55 13 91774638 Mail: andre.sapxi@gmail.com