You are on page 1of 10

SAP Note

815720 - Brazil : Withholding Tax Accumulation


Version 27 Validity: 29.10.2009 - active

Header Data
Released On 29.10.2009 17:49:43
Release Status Released for Customer (Target Status: Pilot Release)
Component XX-CSC-BR Brazil
Other Components FI-AP-AP-Q Withholding Tax (Calculation)
Priority Correction with high priority
Category Legal change

Symptom
This note is only relevant for Brazilian companies which have applied OSS note 727475 and related notes.
This note is only for companies doing tax calculation using tax calculation procedure TAXBRJ and pricing

Due to the legal change PIS, COFINS, CSSL withheld portion is only posted when the total payment amount
In case the solution for ISS legal change(2004) described in OSS note 727475 and other related note were

Other Terms
Brazil, MP135, PIS, COFINS, CSSL, Withholding Tax, WHT, Accumulation,
J_1BCALCULATE_TAXES, RVXBRA, TAXBRJ

Reason and Prerequisites


This is a Legal change.
Detail legal background is not described in this note.
Note 727475, 768022, 757286, 757619, 791240 are prerequisites.

Solution
After applying this note the minimum withholding tax base amount check is done against the following val

l Payments for Normal Vendor/Customer invoices originated from a Logistics Document : Withholding Tax

l Downpayment Documents : Downpayment Amount

l Documents created in FI without an Original Logistics Document : Not relevant for this solution

**************************
* Caution *
**************************

l Partial payment and Residual Item creation are not supported

l Manual entry of Withholding Tax Base Amount is not supported

l Manual Withholding Tax Amount entry is not supported

l Downpayments using F-47 will not work with noted item

Apply the indicated support package or follow the steps described in this note.

If you have applied the support package to get the DDIC changes and code changes, Please note that copyi

1. DDIC changes

a) Create New Domains via transaction SE11

l J_1BWHTBASE_NF
Short Description
Specifes where real withholding tax calc. base is stored
Package J1BA
Data type CHAR
No. characters 1
Decimal places 0
Output length 1
Domain values: Single vals
Fix.Val Short Text
Base in Standard FI Tables
X Base Stored in Nota Fiscal
Save and activate

a) Change domain via transaction SE11

l J_1BTAXGRP

Add the following domain value

FixVal. Short text


WAT General Withholding Tax - Accumulated
WAPI PIS Withholding Tax - Accumulated
WACO COFINS Withholding Tax - Accumulated
WACS CSLL Withholding Tax - Accumulated
WAIR IR Withholding Tax - Accumulated

Save and activate

a) Create New Data Elements via SE11

l J_1BWHT_ACCRB
Short Description
Accumulated withholding tax real base amount(local currency)
Package J1BA
Domain WERTV8
Field Label
Length Field label
Short 10 Acc. Rbase
Medium 20 Accum w/tax RB in LC
Long 38 Accumulated w/tax real base amnt in
Heading 21 Accum. w/tax RB

l J_1BWHT_RB
Short Description
Withholding tax real base amount (local currency)
Package J1BA
Domain WERTV8
Field Label
Length Field label S h o r t 8 W/tax rb
Medium 18 W/tax real base LC
Long 26 W/tax real base amnt in LC
Heading 8 W/tax rb

l J_1BWHT_ACCRBASE
Short Description
Accumulate real base amount
Package J1BA
Domain XFELD
Field Label
Length Field label
Short 6 Acc RB
Medium 17 Accumulate WHT RB
Long 36 Accumulate withholding tax real base
Heading 6 Acc RB

l J_1BWHT_BS
Short Description
Withholding Tax Base Amount from Nota Fiscal
Package J1BA
Domain WERTV8
Field Label
Length Field label S h o r t 10 WT Base/NF
Medium 15 WT Base from NF
Long 35 WH Tax Base Amount from Nota Fiscal
Heading 20 WH Tax Base from NF

l J_1BWHTBASE_NF
Short Description
Origin of Real Withholding Tax Calculation Base
Package J1BA
Domain J_1BWHTBASE_NF
Field Label
Length Field label S h o r t 10 Origin Medium 15
Long 25 Origin of Real Calc. Base
Heading 6 Origin

Save and activate all data elements

a) Create New Structures via SE11

