Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Withholding Tax Line Item Using FM

tiamtjai_goh
Explorer
0 Kudos

Hi all,

Is the any FM that allows me to get withholding tax line item (in table WITH_ITEM) based on the line item in BSEG? What I want from the result is that it will be able to tell me which line item in WITH_ITEM belongs to which line item in BSEG.

Thanks for helping out.

Regards,

Goh Tiam Tjai

2 REPLIES 2

former_member15255
Active Participant
0 Kudos

Hi,

Both BSEG and WITH-ITEM tables are related thru Document no (Belnr),company code (Bukrs),year (Gjahr), Withholding tax base amount (WT_QSSHH) draw a select command shown below

Select BSEG~BELNR

WITH_ITEM~WT_QSSHH

WITH_ITEM~WT_QBSHH

FROM BSEG

INNER JOIN WITH_ITEM ON BSEGBELNR EQ WITH_ITEMBELNR

BSEGBUKRS EQ WITH_ITEMBUKRS

BSEGGJAHR EQ WITH_ITEMGJAHR

BSEGWT_QSSHH EQ WITH_ITEMWT_QSSHH

WHERE BSEG~BUKRS IN SO_BUKRS

AND BSEG~GJAHR IN SO_GJAHR.

Regards

suresh

Former Member
0 Kudos

Hello,

I've found a way to do it, and considering that I could not find the answer in SCN I'll post it.

I've created a report to show the calculated WHT which would be posted only at the payment moment. Also, in Brazil we work with extended WHT (and not the classic one).

You will need an ABAP.

Create a Z function module as copy of ZFI_WT_FB05_CALCULATE_WT.

This FM has only input parameters, therefore it does not provide you with the calculated WHT as an output (as standard). Knowing this, it is necessary to change it (the FM) by summing all T_WITH_ITEM-WT_QBSHH per accounting document (this table is present in the standard FM).

You need to provide the logic in order to obtain the parameters, The field which need to be filled are:

I_AKTYP              =             "H”

I_DYNCL              =             "Z”

Table I_POSTAB

Pick the data below from BKPF/BSEG of the accounting document which needs WHT to be calculated:

BELNR 

BUKRS

GJAHR

BUZEI

WAERS

BUDAT

BLDAT

BSCHL

KOART

SHKZG

DMBTR

WRBTR

KONKO

XAKTP = "X"

XAKTS = "X"

Table  I_BKPF

BUKRS

GJAHR     = year of the system date

BLART     = KZ

BLDAT     = system date

BUDAT     = system date

MONAT     = period of the system date

TCODE     = FBZ2

WAERS

Then after changing the FM to have T_WITH_ITEM-WT_QBSHH as output, simulate it by inserting the values of the accounting document which has WHT, and check the result, if it is the same as calculated by F-53 or F110.