CTe Configuration Guide
CTe Configuration Guide
CTe Configuration Guide
Configuration Guide
Table of Content
1 INTRODUCTION ............................................................................................................................... 3
2 ACTIVATION ..................................................................................................................................... 3
2.1 Activation of the solution ................................................................................................................ 3
2.2 Document Items ............................................................................................................................... 3
3 INCOMING CT-E SCENARIO ........................................................................................................... 3
3.1 Basic Configuration ......................................................................................................................... 3
3.1.1 Configuring Tax Code MM ................................................................................................................. 3
3.1.2 Purchasing Tax Code Determination ................................................................................................. 4
3.1.3 Configuring Conhecimento Determination ......................................................................................... 4
3.1.3.1 Creating Condition CONH in Purchasing Calculation Schema ......................................................... 4
3.1.3.2 Assign Purchasing Condition to Internal Code CONHECIMENTO ................................................... 5
3.2 Creating a Purchase Order ............................................................................................................. 5
3.3 Creating a Service Entry Sheet ...................................................................................................... 6
3.4 Creating an Invoice .......................................................................................................................... 6
3.5 Filling in the CT-e Details ................................................................................................................ 6
3.6 Tax Group 6: Service Item Level .................................................................................................... 7
3.7 ICMS Complement - DIFAL ............................................................................................................. 8
4 OUTGOING CT-E SCENARIO .......................................................................................................... 9
4.1 Basic Configuration ......................................................................................................................... 9
4.1.1 Configuring Tax Code SD .................................................................................................................. 9
4.2 Creating a Sales Order .................................................................................................................... 9
4.3 Creating a Billing Document........................................................................................................... 9
4.4 Ship-from location for SD ............................................................................................................... 9
5 ICMS EXEMPT ................................................................................................................................ 10
5.1 MM ICMS EXEMPT ......................................................................................................................... 10
5.2 SD ICMS EXEMPT .......................................................................................................................... 10
6 NEW FIELD FOR JURISDICTION CODE ...................................................................................... 10
7 BRCC ACCESS SEQUENCE MIGRATION ................................................................................... 10
8 CT-E SPECIFIC BADIS ................................................................................................................... 11
8.1 CT-e Incoming (MM) ...................................................................................................................... 11
8.2 Service Item Selection (MM) ......................................................................................................... 11
8.3 CT-e Outgoing (SD) ....................................................................................................................... 12
9 BAPI ................................................................................................................................................ 12
10 SCREEN CONTROLS..................................................................................................................... 12
10.1 Screen Control for Group Assignment ........................................................................................ 12
10.1.1 Screen Control for Group Assignment ............................................................................................. 12
2
CT-E CONFIGURATION GUIDE FOR MM AND SD
1 INTRODUCTION
This guide provides a general overview of Conhecimento Eletrônico (CT-e) implementation and usage.
The execution of the steps of the chapter 2 is mandatory. The execution of the steps of the examples in the
remaining chapters is not mandatory, since there might be variations of the customizing in order to cover
different scenarios.
2 ACTIVATION
2.1 Activation of the solution
To activate the logic in the code, and therefore the solution itself, follow the steps as below:
In SAP ERP system, CT-e documents must contain only one item. Processes with more than one item in the
CT-e are not supported.
In Incoming Scenarios, any Purchase Order or Service Entry Sheet created must contain only one
item.
In Outgoing Scenarios, Sales Order documents and Billing documents created for CT-e documents
must contain only one item.
In the system, freight is considered a service and does not require a goods receipt. Therefore, the incoming
CT-e process is based on External Service Management (SRV-MM-BR). For more information see SAP Note
947670, Service Management - Localization for Brazil (overview).
Condition types are available to calculate ICMS on CT-e. They are different from ICMS on freight in nota
fiscal and from ICMS on goods. This also applies to ICMS ST.
Two other conditions have been created to calculate the Complementary ICMS tax (ICMS DIFAL). For more
information, see SAP Note 1792935, CT-e: Incoming Complementary ICMS. As ICMS DIFAL is only relevant
for consumption/asset material transportation, then it is necessary to set the usage of the tax code as
Consumption.
3
CT-E CONFIGURATION GUIDE FOR MM AND SD
To use these new condition types, it is necessary to create a new Tax Code MM (or customize an existing
one) activating the related condition types, as follows:
Tax Conditions
CIC1 – ICMS on Conhecimento
CIC2 – ICMS Non-Deductible on Conhecimento
CST1 – Sub. Trib. on Conhecimento
ICMS
CST2 – Sub. Trib. Non-Deductible on Conhecimento
CCOP – ICMS Conh Complement
CCOX – ICMS Conh Compl 100
PIS Activate the existing condition types
Note: For ICMS, it is not necessary to activate all conditions. Activate only the conditions related to your tax
classification.
For PO tax code determination, you can use the NAVS condition technique. For more information, see SAP
Note 501054, FAQ: Taxes in purchasing.
Note: The NAVS condition technique does not work if your pricing procedure has requirement 60 in the
NAVS condition. In this case, you can either remove it or create another pricing procedure depending on
your business needs.
Conhecimento determination is used to differentiate a normal service purchase order from a purchase order
intended to be used as a base document for the creation of a CT-e.
In addition to the new condition types, the purchase order for CT-e is also different in other aspects:
For CT-e, the taxes are calculated at Purchase Order item level. For ISS, the taxes can be calculated
at service item level.
The ICMS and ICMS ST rates are different in goods documents than in CT-e. For CT-e, the rate is
indicated in the column ICMS on Freight, if it exists in the Tax Rate Tables. This column is
maintained in the Tax Manager’s Workplace Brazil (transaction J1BTAX), in Maintain ICMS Values
(table J_1BTXIC1). For others Tax Rate Tables, ICMS Base and ICMS Rate are used.
In a standard nota fiscal (for example, 1A) the freight value is just a part of the Net Amount. For CT-e,
however, the Net Amount represents the freight value itself.
The system determines that a document is a CT-e when the condition type CONH (or another condition type
assigned to the internal code CONHECIMENTO) is found in the purchasing calculation schema.
The condition CONH can be activated in the pricing procedure either manually or via a correspondent
condition record retrieved by an access sequence. An access sequence is not provided to determine CONH
as different customers will have different requirements to determine if a process corresponds to freight.
The following steps are example. You can adapt them to an existing condition type and purchasing
calculation schema accordingly.
4
CT-E CONFIGURATION GUIDE FOR MM AND SD
The calculation schema configuration is available in the IMG under Materials Management ->
Purchasing -> Conditions -> Define Pricing Determination Process.
1. Create Purchasing condition CONH (in the IMG under Materials Management -> Purchasing ->
Conditions -> Define Pricing Determination Process -> Define Condition Types).
2. Enter Purchasing Calculation Schema definition menu (in the IMG under Materials Management ->
Purchasing -> Conditions -> Define Pricing Determination Process -> Define Calculation Schema).
3. Select schema RM0000 and choose Control Data.
4. Choose the New Entries pushbutton.
5. Enter the information as follows:
30* 0 CONH 10
* step 30 is an example
ATTENTION: When creating the condition CONH (step 1) is advised to include an access sequence in it.
Otherwise, whenever the associated pricing procedure (i.e. RM0000) is called the Purchase Order is going
to activate CT-e Determination and CT-e taxes calculation.
1. Start the purchase order creation process. In the SAP Easy Access menu, choose Logistics →
Materials Management → Purchasing → Purchase Order → Create → Vendor/Supplying Plant
Known.
2. In the Vendor field select the company that executes the freight. Enter the Purchasing Organization,
Purchasing Group and Company Code.
3. Enter a Goods Supplier business partner to determine the starting point (Ship-From for tax
determination). To determine the Ship-To location, enter the Tax Jurisdiction Code field in the
Invoice tab.
4. Create a new item with Item Category “D – Service”. The Item Category that you select indicates that
the item of the document is a service.
5. Enter the Short Text, Material Group and other relevant information.
6. Enter information in the Service tab by adding new lines and entering Short Text (or Service Number
from Service Master) and Gross Price.
7. Activate the condition type CONH or another condition assigned to the internal code
CONHECIMENTO. The system can be configured to allow the manual addition of this condition or to
use an access sequence to automatically activate the condition according to the vendor, the order
type or other information available in the PO.
8. In the Invoice tab, ensure that the Service-Based Invoice Verification checkbox is not selected. If
selected, it generates one line for each service item. In the same tab, enter a Tax Code with CT-e
5
CT-E CONFIGURATION GUIDE FOR MM AND SD
conditions (CIC1, CIC2, CST1, and so on) and choose the Taxes pushbutton to verify the calculated
taxes.
9. Save the purchase order.
Service Entry Sheet creation does not require any specific procedures other than the standard process.
However, it is necessary to perform invoice verification.
1. Start the Service Entry Sheet creation process. (In the SAP menu, choose Logistics→ Sales &
Distribution → Bill of Services→ Service Entry Sheet→ Create.)
2. Enter the required information and save the document.
As of SAP Note 1766209 (CT-e: new CT-e Tax Calculation determination for Incoming), tax calculation does
not take NF Type into consideration when executing an invoice, only condition CONH, as described in
section 3.1.3, Configuring Conhecimento Determination.
1. To open the CT-e, execute transaction J1B2N, or execute transaction MIRO and choose the Nota
Fiscal pushbutton.
If the nota fiscal document has attribute model 57, the CT-e tab is displayed. This contains the
specific information for CT-e such as references and resources (as shown below).
6
CT-E CONFIGURATION GUIDE FOR MM AND SD
The tax group 6 (available in SAP Note 1714749, CT-e LC: Extension of Tax Calculation Features) was
created especially for CT-e. This tax group makes use of dynamic exception tax table (J_1BTXIC3) and uses
Service Item Level as the key for retrieving tax data (for example, rate and base).
7
CT-E CONFIGURATION GUIDE FOR MM AND SD
For tax calculation purposes, if there is more than one service item in the purchase order, the item with the
higher net value is used for retrieving tax data.
That is, the selected service determines the condition records to be retrieved.
In the example above, the second service is used for this purpose.
This selection can be overridden using the BAdI J_1BCTE_SELECT_SRVPOS. For more information, see
section 8.2, Service Item Selection (MM).
When carrying out a consumption/asset material transportation, if the intrastate ICMS Tax is greater than the
interstate Tax, it is necessary to collect the difference between them, that is, the ICMS complement.
For example, if a transport from state RS to state SP has 5% of ICMS and the intrastate tax for SP is 12%, it
is necessary to evaluate the difference between the taxes.
In the standard pricing procedure, the DIFAL base amount is stored in condition type BX30 and the tax
amount is stored in condition type BX31.
In the CT-e document, tax type CCOP highlights the calculated DIFAL tax value. The CCOX condition type
(in the pricing procedure) stores the offset (minus CCOP) so that this value is not added in the total taxes of
the nota fiscal.
8
CT-E CONFIGURATION GUIDE FOR MM AND SD
1. Create a material for freight service with Material Type “DIEN – Service“.
2. Create a new sales order type (or use an existing one) and assign it to a nota fiscal type with model
57.
2. Activate the options Calculate ICMS (or Calculate Sub. Trib.), Calculate PIS and Calculate COFINS,
depending on the tributary classification of the freight.
3. In order to calculate freight taxes in SD, set the customer usage to “Industrialization”.
1. Create a new sales order using the sales order type assigned to a CT-e nota fiscal type.
3. Add a new line for a material that will represent the freight service. Enter Quantity, Plant and Amount.
Inform a Tax Code, CFOP and texts for the related taxes in the Country tab.
4. In the Item Condition tab, activate the condition type CONH or another condition assigned to the
internal code CONHECIMENTO.
1. Create a Billing Document using the Sales Order number as a reference and save it.
The determination of the ship-from location for outgoing CT-e was extended.
To determine the ship-from it is necessary to customize the “Map CT-e Partner to NF Partner Function”
(J_1BCTE_PAR_MAPV) view.
The Partner Function assigned to the “0 – Goods Sender” CT-e Partner will determine the ship-from. For
example, when the “RE – Bill-to Party” is mapped, the “Bill-to Party” business partner address of the Sales
Order is the ship-from.
Item Description
Ship-From Address of Business Partner mapped as Goods Sender in the view
9
CT-E CONFIGURATION GUIDE FOR MM AND SD
This ship-from location affects tax rates, CFOP determination and the determination of new fields for
Jurisdiction Code in CT-e.
5 ICMS EXEMPT
In some Brazilian processes the ICMS is exempt, and therefore it should not be charged.
Usually it is the source and end locations of the service and the product being transported that determines
the ICMS exemption, for example:
- PLS 274/04 for law 87/96 - Exemption of ICMS for transportation of paper for book or newspapers in
all states in Brazil.
- ICMS Law at RS 38/2012 - Exemption of ICMS for transportation of vehicles for disabled people - law
specific for Rio Grande do Sul.
Even without the calculation of ICMS, the ICMS base value should be visible in the CT-e and the ICMS
should be reported in legal reports. The ICMS base for ICMS Exempt must be calculated and displayed as
excluded base. The law that makes the ICMS exempt must be printed in the CT-e.
In the system, MM scenarios with the ICMS exempt are done by the use of a proper tax code. There are
other customizations that also have to be carried out to report the ICMS exempt correctly.
Create a new Tax Code (or use an existent one) making sure that the option “ICMS-ex.” is marked.
A tax type for exempt must be active. In order to move the base values to the CT-e document, the tax
type for exempt must have Ex. Base Cond. and Other Base Con. filled with the proper conditions.
With this customizing the condition record that identifies the ICMS exempt is generated. In SAP default
customizing this condition is BICX, related to the internal code ICMSNULLEXEMPT - application TX.
For SD, the tax code should have “Industrialization” as Customer usage and “ICM-exempt” must be checked.
The Tax Type use must have its “Ex. Base Cond” correctly filled.
With this customizing the condition record that identifies the ICMS exempt is generated. In SAP default
customizing this condition is BICX, related to the internal code ICMSNULLEXEMPT - application V.
These new fields are automatically filled according to the ship-from and to the ship-to defined in the
Purchase Order or in the Sales Order.
In the CT-e tab of the CT-e/NF-e Writer whenever a Jurisdiction Code is informed the name of the city is
presented beside the field.
10
CT-E CONFIGURATION GUIDE FOR MM AND SD
Please, notice that no tax group (tax group assigned to internal code of tax conditions) should be customized
for Conhecimento ICMS base and rate internal codes.
Because of this, customer tax groups (Tax Group for Dynamic Tax Exceptions, between 10 and 89) will
never be inserted in BRCC when executing a migration.
If needed, instead of using migration tool, the customer tax groups should be customized manually in access
sequence BRCC via view VV_T682_TX.
ATTENTION: If a tax group (tax group assigned to internal code of tax conditions) is customized for
Conhecimento ICMS Base and Rate internal codes, you could then use the migration tool. Then all access
sequences assigned to conditions (and those assigned to internal codes CONH_ICMS_BASE and
CONH_ICMS_RATE) will be updated. However this may work for migration, SAP standard functionality does
not support collateral effects of this procedure (e.g. fiscal books, several entries for unwanted conditions
migrated).
The BAdI (J_1BCTE_IV) was created to fill data regarding incoming CT-e. It is called during invoice
verification when the CT-e document is generated.
This BAdI imports the data from the Purchase Order and exports the new CT-e data to be stored in the
database.
This BAdI is available in the IMG under Cross-Application Components -> General Application Functions ->
Nota fiscal -> Electronic Fiscal Documents -> CT-e Specifics -> Incoming CTe -> Business Add-Ins -> BAdI:
Fill CT-e Data During Invoice Verification.
The BAdI J_1BCTE_SELECT_SRVPOS was created (available via SAP Note 1714749, CT-e LC: Extension
of Tax Calculation Features) to be used for overwrite the selection of the default service to be used as key to
search the exception in Tax Group 6 (Dynamic Exceptions table) when executing a purchasing process.
This BAdI is available in the IMG under Cross-Application Components -> General Application Functions ->
Nota fiscal -> Electronic Fiscal Documents -> CT-e Specifics -> Incoming CTe -> Business Add-Ins -> BAdI:
Select Service Master Used in Dynamic Exceptions.
11
CT-E CONFIGURATION GUIDE FOR MM AND SD
The BAdI J_1BCTE_SD (available via SAP Note 1761307, BAdI for import Outgoing CT-e Data) was created
to fill data regarding outgoing CT-e and is called during the billing when the CT-e document is generated.
The BAdI imports the data from the Billing and exports the new CT-e data to be stored in the database.
This BAdI is available in the IMG under Cross-Application Components -> General Application Functions ->
Nota fiscal -> Electronic Fiscal Documents -> CT-e Specifics -> Outgoing CTe -> Business Add-Ins -> BAdI:
Import Outgoing CT-e Data.
9 BAPI
The Business Application Programming Interface (BAPI) BAPI_CTE_J_1B_NF_CREATFROMDATA was
created (available via SAP Note 1714749, CT-e LC: Extension of Tax Calculation Features) to be used as an
interface to generate a CT-e in the system.
10 SCREEN CONTROLS
It is necessary to assign NF Types to the screen controls for handling CT-e incoming and outgoing
documents.
Attention: The NF Types <CO> and <C1> mentioned below are not delivered. You should use your own NF
Types for incoming and outgoing as described in the following section.
The following steps are examples. You should adapt them to your existing NF Types accordingly.
1. Execute transaction SM30.
2. Enter J_1BALV in the Table/View field.
3. Choose the Maintain pushbutton.
4. Choose the New Entries pushbutton.
5. Enter the information as follows:
Manual Mode Scr.cnt.rf Screen control reference
NF Type Description
description
<CO> Conhecimento outgoing Change 28 Change application generated CT-e (via
MM-IV)
1
<CO> Conhecimento outgoing Create 24 Create Outgoing CT-e manualy
1
Screen Control Group created in SAP Note 1714749
12
CT-E CONFIGURATION GUIDE FOR MM AND SD
13
CT-E CONFIGURATION GUIDE FOR MM AND SD
All other product and service names mentioned are the trademarks of
their respective companies. Data contained in this document serves
informational purposes only. National product specifications may vary.
14