l J_1BWHTA_BR
Short Description
Additional Brazilian Data in Withholding Tax Accumulation
Package J1BA
For R3 release 470 and above set the enhancement category to 'Can be Enhanced(Character-type or nume
Component Component Type
J_1BWHTRB01
J_1BWHTRB02
J_1BWHTRB03
J_1BWHTRB04
J_1BWHTRB05
J_1BWHTRB06
J_1BWHTRB07
J_1BWHTRB08
J_1BWHTRB09
J_1BWHTRB10
J_1BWHTRB11
J_1BWHTRB12
In the 'Currency/quantity' tab set the reference table as T001 and reference field to WAERS for all
Save and activate

l J_1BWHTACCBS_BR
Short Description
Accumulated real base amount(Local currency)
Package J1BA
For R3 release 470 and above set the enhancement category to '
Can Be Enhanced(Character-type or numeric)'
Component Component Type
J_1BWHT_BS
J_1BWHTACCBS
J_1BWHTACCBS1
J_1BWHTACCBS2
In the 'Currency/quantity' tab set the reference table as T001 and reference field to WAERS for all
Save and activate

l J_1B_OPEN_ITEM
Short Description
Open Item for
Withholding Tax
Base Amount
Determination
Package J1BA
For R3 release 470
and above set the
enhancement
category to 'Cannot
Be Enhanced'
Component
Compoment Type
RefTab RefField
BUKRS BUKRS BELNR BELNR_D

DMBTR DMBTR T001


WAERS
DMBE2 DMBE2 T001
WAERS
DMBE3 DMBE3 T001
WAERS
WMWST WMWST T001
WAERS
MWSTS MWSTS T001
WAERS
MWST2 MWST2 T001
WAERS
MWST3 MWST3 T001
WAERS
XANET XANET XZAHL XZAHL

SKNTO SKNTO T001


WAERS
SKNT2 SKNT2 T001
WAERS
SKNT3 SKNT3 T001
WAERS
SKFBT SKFBT T001
WAERS
REBZG REBZG REBZJ REBZJ

QSSHH QSSHH T001


WAERS
QSSH2 QSSH2 T001
WAERS
QSSH3 QSSH3 T001
WAERS
QBSHB QBSHB T001
WAERS
QBSHH QBSHH T001
WAERS
QBSH2 QBSH2 T001
WAERS
QBSH3 QBSH3 T001
WAERS
DIFFW DIFFW T001
WAERS
DIFHW DIFHW T001
WAERS
DIFH2 DIFH2 T001
WAERS
DIFH3 DIFH3 T001
WAERS
XAKTP XAKTP XAKTS XAKTS

BDIFF BDIFF T001


WAERS
BDIF2 BDIF2 T001
WAERS
BDIF3 BDIF3 T001
WAERS
INDEX INDEX
In the
'Currency/quantity'
tab set the
reference table and
reference field
information.
Save and activate

a) Create table type J_1BNFLIN_TAB via SE11


If you do not have table type J_1BNFLIN_TAB in your system please create this table type
Short text
Table of Nota Fiscal Items (J_1BNFLIN)
Package J1BA
Row TypeJ_1BNFLIN

Save and activate

b) Append structure to table via SE11

l Change table WTAK


-> Select Append Structure
-> Enter J_1BWTAK_BR with description 'Additional Brazilian Data of WTAK'
-> Include structure J_1BWHTA_BR via menu Edit -> Include -> Insert. Save and Activate structure J_1
-> Save table WTAK
-> Adjust database table WTAK via SE14

l Change table WTAD


-> Select Append Structure
-> Enter J_1BWTAD_BR with description 'Additional Brazilian Data of WTAD'
-> Include structure J_1BWHTA_BR via menu Edit -> Include -> Insert. Save and Activate structure J_1
-> Save table WTAD
-> Adjust database table WTAK via SE14

l Change table WTAKPN


-> Select Append Structure
-> Enter J_1BWTAKPN_BR with description 'Additional Brazilian Data of WTAKPN'
-> Include structure J_1BWHTA_BR via menu Edit -> Include -> Insert. Save and Activate structure J_1
-> Save table WTAKPN
-> Adjust database table WTAKPN via SE14

l Change table WTADPN


-> Select Append Structure
-> Enter J_1BWTADPN_BR with description 'Additional Brazilian Data of WTADPN'
-> Include structure J_1BWHTA_BR via menu Edit -> Include -> Insert. Save and Activate structure J_1
-> Save table WTADPN
-> Adjust database table WTAKDN via SE14

l Change table REGUPW


-> Select Append Structure
-> Enter J_1BREGUP_BR with description 'Additional Brazilian Data in Withholding Tax Data Paymnt Run
-> Include structure J_1BWHTACCBS_BR via menu Edit -> Include -> Insert. Save and Activate structure
-> Save table REGUPW
-> Adjust database table REGUPW via SE14

