2008 Jul 07 2:44 AM
Hi All,
I have a program that automatically creates background jobs for payroll using RPCALCQ0. I have made a few modications so that the user now has the option of selecting the number of jobs to be ran and can enter the number of employees to be ran manually on the selection screen (or via a .csv file)
A working example is: if i have 10 employees and want 5 jobs, the program will create 5 jobs with 2 employees for each job.
An small example of my issue is:
If i have 5 employees but want to run 4 jobs.
The program currently will create 5 jobs as it doesnt take into account the remainder.
I was wondering if anyone knows how to solve this issue (is there a function module i can use), or just a way of checking for a remainder.
Thank you,
Daniel
Hi All,
I have a program that automatically creates background jobs for payroll using RPCALCQ0. I have made a few modications so that the user now has the option of selecting the number of jobs to be ran and can enter the number of employees to be ran manually on the selection screen (or via a .csv file)
A working example is: if i have 10 employees and want 5 jobs, the program will create 5 jobs with 2 employees for each job.
An small example of my issue is:
If i have 5 employees but want to run 4 jobs.
The program currently will create 5 jobs as it doesnt take into account the remainder.
I was wondering if anyone knows how to solve this issue (is there a function module i can use), or just a way of checking for a remainder.
Thank you,
Daniel
2008 Jul 07 3:07 AM
Hi,
Let the number of Jobs be X and the Number of employees be Y, So
remainder = Y MOD X
If the remainder is not 0, then you have to add Last reaminder number of employees to the last Job.
As per your example
Remainder = 1( 5 mod 4 )
So the 4th Job will have 5/4 + 1 employee ie 1+ 1 = 2 employees job.
Hope this helps
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |