Processing Programs

Processing programs do the actual work. PeopleSoft strongly recommends that you limit your modifications of processing programs to the following types:

  • Inserting special earnings and deduction calculation routines in the specific places we've allotted for them.

  • Cloning standard PeopleSoft code and using it as the basis for any modifications that you have to make.

Selected Processing Programs

This table describes selected processing programs:

Processing Program Description

PSPECALC

Earnings Calculator

PSPDEDTN

Deduction Calculator

PSPTCALC

U.S. Tax Calculator (PeopleSoft-maintained)

PSPXCALC

Canadian Tax Calculator (PeopleSoft-maintained)

Special Deduction Calculation Routines

To write your own code to calculate a deduction:

  1. On the General Deduction table, select Special Deduction Calculation in the Deduction Calculation Routine field.

  2. Insert the code in the SPECIAL-DEDUCTION-CALC section of PSPDEDTN.

The following example shows the SPECIAL-DEDUCTION-CALC section from the Deduction Calculator, PSPDEDTN:

IF CALC-DED-YES OF W-SW
     EVALUATE TRUE
     WHEN DED-CALC-AMOUNT
  ...
     WHEN DED-CALC-PCT-TTL
     ...
     WHEN OTHER
   PERFORM DG200-SPECIAL-DEDUCTION-CALC
END-EVALUATE
...
/***********************************************************
  DG200-SPECIAL-DEDUCTION-CALC SECTION.
 *SPECIAL CALCULATION ROUTINES IDENTIFIED BY DEDUCTION CODE*
/***********************************************************
     MOVE ZERO TO WK-AMT OF W-WORK.
     SPECIAL-DEDUCTION-CALC-EXIT.

Notice that we've taken out a number of pieces of code for this example (indicated by the ellipses, "..."). Essentially, the first part consists of a series of WHEN statements that typically take care of all the PeopleSoft radio buttons on the General Deduction Table page. Then, if none of the radio buttons are true, PSPDEDTN goes ahead and performs the special deduction calculation routine DG200.

Further on in the program, the example shows the DG200 special deduction calculation routine supplied with vanilla Payroll for North America: MOVE ZERO TO WK-AMT OF W-WORK. (If, before modifying PSPDEDTN, you've ever selected on Special Deduction Calculation and run a pay calculation just to see what happens, you know that it always comes out with a zero. Now you know why).

So this is where you put all your special deduction calculation routines.

Special Earnings Calculation Routines

To write your own code to calculate an earnings type:

  • On the Earnings Table - Calculation page, select the Special Calculation Routine check box.

  • Insert the code in the SPECIAL-EARNINGS-CALC section of PSPECALC.

Cloning Code for Your Modifications

If you're thinking of inserting special calculations for deductions or earnings, PeopleSoft recommends that you first make a thorough study of DEDTN and ECALC, so that you get a feel for how these programs make their calculations, read flags, get their amounts, and so on.

The easiest way of implementing a special routine is to clone some piece of PeopleSoft code. For example, take out the health insurance calculation, play with it all you want, then plug it back into the Special Deduction Calc section. Ideally, when the time comes to do an upgrade, all your modifications are isolated in this section. Then, assuming that the way we did the new DEDTN is the same as the way we did the old DEDTN, make your special calculation routine and insert it into the Special Deduction Calc section in the new release.

Alternatively, of course, instead of cloning some of our code, modifying it, and inserting it into the Special Deduction Calc section, you can modify the appropriate section of our code that actually performs a given calculation. Just be sure to document your modifications carefully and clearly, with plenty of comments that document your reasoning behind the modification. As long as you ensure that the modified code stands out clearly when you do an upgrade, you're usually able to post the same change into our new application.