a) Include structure to J_1BWITH_ITEM_BR(appended structure of table WITH_ITEM) via SE11


-> Include structure J_1BWHTACCBS_BR via menu Edit -> Include -> Insert. Save and Activate struc
-> Adjust database table WITH_ITEM via SE14

b) Add new field in Table via SE11

l Change table T059P


-> Add the following field at the end.
Field Data Element
J_1BWHTBASE_NF J_1BWHTBASE_NF
-> Save
-> Adjust database table T059P via SE14

l Change table J_1BTXWITH


-> Add the following field at the end.
Field Data Element
J_1BWHTACC_RB J_1BWHTBASE_NF
-> Save
-> Adjust database table J_1BTXWITH via SE14

a) Change Maintenace View via SE11

l View V_T059PP

¡ Add new field to view

Goto View field tab and add J_1BWHTBASE_NF from the table fields. Save and activate

¡ Change maintenance object

Layout of maintenance screen


-> Goto Untilities > Table Maintenance Generator or transaction SE54
-> Goto Maintenance Screen 241 by double clicking on screen number.
-> Select Layout and Add field V_T059PP-J_1BWHTBASE_NF from Dic/program fields as an
-> Place the field under the Calculation box
-> Set Dropdown as Listbox in the attribute
-> Set the Vis.Lenth as 27 in the attribute
-> Save and activate layout.

Regenerate View
-> Goto Untilities > Table Maintenance Generator or transaction SE54
-> Select Change
-> Select 'Expert Mode' in the 'Change Generation Element' pop-up
-> Mark the following options
X Refresh structure-specific form routines
X Renew data processing function module
X Renew data processing fctn.mod.program
-> Regenerate View

l View J_1BTXWITHV

¡ Add new field

Goto View field tab and add J_1BWHTACC_RB from the table fields. Save and Activate V

¡ Change maintenance object

Layout
-> Goto Untilities > Table Maintenance Generator or transaction SE54
-> Goto Maintenance Screen 18 by double clicking on screen number.
-> Select Layout and create a box with name TEXT_ACCUMULATION and text 'Withholding
-> Add field J_1BTXWITHV-J_1BWHTACC_RB from Dic/program fields as an input/output fi
-> Save and Activate layout.
Regenerate View
-> Goto Untilities > Table Maintenance Generator or transaction SE54
-> Select Change
-> Select 'Expert Mode' in the 'Change Generation Element' pop-up
-> Mark the following options
X Refresh structure-specific form routines
X Renew data processing function module
X Renew data processing fctn.mod.program
-> Regenerate View

2. Add Messages via SE91

Add message to message class WHT_BR

l Message Number 020


Message Short Text
Origin of base can only be set to Nota fiscal with Modified tax amount
S e l f-explanat'y ' '
Long Text
Cause
You can only set the origin of base to the value stored in the Nota fiscal with combination of the b
What To Do
Set the base amount as 'modified tax amount' or change the setting for the origin of base.

l Message Number 021


Message Short Text
Nota Fiscal is not found for document &, type &
S e l f-explanat'y 'X'

Save

3. Add Text Symbols in Reports in transaction SE38

Select Text Elements and change

l Program RFWT1000
Sym Text
131 Base amount from the Nota Fiscal( J_1BNFSTX )
132 Base amount for minimum base amount check
133 Accumulated Base amount from the Nota Fiscal in
Accumulation Period

Translate to log on language via Menu Goto -> Translation


Save and Activate

4. Create Class CL_WHT_NF via SE24


Description Withholding Tax Data in Nota Fiscal
Instantiation Public
Fixed Point Artithmetic X
Unicode checks active X (Only for rel. 470 and above)
Category General object type
Package J1BA

a) Create Internal Type


Type Visibility Description
MTY_J_1BAJ_TAB Protected Tax Types
Define the following type in the protected section.
types:

mty_j_1baj_tab TYPE STANDARD TABLE OF j_1baj .

Save and activate

