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: 

Tax Calculation

former_member184386
Active Participant
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

Hi Ricky,

There is no other way, you have to use program RPCALCK0.

Check this FM also HRWPC_RFC_BLAND_TEXT_GET

Regards,

Satish

0 Kudos

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.

0 Kudos

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.