Defining Automatic Maintenance Algorithm Groups

This topic provides an overview of automatic maintenance algorithm groups and discusses how to add a new algorithm group.

The Automatic Maintenance process uses algorithm groups to match debit items to credit items. When you implement the Automatic Maintenance process, you must create custom algorithm groups from scratch, if you need to use them. For example, you might include a step in your automatic maintenance method that matches the values in two debit item fields to the values in two credit item fields, because you want to match debit items to credit items by matching the invoice number and the purchase order number in both items.

An algorithm group is a section in a Application Engine program. You need to be familiar with Structured Query Language (SQL) and with creating Application Engine processes to write a custom algorithm group.

The system provides a sample algorithm group, called #SAMPLE1, in the sample database. The algorithm group matches a debit item to a credit item when the invoice number and the purchase order number are the same in both the debit and the credit item. The algorithm group contains two steps, and each step contains one SQL statement. The sample provides an example of an exact match. However, you can also design your algorithms to create a partial or LIKE match.

This text is the SQL statement for the DEBITS step in the #SAMPLE1 section:


%InsertSelect(MT_ITEM_TAO, MT_ITMOPN_TAO, CORPORATE_SETID = SETID, 
CORPORATE_CUST_ID = CUST_ID, MATCH_GROUP_ID = %BIND(AUTOMNT_METHOD) 
%CONCAT %NumToChar(%BIND(STEP_NUM)) %Concat %Upper(INVOICE) %CONCAT %Upper(PO_REF), 
AUTOMNT_METHOD = %Bind(AUTOMNT_METHOD), STEP_NUM = %Bind(STEP_NUM), 
DR_AMT = BAL_AMT, CR_AMT = 0, DR_CNT = 1, CR_CNT = 0, ITEM_AMT = BAL_AMT, 
ITEM_AMT_BASE = BAL_AMT_BASE, ENTRY_USE_ID = 'MT-01') 
FROM %Table(MT_ITMOPN_TAO) 
WHERE PROCESS_INSTANCE = %ProcessInstance 
AND BAL_AMT > 0 
AND INVOICE <> ' ' 
AND PO_REF <> ' ' %Bind(AE_WHERE, NOQUOTES)

This text is the SQL statement for the CREDITS step in the #SAMPLE1 section:


%InsertSelect(MT_ITEM_TAO, MT_ITMOPN_TAO, CORPORATE_SETID = SETID, 
CORPORATE_CUST_ID = CUST_ID, MATCH_GROUP_ID = %BIND(AUTOMNT_METHOD) 
%CONCAT %NumToChar(%BIND(STEP_NUM)) %Concat %Upper(INVOICE) %CONCAT %Upper(PO_REF), 
AUTOMNT_METHOD = %Bind(AUTOMNT_METHOD), STEP_NUM = %Bind(STEP_NUM), 
DR_AMT = 0, CR_AMT = BAL_AMT, DR_CNT = 0, CR_CNT = 1, ITEM_AMT = BAL_AMT, 
ITEM_AMT_BASE = BAL_AMT_BASE, ENTRY_USE_ID = 'MT-01') 
FROM %Table(MT_ITMOPN_TAO) 
WHERE PROCESS_INSTANCE = %ProcessInstance 
AND BAL_AMT < 0 
AND INVOICE <> ' ' 
AND PO_REF <> ' ' %Bind(AE_WHERE, NOQUOTES)

You can copy the SQL that the system provides in the DEBITS and CREDITS steps to the steps in your algorithm groups, but you must change the WHERE statement as needed. You must also change the values for INVOICE and PO_REF in the SELECT statement to the appropriate field values that you want to match.

If you are creating an algorithm group to write off items not matched in previous steps, create algorithm groups by copying the SQL in the DEBITS and CREDITS steps in the WRITEOFF section and modifying the WHERE statements.

Use PeopleSoft Application Designer to add a new algorithm group to the Automatic Maintenance process. All custom sections must begin with #, such as #CUSTOM.

There are two ways to add a new algorithm group:

  • Copy an existing algorithm group (does not work on all platforms).

  • Create an algorithm group from scratch.

Oracle suggests copying whenever possible, because it saves time.

For more information, see the product documentation for PeopleTools: Application Engine.