b) Create Attributes
Attribute Level Vis. Typing
Associate. Description
Initial Value
MT_NFLIN Static Attribute
J_1BNFLIN_TAB Table of Nota Fiscal Items (J_1BNFLIN
MT_NFSTX Static Attribute
J_1BNFSTX_TAB Table of Nota Fiscal Tax Lines (J_1BN
MT_J_1BAJ Static Attribute
MC_GENERAL_ACC Static Attribute
J_1BTAXGRP Tax Group for General WHT - Accumulat
'WAT'
MC_COFINS_ACC Static Attribute
J_1BTAXGRP Tax Group for COFINS WHT - Accumulate
'WACO'
MC_PIS_ACC Static Attribute
J_1BTAXGRP Tax Group for PIS WHT - Accumulated
'WAPI'
MC_IR_ACC Static Attribute
J_1BTAXGRP Tax Group for IR WHT - Accumulated
'WAIR'
MC_CSLL_ACC Static Attribute
J_1BTAXGRP Tax Group for CSLL WHT - Accumulated
'WACS'

c) Create Public Methods


Level Static
Visibility Public

l Method REFTYP_FROM_AWTYP

Description

Get WHT Accumulation Base Amount From NF Tax Lines

Parameters

IV_AWTYP Importing Type AWTYP


RV_REFTYP Returning Pass per Value Type J_1BREFTYP

l Method GET_REAL_BASE_NF
Description
Get WHT Accumulation Base Amount From NF Tax Lines

Parameters
IV_WITHT Importing Type WITHT
IV_WT_USE Importing Type WT_USAGE
IV_BUKRS Importing Type BUKRS
IV_REFTYP Importing Type AWTYP
IV_REFKEY Importing Type AWKEY
EV_WHT_BASE Exporting Type WT_BS

a) Create Private Methods


Level Static
Visibility Private

l Method NF_WHT_BASE
Description
Get WHT Base for a Given NFLine If Relevant for Accumulation

Parameters
IS_NFLIN Importing Type J_1BNFLIN
IV_TAXTYP Importing Type J_1BTAXTYP
RV_BASE Returning Pass per Value Type J_1BBASE

l Method TAXTYP_FROM_WITHTYP
Description
Get NF Tax Type From WHT Type
Parameters
IV_BUKRS Importing Type BUKRS
IV_WITHT Importing Type WITHT
IV_WT_USE Importing Type WT_USAGE
ET_TAXTYP Exporting Type MTY_J_1BAJ_TAB
Exceptions
NO_UNIQUE_TAXTYP No unique NF tax type for given WHT type

l Method WHT_BASE_FROM_NF
Description
Get WHT Accumulation Base From NF Tax Lines Per Tax Type
Parameters
IV_TAXTYP Importing Type J_1BTAXTYP
IV_REFTYP Importing Type AWTYP
IV_REFKEY Importing Type AWKEY
EV_WHT_BASE Exporting Pass Value Type J_1BBASE

l Method GET_TAX_GROUP
Description
Get the tax group of a given tax type
Parameters
IV_TAXTYP Importing Type J_1BTAXTYP
EV_TAXGRP Exporting Type J_1BTAXGRP

l Method GET_TAX_TYPE
Description
Get the tax type of a given tax group
Parameters
IV_TAXGRP Importing Type J_1BTAXGRP
ET_J_1BAJ Exporting Type MTY_J_1BAJ_TAB

5. Change BAdI definition for FQST_CALC_COUNTRY via SE18

Add the followng methods to BAdI definition FQST_CALC_COUNTRY

l Method DETERM_BASE_FOR_CHECK

L e v e l Instance Method

T e x t Determine WT Base Amount for Minimum Check

Parameters
FLT_VAL Importing Type INTCA
IS_OPEN_ITEM Importing Type J_1B_OPEN_ITEM
IS_WITH_ITEM Importing Type WITH_ITEMX
IS_T059P Importing Type T059P
IV_TRACE_ACTIVE Importing Type XFELD
EV_CHECK_BASE Exporting Pass per Value Type WT_BS
CT_WHT_TRACE Changing Type WHT_TRACE_TAB

l Method SET_ACCOUNTING_DOCUMENTS

L e v e l Instance Method

T e x t Set Accounting Document Header and Item to MT_BKPF/MT_BSEG

Parameters
FLT_VAL Importing Type INTCA
IS_HEADER Importing Optional Type BKPF IS_ITEM Importing Optional
IS_BSEG Importing Optional Type BSEG

Save and Activate

6. Change BAdI implementation FQST_CALC_COUNTRY_BR via SE19

Double click on the implementation class name CL_IM_FQST_CALC_COUNTRY_BR

a) Create Public Method


Level Instance Method
Visibility Public

