Generating Form Letters for Other PeopleSoft HCM Applications
These topics provide an overview of form letters for other PeopleSoft HCM applications and discuss how to:
Generate form letters with PeopleSoft Process Scheduler.
Use naming conventions in form letter files.
Prepare to print form letters.
Adapt form letters.
Note: These instructions show you how to use templates to create form letters for other PeopleSoft HCM applications. To create form letters for PeopleSoft Human Resources, you follow a different method. Please follow the appropriate instructions to create your form letters.
Before you generate any form letters or modify any of the sample form letters that are delivered with PeopleSoft HCM, you need to understand how the process works for PeopleSoft HCM applications other than PeopleSoft Human Resources.
To generate form letters for other PeopleSoft HCM applications:
Use the report writer to run SQRs.
The SQRs search your PeopleSoft HCM database, retrieve data, and create data extract files containing one line of data for each letter.
Use Microsoft Word to run the macros that merge the data extract files into form letter templates, one for each type of letter.
To generate form letters by using PeopleSoft Process Scheduler, PeopleSoft delivers two files (stdltr.dot and stdltr.95 located in the \PS\WINWORD directory on your application CD) containing the Word macros. You must use the file that is appropriate for your system.
The macros in stdltr.dot are for use with Word 97 (in Microsoft Office 97) and are written in Visual Basic.
The macros in stdltr.p5 are for use with Word 7.0 (used in Microsoft Windows 95) and are written in Word Basic.
If you need to use stdltr.95, copy it to your system and rename it stdltr.dot.
Print the letters by using Microsoft Word.
The system creates the form letters in a temporary directory on the application server, putting all letters of the same type in one file.
The distributed architecture of your PeopleSoft HCM system means that your application server can be located far from your machine, so the system doesn't print letters to a default printer. Instead, you select where you want to print the letters by using standard Microsoft Word print options.
PeopleSoft Process Scheduler uses Microsoft Word to run the macros that merge the data extract files into form letter templates and prints the letters. You can run a job that performs each step in sequence or you can manually run each process in turn. If you manually run each process, you must perform the steps sequentially (first the SQR and then its corresponding macro) because PeopleSoft Process Scheduler can't call up the report writer and the word processor simultaneously. Also, the data extract file that is created by the SQR must exist before the Word macro starts.
Image: Generating form letters for other PeopleSoft HCM applications with PeopleSoft Process Scheduler
This diagram and the steps below illustrate how PeopleSoft Process Scheduler generates form letters for other PeopleSoft HCM applications:
![Generating form letters for other PeopleSoft HCM applications with PeopleSoft Process Scheduler](img/i-cd7d26dn-75ae.png)
PeopleSoft Process Scheduler follows these steps to generate form letters for other PeopleSoft HCM applications:
SQR PAWRL01:
Scans the personal data record of each employee.
Retrieves the information from the record.
Creates data extract files pastdext.dat in the TEMP directory that is defined in the macro.
The macro PAWRL01:
Opens the form letter templates that correspond to the data extract files.
Merges the appropriate extract file data into the template rollover.doc.
Inserts the data from pastdext.dat into the template field codes.
Microsoft Word assigns the extension .doc to all documents. No other naming convention is required for these types of letters.
Before you can print form letters, you need to modify the macros supplied by PeopleSoft to suit your environment and set up your process scheduler configuration file.
Depending on your configuration, you may need to make these changes to the standard Microsoft Word macros that are supplied by PeopleSoft:
Default path to the empty.doc file that contains all the macros.
Location of the letters produced.
The macros create letters in the directory C:\TEMP on your application server. We recommend that you edit the macros to change the location of the letters so that when you print them from Microsoft Word, you print them to your local printers.
To set up the system to print form letters:
Set up a shared directory on your machine for the letters.
This enables the application server to add the letters to the directory. For example, if you're the training administrator, you may share the C:\TEMP directory on your machine as TRNTEMP.
For the multilingual letters, set up subdirectories for each language in which you run the letters. For example, if you run letters with the Language field set to English, you create the directory C:\TEMP\ENG. See your system administrator if you don't know how to set up shared directories.
Update the macros with the location of your empty.doc file and the location of your shared directory.
In that macro, you replace this line:
WordBasic.Call "FuncLib.MergeReport", "C:\TEMP", "PASTDEXT.DAT", "C:\HR800\WINWORD", "ROLLOVER.DOC", ""
With this line:
WordBasic.Call "FuncLib.MergeReport", "C:\TEMP", "PASTDEXT.DAT", "C:\<path>\WINWORD", "ROLLOVER.DOC", "\\<machine_name>\TRNTEMP"
Where:
<path> is the path to the directory that contains empty.doc.
<machine_name> is the machine name that is assigned to your computer.
Define the WINWORD variable in the process scheduler configuration file.
WINWORD defines the location of the Microsoft Word executable file that the process scheduler runs to produce the form letters. For example, if Microsoft Word is run on the application server, you might have this line in the process scheduler configuration file:
WINWORD=C:\APPS\OFFICE97\OFFICE
See PeopleTools: PeopleSoft Process Scheduler.
These topics discuss how to:
Modify the Word macros for the sample letters.
Modify the text in sample letter templates.
Add fields to sample letters.
Create new form letters.
Modifying the Word Macros for the Sample Letters
You specify several environment variables in each Microsoft Word macro so that it can find the Word templates and data extract files during the form letter process. For example, your network or workstation configuration may have some of the files in different locations than those specified in the macros, so you need to modify the PATH to reflect the correct locations.
Before you edit the existing macros (or create new ones), we recommend that you print copies of the Microsoft Word documents and macros and the report writer SQRs and study them carefully.
Note: To make this change, you should be familiar with Microsoft Word templates and macros and with your report writer.
All of the macros are attached to a file in the \PS\WINWORD directory. (Your path may differ, depending on your installation, but you can always find the file in a WINWORD subdirectory.) They are attached to an empty Microsoft Word file called empty.doc.
To modify a macro:
In Microsoft Word, open the empty.doc file.
Select
In the Macros in field, select Stdltr (template).
Highlight the macro that you want to modify and click Edit.
Modifying the Text in Sample Letter Templates
The form letter templates that are delivered with PeopleSoft HCM contain sample text for different types of tasks, which you can change to suit your needs. For example, you'll probably want to change the sender names in the letters to the names of the employees in your organization who are responsible for administering the tasks. If you need to modify only the text, without changing any fields that are used or pages and tables that are referenced in PeopleSoft Human Resources, use the following procedure.
To modify the text in a form letter:
Find the Word letter template to update.
Templates are located in the directory \PS\WINWORD.
In Microsoft Word, open the document that you want to modify.
If you see " "in the document, select Field codes check box.
then select theMake changes to the text as you would in any other document, and save the file.
Warning! Don't overwrite the field codes (enclosed in curly brackets). They are the placeholders for the values that are extracted from PeopleSoft Human Resources.
Adding Fields to Sample Letters
In addition to updating the text of a sample letter, you can include other types of data from PeopleSoft HCM.
Note: To make this change, you should be familiar with Microsoft Word fields and the report writer used to extract data values from your PeopleSoft Human Resources database.
To use additional fields in form letters:
Add field codes to the form letter templates for any new data types that you want to include.
Modify the SQR that extracts data from PeopleSoft Human Resources so that it retrieves values from all of the fields that you want to use and writes them to the appropriate data extract files.
For example, to include currencies in the notification letter rollover.doc, add a Currency field code to the form letter template. Also add a variable for currency in pastdext.sqr so that the SQR retrieves the currency value and writes it to the data extract file.
Here's what the data extract file looks like before the change:
LANG,NAME,PLAN,ADDR1,ADDR2,ADDR3,NATIONAL_ID,CURDATE
USA", "Mr. John Matson","BEN01", . . . , "May 15, 1993"
Here's what it looks like after the change:
LANG,NAME,PLAN,ADDR1,ADDR2,ADDR3,NATIONAL_ID,CURDATE,Currency
USA", "Mr. John Matson","BEN01", . . . , "May 15, 1993","US Dollars"
Creating New Form Letters
You can create form letters for different purposes. For example, you might want to send out form letters about their benefit plans to be signed by employees.
To create a new form letter:
Create a Word letter template, including the appropriate text, field codes, and data statement reference.
You might find it easier to adapt an existing form letter template than to create a new one. Look through the form letter templates to see if there's one that needs only minor modifications to serve as a new form letter template.
Create the SQR that selects and extracts data from other PeopleSoft Human Resources tables and stores it in a separate data extract file.
Create a new macro that is able to read the extracted data and merge it with the Word letter template.
You might find it easier to copy an existing macro and adapt it.
Note: To link your new letter to PeopleSoft Process Scheduler, ask your human resources project leader or see the references below.
See PeopleTools: PeopleSoft Process Scheduler..