11-29-2007 6:52 PM
Hello gurus,
Is there another way to calculate income tax instead of calling a form "calc_tax_ess" in the payroll driver RPCALCK0? The peformance is so slow when you do it that way. I'm thinking of using a function module to accomplish this.
Sample code of calculating tax:
PERFORM calc_tax_ess IN PROGRAM ('RPCALCK0')
TABLES ptax1
ptax2
ptcrt
ptcrti
pit
ptext
error_ptext
USING
i_salary-abrdt
psw_prot
p_nuper
lc_num_pension_months
pnumpr
ptaxretcode.
Thanks in advance,
Ricky
11-29-2007 7:38 PM
Hi Ricky,
There is no other way, you have to use program RPCALCK0.
Check this FM also HRWPC_RFC_BLAND_TEXT_GET
Regards,
Satish
11-29-2007 9:54 PM
My program is calling RPCALCK0 and loading it severaal times inside a loop, it causing some performance issue because the number of rows can grow as big as 8000 records, this means calling the program 8,000 times. Is there another way I could resolve this problem.
Example:
loop at it_pernr.
PERFORM calc_tax_ess IN PROGRAM ('RPCALCK0')
TABLES ptax1
ptax2
ptcrt
ptcrti
pit
ptext
error_ptext
USING
i_salary-abrdt
psw_prot
p_nuper
lc_num_pension_months
pnumpr
ptaxretcode
endloop.
01-02-2008 10:31 PM
Looks like the program is loading the number of times the loop is executed. When you do a step debugging you'll notice that the runtime increases everytime you pass loop iteration.