l Method GET_CURRENT_OPEN_ITEM
Description
Get Header and Item of Current Open Item
Parameters
IV_BUKRS Importing Type BUKRS
IV_BELNR Importing Type BELNR_D
IV_GJAHR Importing Type GJAHR
IV_BUZEI Importing Type BUZEI
ES_HEADER Exporting Type BKPF
ES_ITEM Exporting Type RFOPS

a) Create Private Method


Level Instance Method
Visibility Private

l Method FI_WT_DETERM_CALC_BASE_ITEM
Description
Determine tax code with customer BAdI
Parameters
IS_WITH_ITEM Importing Pass per Value Type WITH_ITEMX
IS_OPEN_ITEM Importing Pass per Value Type RFOPS
IS_T059P Importing Pass per Value Type T059P
RV_CHECK_BASE Returning Pass per Value Type WT_BS

a) Add Attributes
Go to the private section of class CL_IM_FQST_CALC_COUNTRY_BR via menu path Goto -> Private Sect
Add the following lines in the private section.
>> Content block
data MV_CALL_TAX_CALC type XFELD .
data MS_TAXCOM type TAXCOM .
data MT_KOMV type KOMV_TAB .
data MR_CUSTOMER_BADI type ref to IF_EX_J_1BWHT_BR_EXT .
>> Start of Insert block
data:
mt_bkpf TYPE SORTED TABLE OF bkpf
WITH UNIQUE KEY bukrs belnr gjahr .
data:
mt_bseg TYPE SORTED TABLE OF bseg
WITH UNIQUE KEY bukrs belnr gjahr buzei .
>> End of Insert block
Save.

7. Create include LJ1BRF11 via transaction SE38.


Title = Include LJ1BRF11
Typ = Include Program
Application = Basis system
Save and generate the include.

8. Source Code Change

Apply the code changes via SNOTE.

9. Create Pricing Formulas via transaction VOFM

a) Base Value Formulas

Copy base value formula 805 to 815

Copy base value formula 806 to 816

Copy base value formula 807 to 817

Copy base value formula 808 to 818

Copy base value formula 809 to 819

Save and Activate

b) Condition Value Formulas

Copy Condition Value Formula 825 to 855

Copy Condition Value Formula 826 to 856

Copy Condition Value Formula 827 to 857

Copy Condition Value Formula 828 to 858

Copy Condition Value Formula 829 to 859

Save and Activate

10. Configuration Change

Refer to the attached configuration guide.

Validity
Software Component From Rel. To Rel. And Subsequent
SAP_APPL 46C 46C
470 470
500 500
600 600

Correction Instructions
Correction Instructions

Software Component Valid from Valid to Number


SAP_APPL 46C 46C 747633
SAP_APPL 470 470 406101
SAP_APPL 500 500 770459

Causes - Side Effects


Notes / Patches corrected with this note

Note Reason From Version To Version Note Solution Version Support Package
The table does not contain any entries

The following SAP Notes correct this Note / Patch

Note Reason From Version To Version Note Solution Version Support Package
815720 0 0 950969 1

Support Packages & Patches


Support Packages

Software Component Release Support Package


SAP_APPL 46C SAPKH46C51
470 SAPKH47025
500 SAPKH50011
600 SAPKH60001

References
This document refers to:
SAP Notes
1013731 View V_T059PP: Field J_1BWHTBASE_NF not updated
916003 Brazil : Withholding tax accumulation for CBT
889553 BR : Withholding tax amount is larger than net amount
867199 Brazil WHT : Corrections for ERP 2005 SP01
852302 Implementation Overview ISS 2004 - Legal Change MP135/LC116
768022 Down Payment Clearing: Brazilian Fields Missing in WITH_ITEM
757619 MP-135 Withholding Taxes in Down Payments
757286 Country-Specific Withholding Tax Base: Preparation
727475 Overview about changes for ISS, PIS, COFINS; CSSL

This document is referenced by:


SAP Notes (9)
757286 Country-Specific Withholding Tax Base: Preparation
757619 MP-135 Withholding Taxes in Down Payments
768022 Down Payment Clearing: Brazilian Fields Missing in WITH_ITEM
867199 Brazil WHT : Corrections for ERP 2005 SP01
889553 BR : Withholding tax amount is larger than net amount
1013731 View V_T059PP: Field J_1BWHTBASE_NF not updated
916003 Brazil : Withholding tax accumulation for CBT
727475 Overview about changes for ISS, PIS, COFINS; CSSL
852302 Implementation Overview ISS 2004 - Legal Change MP135/LC116

Attachments
File Name File Size (KB) Mime Type
CustWHTAccumClassic.zip 66 application/x-zip-compressed

You might also like