You are on page 1of 149

P EOPLE S OFT V 9.

1
P EOPLE T OOL 8.52

T RAINING G UIDE

June 2015

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
Copyright 2009,CedarCrestone,Inc. All rights reserved, including the right to
reproduce this manual or any part of it.
Restricted Rights
The information contained in this document is proprietary and confidential to
CedarCrestone, Inc.
This document may be reproduced only for the use of training for <client>users of
the PeopleSoft system. This document may not be reproduced or transmitted in any
form or by any means, electronic or mechanical, including photocopying and
recording, for any purpose other than internal training without the express written
permission of CedarCrestone, Inc.
CedarCrestone, Inc. has made every effort to ensure that the information in this
guide is complete, concise, and current. CedarCrestone, Inc. assumes no
responsibility for the consequences of any errors beyond its control. The examples,
sample screens, and reports used throughout this guide are for illustrative purposes
only and may not conform to your system requirements. CedarCrestone, Inc. makes
no implied warranties or merchantability or fitness for a particular purpose, and such
implied warranties are hereby specifically disclaimed.
PeopleSoft, PeopleTools, PeopleCode, and PS/n Vision are registered trademarks of
PeopleSoft, Inc.
Windows is a registered trademark of Microsoft Corp.
All other product and company names are trademarks of their respective owners.
General Information
To obtain documentation and/or additional copies of this manual, write to:
CedarCrestone, Inc.
1255 Alderman Drive
Alpharetta, GA30005
Attention: Dana Nichol
Phone: 877.364.081

Proprietary and Confidential to CedarCrestone, Inc.

Double Click Here to Change Text


PeopleSoft v9.1 Accounts Receivable
Training Guide

June 15

T ABLE

OF

BEFORE

C ONTENTS

Y O U B E G I N ............................................................................................................... I V

Intended Audience.................................................................................................................. iv
How This Guide Is Organized................................................................................................. iv
Chapter Structure..................................................................................................................... v
Course Contents..................................................................................................................... vi
Course Objectives................................................................................................................... vi
C H A P T E R 1: P E O P L E T O O L S 1.................................................................................................. 1
C H A P T E R 2: P E O P L E T O O L S 2................................................................................................1 2
C H A P T E R 3: P E O P L E C O D E .................................................................................................... 2 7
C H A P T E R 4: A P P L I C AT I O N E N G I N E .......................................................................................5 1
C H A P T E R 5: P E O P L E S O F T

Q U E R Y .........................................................................................6 5

C H A P T E R 6: S Q R..................................................................................................................... 8 9
C H A P T E R 7: X ML P U B L I S H E R ............................................................................................. 110
C H A P T E R 8: I N T E G R ATI O N T O O L S ......................................................................................1 22

Proprietary and Confidential to CedarCrestone, Inc.

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

B EFORE

YOU BEGIN
Use this guide during class to follow the topics as presented. The
instructor may also provide additional materials to support the
training outlined in this guide. After class, use this guide as a
reference document for completing tasks within the PeopleSoft
system.

I NTENDED AUDIENCE
This guide is intended for personnel who are technically sound and
responsible for maintaining and managing the PeopleSoft
application. We assume that you are familiar with:

Basic database knowledge.

Should be familiar with select clause and other DDL and


DML commands used in SQL.

Should be familiar with key structure that are commonly


used in SQL like Primary, Secondary, Composite, Foreign
key etc.

Should be familiar with Normalization.

If you are new to the Internet, you should complete a tutorial or


class prior to working in the PeopleSoft environment.

H OW T HIS G UIDE I S O RGANIZED


This guide is organized into chapters that contain the topics your
instructor will cover in class. Some chapters may have
corresponding practices that follow the instructors presentation and
individual exercises for you to complete on your own. There are
review questions at the end of the course to recap the major points.
SYMBOLS AND CONVENTIONS
The following conventions are used in this guide to help you
distinguish between various types of information:
SYMBOLS AND CONVENTIONS
Symbol

How It Is Used

bold text

Command and toolbar buttons that you click.


Menus, text and radio buttons that you select.
Check boxes you turn on or off.

Proprietary and Confidential to CedarCrestone, Inc.

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

SYMBOLS AND CONVENTIONS


Symbol

How It Is Used

bold italic
Text you type.
text
<bold text> Function keys on your keyboard that you press.
Italics text
Identifies a Page name.
Identifies a Field name.
Hyperlink
Indicates a link to another page.
Procedural information.
Warnings and cautions that require careful attention. Appears in the main body
of the document.
PeopleSoft information definitions, helpful hints. Appears in the page margin.
Note Noteworthy comments or important additional informationgenerally
about the item immediately precedes the note. Appears in the main body of
the document.
Noteworthy comments or important additional informationgenerally used to
call out specific client-related information about a series of steps or the topic
being discussed. Appears in the page margin.

C HAPTER S TRUCTURE
Most chapters are structured the same way and generally consist of
the following:
Objectives are found at the beginning of the chapter and list the
topics that will be covered in the chapter.
Topics explain the various concepts. Some lessons contain
practices and exercises.
Procedures are step-by-step instructions for completing a
procedure that the instructor and class participants walk-through
together.
Exercises are scenarios for individual work during class time.
These will be provided by the instructor.

Proprietary and Confidential to CedarCrestone, Inc.

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C OURSE C ONTENTS
The PeopleTools v8.52Training Guide includes eight chapters and
one appendix:
Chapter 1, PeopleTools 1,gives the overview about the
PeopleTools.
Chapter 2, PeopleTools 2,is the continuity of chapter 1.
Chapter
3,
PeopleCode
Programming,explain
about
PeopleCode, events and how a write some basic PeopleCode.
Chapter 4, Application Engine,defines what Application Engine
is. How to invoke it and how it works
Chapter 5, PS Query,gives an overview of the PeopleSoft
reporting query.
Chapter 6, SQR - Reporting,introduces the most efficient
reporting tool of PeopleSoft. It also explains about various aspects
of SQR .
Chapter 7, XML Publisher,introduces the XML publisher. The
setup required to invoke an XML publisher with step by step
approach of creating an basic XML Publisher report
Chapter 8, Integration Tools,gives
integrating tools used in PeopleSoft.

over

about

various

C OURSE O BJECTIVES
After completing this course, you will be able to effectively use the
PeopleTools to do the following:

Create or customize a module or application.


Maintain the day today activities or bug fixing.
Upgrade the Application.

Proprietary and Confidential to CedarCrestone, Inc.

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Notes

Proprietary and Confidential to CedarCrestone, Inc.

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 1: P EOPLE T OOLS 1


The purpose of this class is to provide you with the skills you need
to effectively use the PeopleTools.
In this chapter we will cover the following topics:
Lesson 1: PIA.
Lesson 2: Introduction to PeopleTools.
Lesson 3: Field Definitions.
Lesson 4:Record Definitions
Lesson 5:Page Definitions
Lesson 6:Component Definitions
Lesson 7:Menu Definitions
Lesson 8:Security Overview
Lesson 9:Portal Structure and Content
Lesson 10:Working with Projects

L ESSON 1: PIA
C HAPTER S TRUCTURE
Most chapters are structured the same way and generally consist of
the following:

Objectives. The objectives are found at the beginning of the


chapter and define what you will learn in the chapter.

Lessons. Each chapter has several lessons that explain the


various concepts. Some lessons contain practices and
exercises.

Practices are step-by-step instructions for completing a


procedure that the instructor and class participants walkthrough together.

Review Questions. You will find review questions at the end


of the document that recap material covered in the chapter.
The answers to the questions will be discussed among class
participants and the instructor.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

PIA-PEOPLESOFT INTERNET ARCHITECTURE

PeopleSoft started off with the traditional 2 tier architecture and proceeded
to the 3 tier in the later versions.

It was in the Version 8.0 that it adopted what is called the PeopleSoft
Internet Architecture or PIA that is its current day architecture. The PIA is a
server-centric component architecture that enables secure end user
access to PS applications.

Its components include the following:

Internet Access Device

Web Server

Application Server

Database Server

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

The key features of the PIA include:

Minimizes Training Effort

Reduced Application Deployment Costs

Lowered Client Hardware Requirements

Extensive Portability

Single Sign On

You are encouraged to ask your instructor questions throughout the entire
course.

L ESSON 2:I NTRODUCTION T O P EOPLE T OOLS


PS APPLICATION DESIGNER SNAPSHOT
This diagram shows the snapshot of Application designer. This is
the place where all the technical activities on entire PeopleSoft
object are done.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

ATTRIBUTES OF APPLICATION DESIGNER


A. PROJECT WORKSPACE

View projects and their associated definitions in the Project


Workspace.

A project organizes and presents the definitions of a business


application in logical groups for easier development, adaptation,
maintenance, and upgrade.

B. OBJECT WORKSPACE
To create and modify definitions, which can be maximized,
minimized, cascaded or tiled in the workspace.

C. OUTPUT WINDOW

The Output Window displays status messages of various


PeopleSoft Application Designer operations.

The output is organized into different categories using tabs at


the bottom of the window.

The text displayed in the output window is context-sensitive,


enabling you to select it to perform related operations. For

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

example, if you have a Field Definition open, select Edit, Find


Definition References to list the definitions that reference the
active field definition. The list appears in the Output Window.
.

OBJECTS IN PEOPLETOOLS

Field

Record

Page/Panel

Component

Menu

FIELDS
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Fields are the basic building blocks in the PS system; in database


terms represent columns in a table or view.

Number Field Type

TYPES OF FIELD
TYPES OF FIELD
Field Types
Character (Char)

Description
Alphanumeric field of fixed length.

Long Character
(Long)

Alphanumeric field of variable length used for textual entries,


such as comments or descriptions.

Number (Nbr)

Positive numeric field of fixed length for which decimals are


allowed.

Signed Number (Sign)

Positive or negative numeric field of fixed length for which


decimals are allowed.

Date (Date)

Date field of constant length. The system edits dates and


prohibits incorrect ones, such as day 42 or month 20. Date
fields always store a four-digit year.

Time (Time)

Time field of a constant length. Built-in edits prohibit


impossible times, such as hour 26, minute 70, or second 94.

DateTime (DtTm)

Date and time field of constant length. Built-in edits prohibit


impossible dates and times, as defined in the individual Date
and Time fields. DateTime fields always store a four-digit year.

Image (Img)

Image field to store images in a user-defined format, such as


JPEG or GIF.

ImageReference (Iref)

Field in which to change an image dynamically at runtime


using PeopleCode.

Attachment (Att)

Field that maps to a BLOB database type to hold the contents


of a file attachment. However, you should use the existing
field, FILE_DATA, if you need a BLOB column. For
attachments, use the subrecord ATTACH_DETAIL, which
contains FILE_DATA.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

RECORD
Fields that are grouped together as a unit are record definitions. A
record definition represents what the underlying Structured Query
Language (SQL) database tables look like and how they process
data.Two tabs exist in record definitions.

Record Field Tab

Record Type Tab

RECORD TYPES
TYPES OF FIELD
Field Types

Description

SQL Table

This is a physical SQL table in the database. Create this table


when you run the Build Operation from the Build menu. This
value is the default setting.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

TYPES OF FIELD
Field Types

Description

SQL View

Normal SQl Views

Dynamic View

Select to define a record definition that can be used like a


view in pages and PeopleCode, but is not actually stored as a
SQL view in the database. Instead, the system uses the view
text as a base for the SQL Select that is performed at runtime.
Dynamic views can provide superior performance in some
situations, such as search records and in PeopleCode
Selects, because they are optimized more efficiently than
normal SQL views.

Derived/Work

Select to define the record definition as a temporary


workspace to use during online page processing. A derived or
work record is not stored in the database, so you do not build
it.

SubRecord

Select to define the record definition as a subrecord: a group


of fields that is commonly used in multiple record definitions
and that you can add to other record definitions. This way, you
can change a group of fields in one place, as opposed to
changing each record definition in which the group of fields is
used.

Query View

Select to define the record definition as a view that is


constructed using the PeopleSoft Query tool.

Temporary Table

Select to define the record definition as a temporary table.


You can specify temporary images of the table on the
PeopleTools Options page. Use temporary tables for running
PeopleSoft Application Engine batch processes. Temporary
tables can store specific data to update without risking the
main application table.

PAGE
Pages are the graphical interface between your users and your
application database.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

PAGE TYPES
There are 4 categories of pages available in PeopleSoft. They are
Standard Page
Subpage
Secondary Page
Popup Page
Standard Page - This is the default page type used in PeopleSoft.
Sub Page -Instead of duplicating the same set of page fields on two or
multiple pages, you can create a single subpage that contains those
page fields and then add it to any page. Subpages provide an easy
way to maintain the functionality that the page fields represent.
Secondary Page-Secondary pages are accessed through another
page, usually by clicking a link or push button. This is normally used for
entering and updating data that is supplemental to the data on the
primary page or data that is common to and can be accessed from
multiple pages.
Popup Page -Pop-up pages are a type of PeopleSoft page that
displays information that supplements, expands, or enhances the
transaction page data. Pop-up pages are ideal for displaying

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

additional, more detailed information that is pertinent to a subset of


users

COMPONENT
A component represents a complete business transaction. It comprises
either a single page or set of pages that are meant to be processed as
one.

MENU
A menu is a logical grouping for assigning security to your system. You
create a menu as a placeholder for components.

SECURITY BASICS
Like other ERP security is an essential part for core business
essentials like PeopleSoft. We really dont want people from every
department have access to you data and applications. Now here
comes the security with prevents the data access for the normal users
and grant access only to some special super user access your
applications.
The three main PeopleSoft Security definition types are:

User profiles.

Roles.

Permission lists.

USER PROFILES
Each PeopleSoft user has an individual user profile, which in turn is
linked to one or more roles. One or multiple permission lists, which
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

decides what a user can and cannot access, to each role. A few
permission types are assigned directly to the user profile.
A user profile must have at least one role in order to be a valid profile.
The majority of values that make up a user profile are inherited from
the linked roles.
ROLES
Roles are intermediate objects that link user profiles to permission
lists. You can assign multiple roles to a user profile, and you can
assign multiple permission lists to a role.
PERMISSION LISTS
Permission lists are groups of authorizations that you assign to roles.
Permission lists store sign in times, page access, PeopleTools access,
and so on.
A permission list may contain one or more types of permissions. The
fewer types of permissions in a permission list, the more modular and
scalable your implementation.
A user profile inherits most of its permissions through roles, but you
apply some permission lists, such as process profile or row-level
security (data permissions), directly to a user profile.

PORTAL STRUCTURE AND CONTENTS


NA

WORKING WITH PROJECTS


PeopleSoft projects can have all or any of the above defined objects.
We put everything that is required for an application into a single object
that is known as Project. Projects help to maintain and manage all the
objects pertaining to a single application.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 2: P EOPLE T OOLS 2


In this chapter we will cover the following topics:
Lesson 1: Views.
Lesson 2: Search Record.
Lesson 3: Prompt Table Edits.
Lesson 4:Sub records and Subpages
Lesson 5:Interactive & Deferred processing modes
Lesson 6:Advanced Page Design
Lesson 7:Images
Lesson 8:Introduction to PeopleCode
Lesson 9:Images
Lesson 10:Customization and Ramification

L ESSON 1: V IEWS
There are 2 types of views that is used by PeopleSoft

SQL View

Dynamic View

SQL View - It is the normal database view.To create the SQL view,
click the Click to open SQL Editor Button, enter a SQL Select
statement, and then run the Build process
Dynamic View - Select to define a record definition that can be
used like a view in pages and PeopleCode, but is not actually
stored as a SQL view in the database. Instead, the system uses the
view text as a base for the SQL Select that is performed at runtime.
Dynamic views can provide superior performance in some
situations, such as search records and in PeopleCode Selects,
because they are optimized more efficiently than normal SQL
views.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 2: U SING S EARCH R ECORDS


Search Record is a record attached to a PeopleSoft Component.
The Component Processor performs a search against the search
record to retrieve relevant data from the database and populate it
into the Component buffer during the Component build.
Every Component in PeopleSoft should have a search record
associated with it. On the search page for the component, a user
can input values against each search key to retrieve the data. She
may also chose the alternate search keys from a drop down on the
search page.
Search records are used for the following purposes:

The search record builds the search page for the component.

The search record builds the search query, which fetches the
component data and populates level 0 for every page in the
component.

When you click a content reference to access a component, the


system examines the search record and dynamically builds the
search page based on the search key, alternate search key, and list
box item properties of the search record. If you designate fields as
search keys or alternate search keys, then those fields appear on
the search page. When the user enters values in the search fields
and clicks the Search button, the system incorporates those values
into the WHERE clause of the search query. If the values provided
by the user uniquely identify one row of data, then the system
proceeds directly to the main page with the available information.
Otherwise, the query retrieves the rows that match the criteria and
displays the rows in a list box at the bottom of the search page. If
you define fields as list box items on the search record, the system
displays those fields as columns grid in the result set.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Image: Search page with search keys, alternate search keys,


and list box items
This example illustrates the fields and controls on the Search page
with search keys, alternate search keys, and list box items. You can
find definitions for the fields and controls later on this page.

Search Page

L ESSON 3: P ROMPT T ABLE E DIT


In PeopleSoft , we have different ways to edit (Dictionary
meaning ,To modify or adapt so as to make data we enter suitable
or acceptable).
Edits helps user to select valid data from a list of values. Below are
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

the types of Edit available in PeopleSoft


1. Prompt Table With NoEdit
2. Prompt Table With Edit
3. Yes/No Table Edit
4. Translate Table Edit

1. Prompt Table WithNoEdit-Displays list of values for the user to


select. If user enters some other value which is not present in the
listthen the new value is accepted by the system.
2. Prompt Table With Edit-Displays the list of values for the user to
select. User had to select only those values. If some other value
isentered the system throws an error saying, "Invalid Value".
3. Yes/No Table Edit - This Edit can be used for checkbox. By
Default it will be checked (Y). For Example, In any of theapplication
pages, if there is an Address details which needs to be provided we
can use this option. Address same as Permenant Address?
4. Translate Table Edit-This will list the users to select data from
dropdown. The length of the field should not exceed 4 char. The
translate values for this type of field are stored in Peopletools table

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

PSXLATITEM. Example: This is used to display Marital Status of an


employee etc.

L ESSON 4: S UB RECORD
A subrecord definition is created much the same way as any record
definition. You define the group of fields that have a common
functionality and save them as a Subrecord type to be used in other
record definitions. This allows the group of fields to easily be
changed in one place, instead of needing to change all record
definitions this group of fields resides.

P RACTICE C REATING
D EFINITION

S UB R ECORD

Access the application designer.


To create a new subrecord definition:

1. Click File
2. Click New
3. Click Record

4. Click
The object workspace appears so that you can
build a list of fields in a record definition.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Select

tab and choose Record Type SubRecord

5. Insert Fields into the Record Definition


Insert field definition by
Insert/Field
Or drag and drop field in
project
Or drag and drop field
from record definition in
project

6. Click File
7. Click Save
Record definition names
should be preceded with ASU_ to
make them easily identified during
Proprietary, and, Confidential,
to, CedarCrestone,
an upgrade
process Inc.>
Subrecords are given a _SBR
suffix to further identify them as a
subrecord.

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Type Record Definition Name

8. Click

There is no need to do the build process on a


subrecord definition since it will have no underlying
database table but only participate in other record
definitions.

U SING

S UBRECORD
Once the Subrecord has been established, it can be
utilized in other record definitions. It is fully supported to
have any number of nested subrecords.

P RACTICE I NSERTING

S UB R ECORD D EFINITION

Access the application designer.


To insert a subrecord definition:

1. Click File
2. Click New
3. Click Record

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

4. Click
The object workspace appears so that you can build a
list of fields in a record definition.

5. Click Insert
6. Click Subrecord
Choose a subrecord from the list.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

7. Click

The subrecord is inserted into the record


definition.
8. Click File
9. Click Save
Type Record Definition Name
Record definition
names should be preceded
with ASU_ to make them
easily identified during an
upgrade process

10. Click

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

V IEWING

S UBRECORD
Once the subrecord has been inserted into another
record definition, it will not be fully displayed when
the record definition is brought into the workspace
window. You will need to click on the Expand
button to see all the fields of the subrecord.

The Field Type of SREC signals


a subrecord that has not been
expanded.

Click
To expand the
view of the
subrecord.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 5: S UB P AGE
C REATING S UBPAGES
A subpage definition is created much the same way as any record definition.
You define a page definition that has a common functionality in the page
controls and save it as a Subpage type to be used in other page definitions.
During design time, you add only the subpage control to represent all of the
controls in the subpage. You maintain those controls in only one placethe
subpage definition. At runtime, you see all of the controls that are defined in
the subpage on the page.

P RACTICE C REATING

S UB P AGE D EFINITION

Access the application designer.


To create a new subrecord definition:

1. Click File
2. Click New
3. Click Page

4. Click

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

The object workspace appears with a new page


layout to build a subpage definition.

5. Click File, Definition Properties, Use Tab

Change the Page Type to


Subpage.
Since it is a subpage, you
may need to change the
Page Size to be a Custom
Size. This will allow it to fit
on other pages.

Once youve added the page controls.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

6. Click File, Save


Page definition names
should be preceded with ASU_ to
make them easily identified during
an upgrade process
Generally, subpages are given a
_SBP suffix to further identify
them as a subpage.

7. Click

U SING

S UBPAGE
Once the Subpage has been established, it can be
utilized in other page definitions.

P RACTICE I NSERTING

S UB P AGE D EFINITION

Access the application designer.


To insert a subpage definition:

1. Click File
2. Click New
3. Click Page

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

4. Click Insert
5. Click Subpage

Subpage Record Name


Substitution
The subpage is built with a
primary record but when it is
added to a page, another record
can be used, depending on the
context of the page that the
subpage is involved.
Normally, a subpage is defined
with a sub record combination so
that it all can be re-used
depending on the functionality of
the pages it will be involved.

6. Chose the subpage to insert from the


dropdown.
7. Choose a record definition to substitute for
the primary record of the subpage.
8. Click
9. Continue to build page controls
10. Click File, Save

11. Type in Page Name


12. Click

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 6: P ROCESSING M ODE


PeopleSoft application can run in 2 different modes

Interactive Mode
In interactive mode, when the user exits a field that has a field-level
event
1. A transmission to the application server occurs immediately so
that it runs the field-level event.
2. The system refreshes the data & information.

Deferred Mode
In deferred mode, the application enables you to temporarily delay
many of the conditions that need server processing an event or
condition is encountered that requires immediate processing or until
you request processing manually. For example, when a user exits a
field that has a field-level event (like FieldChange or FieldEdit
PeopleCode, prompt validation, related display, and so on), that
event is not processed until the next transmission to the application
server. When the next transmission to the server occurs,
PeopleTools determines which fields have changed since the last
transmission. Then, logic on the application server runs the
appropriate system edits and PeopleCode events (in field layout
order).

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 3: P EOPLE C ODE


In this chapter we will cover the following topics:
Lesson 1: PeopleCode language.
Lesson 2: PeopleCode Location.
Lesson 3: PeopleCode Data Types.
Lesson 4:Events
Lesson 5:Built in Function
Lesson 6:Custom Functions
Lesson 7:Component Buffer
Lesson 8:Debugging and Tracing
Lesson 9:OO PeopleCode
Lesson 10:App Package
Lesson 11:Traversing through Component Buffer
Lesson 12:Push Button and Hyperlink
Lesson 13:Data Buffer Methods
Lesson 14:Executing SQL in PeopleCode
Lesson 15:Add Mode
Lesson 16:Final Activity

L ESSON 1: P EOPLE C ODE L ANGUAGE & S YNTAX


PeopleCode is an (OOL) object-oriented proprietary (case-insensitive) language
used to express business logic for PeopleSoft applications. In its fundamentals,
PeopleCode syntax resembles other programming languages. Some aspects of
the
PeopleCode
language,
however, are
specifically related
to
the PeopleToolsenvironment. However, the fundamentals of objects and classes
are the same as in Java language

PeopleCode Example

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 2: P EOPLE C ODE L OCATIONS


PeopleCode can be written in lot of places. Usually it is written across
Various events in field level, record level, component level
Page, Menu
Application Engine
App Package
Application Message

L ESSON 3: P EOPLE C ODE D ATA T YPES


PeopleCode includes these conventional data types:

Any

Boolean

Date

DateTime

Float

Integer

Number

Object

String

Time

Any - When variables and function return values are declared as Any, the
data type is indeterminate, enabling PeopleTools to determine the
appropriate type of value based on context. Undeclared local variables are
Any by default.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 4: P EOPLE C ODE E VENTS


Every PeopleCode program is associated with Application Designer definition
and Event.Events are predefined points either in the Component Processor flow
or Program flow (for application messages.)As each point is encountered, the
event fires on each definition, triggering any PeopleCode program associated
with that definition and that event.Each class of definitions in Application
Designer can have an event seta group of events appropriate to that definition.
A definition can have zero or one PeopleCode programs for each event in its
event set.You can have PeopleCode attached to various levels within the
program flow.
PeopleCode Events at various level

R E CO R D F I E L D E V E N T S :

FieldChange event
FieldDefault event
FieldEdit event
FieldFormula event
PrePopup event
RowDelete event
RowInit event
RowInsert event
RowSelect event
SaveEdit event
SavePostChange event
SavePreChange event
SearchInit event
SearchSave event
Workflow event

C OM PO N E N T R E C O R D E V E NT S

RowDelete event
RowInit event
RowInsert event
RowSelect event
SaveEdit event
SavePostChange event
SavePreChange event
SearchInit event
SearchSave event

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

C O MP O NE NT R E CO RD F IE L D E VE N T S :

FieldChange event
FieldDefault event
FieldEdit event
PrePopup event

C O MP O NE NT E VE NT S

PostBuild event
PreBuild event
SavePostChange event
SavePreChange event
Workflow event

P AG E E V E NT S

Activate

M E NU E VE NT S

Item Selected

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 5: DERIVED/ W ORK R ECORDS


A derived or work record is not stored in the database, so you do not build
it. Translate values are associated with the Field Definition, not the record
definition.
Derived fields are often used for online processing to display calculated
data that you would not want to store in a normalized database, but they
can also be used to give the user options for the behavior of the system.
For example, push buttons are often (usually?) fields on derived records
which execute peoplecode. You can think of a field on a derived record as
a component-level variable that can be accessed by any peoplecode
event within the scope of the component, but because it is on a record
definition, it can also have peoplecode attached to it that will execute at
appropriate times during component processing (depending on what
events the code is written in).

L ESSON 6: PEOPLECODE

BUILT IN FUNCTIONS

Like any other Object Oriented Language PeopleSoft also have functions.
PeopleCode supports the following types of functions:

Built-in: The standard set of PeopleCode functions. They dont needs to be


declared and can be called or used to just calling by their names.

Internal: Functions that are defined (using the Function statement) within
the PeopleCode program in which they are called.

External PeopleCode: PeopleCode functions defined outside the calling


program. These are generally contained in record definitions that serve as
function libraries.

External non-PeopleCode: Functions stored in external (C-callable)


libraries.

P EOPLE C ODE B UILT

IN FUNCTIONS

There is a whole lot of essential built in functions that can be used while writing
Peoplecode.There are functions to handle very common requirement across area
like Date Time,Email,Files,Images,Integration Broker,Math,Logical etc.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 7: WRITING

ON YOUR OWN

F UNCTIONS

Steps to write your functions


S T E P 1: D E C L A R E

THE

FUNCTION

Declare the function on the top of the programme.We as an convention generally


write the peoplecode for the function in the records whose name begin in
FUNCLIB_ and the code are always attached to FieldFormula events.
The following is an example of a function declaration of a function that is in
another FUNCLIB record definition:
Declare Function Sum PeopleCode FUNCLIB_MATH.OPERATIONFieldFormula;
S T E P 2:D E F I N E

THE

FUNCTION

PeopleCode functions can be defined in any PeopleCode program. Function


definitions must be placed at the top of the program after function declaration,
along with any variable and external function declarations. The syntax for a
PeopleCode function definition is as follows:
FunctionSum(&x as number,&y as number)Returnsnumber
&z=&x+&y;
Returns &z;
End-function
S T E P 3: F U N C T I O N C A L L S

Functions are called with this syntax:


function_name([param_list])
Example:
&result=Sum(10,12);
Winmessage(Summation result= |&result);

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
FUNCTION NAMING CONFLICTS:

If you declare any function with name similar to that of any built in function you
will get a error saying User-defined function IsNumber is overriding the built-in
function of the same name. (2,98)

L ESSON 8: COMPONENT B UFFER


Component Buffer is the area in the memory that stores data
associated with the presently active component. When a page in
any component is opened, the system retrieves all of the data
records for the entire component and stores them in one set of
record buffers, organized by scroll level and then by page level. It
consists of rows of buffer fields that hold data for the records
associated with page controls, including primary scroll records,
related display records, derived/work records, and Translate table
records. PeopleCode can reference buffer fields associated with
page controls and other buffer fields from the primary scroll record
and related display records.
PeopleSoft provides easy access to data in the component buffer
from within PeopleCode for the developers to perform business
logic.
Data buffer is a storage space in memory. It can refer to component
buffers, buffers loaded by an Application Engine program or a
Component Interface.

L ESSON 9: DEBUGGING& T RACING


The two most commonly used method for Peoplecode tracing are:

SETTING

TH E T RA CE AT

L O G IN S CRE E N :

1.Select Trace at the login screen or add &trace=Y to the login URL Or
To set trace flags, click here (use this link)
2.Choose the options in the tracing screen and login.
3.Perform the actions you wish to record.
4.Once complete logout and retrieve the file from the /appserv//LOGS
directory. The trace file name will include your login name.

SETTING

TH E T RA CE F RO M

P E O P L E T OO L S :

1. Login to PeopleSoft and navigate to PeopleTools > Debug.


2. Choose the options and save.
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
3. Perform the actions you wish to record.
4. Once complete logout and retrieve the file from the/appserv//LOGS
directory. The tracefile name will include your login name.

L ESSON 10: APPLICATION P ACKAGE

AND

OOP C ONCEPTS

Application package is a container for application sub packages and


application classes, which will provide a hierarchical structure to your
People Code programs and help you extend the common functionality of
existing People Code classes (Rowset, Array, and so on) from one
application to another.

A PPLICATION C LASS :

App Class is a People Code Program at base level

Application classes are mainly used for reusability.

Application classes people code supports object oriented programming ,


i.e. it supports :
Classes and Objects.
Encapsulation.
Abstraction.
Polymorphism.
Inheritance.

OOP C ONCEPTS
CLASS:
Class is a blueprint of the object .It consists of variable and methods.
Class doesnt occupy any memory.Example: Class is a map for building
the house.

OBJECT:
Object is a real entity any thing physically exists in the world is called an
object.But in programming languages object is instance of a class .It
occupies some memory. Example: Object is house.

ENCAPSULATION:
Its came from the word capsule. It is a property to bind the variable and
methods and also it hides the internal structure. It prevents clients from
seeing the inside view. We can achieve abstraction through encapsulation.
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Example: car driver doesnt know what the functionality is when gear is
changed one level to another level. But he change the gear against to the
speed.

A BSTRACTION :
Abstraction is process it allows to show the essential object information to
the user i.e hide the non essential object information. We can achieve this
through encapsulation.

I NHERITANCE :
It is one of the most important feature of Object Oriented Programming. It
is the concept that is used for reusability purpose. Inheritance is the
mechanism through which we can derived classes from other classes. The
derived class is called as child class or subclass. The class from which
the subclass is derived is called a superclass (also a base class or
a parent class).

P OLYMORPHISM :
A method having different forms is called polymorphism i.e method having
the same name but we can perform different tasks by using this
polymorphism.
We have to concepts here
1.method overloading.
2.method overriding.

P ROCESS

FOR CREATING PACKAGE AND CLASSES :

application designer new definition application package insert


application class

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

A PPLICATION C LASSES G ENERAL S TRUCTURE

Import class

Class name

Class extensions

Declaration of public external interface

Declaration variables and methods

Definition of methods

D ATA T YPES
Conventional data types include number, date, string. Use them for basic
computing. Object data types instantiate objects from PeopleTools class.

Conventional data types.

Object data types.

C LASS E XTENSION
It is nothing but inheritance. We can extend the properties and methods
of one class into another class using extends key word
Example:
class Fruit

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
methodDoFruit();
property number FruitNum instance;
end-class;
class Banana extends Fruit
methodDoBanana();
property number BananaNum instance;
end-class;

A subclass inherits all of the public methods and properties of the class it
extends. These members can be overridden by declarations of methods
and properties in the subclass.
Note. Application classes have no multiple inheritance

A CCESS C ONTROLS
We can control the access by public , private, protected access specifiers.
Public
Protected
Private
example: class A
property number a1;
method number a1;
protected:
property number a2;
method number a2;
private:
property number a3;
method number a3;

D EFINITION

OF

M ETHODS

The system never skips to the next top-level statement.


Pass parameters by value.
Parameter passing with object data types is by reference.
Application programs use the out specifier to pass a parameter by reference.

Note:Application class properties are always passed by value.


Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Passing Parameters with Object Data Types value and reference:


Parameters with object data types are always passed by reference
Example:
methodmyMethod(&arg as MyObjectClass);
/*method myMethod(&arg as MyObjectClass out);
Local MyObjectClass&o1 = create MyObjectClass("A");
Local MyOtherObjectClass&o2 = create MyOtherObjectClass();
&o2.myMethod(&o1);
Method myMethod
&arg = create MyObjectClass("B");
end-method;

note : Since the method argument is reassigned within the body of myMethod,
&o1 does not point at the new instance of MyObjectClass
Passing variable by value and reference
/* argument passed by reference */
method increment(&value as number out);
/* argument passed by value */:
method increment(&value as number);
classAddStuff
methodDoAdd(&P1 as number, &P2 as number out);
end-class;
methodDoAdd
&X = &P1 + &P2;
&P1 = 1;
&P2 = 2;
end-method;
localAddStuff&Aref = Create AddStuff();
local number &I = 10;
local number &J = 20;
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
&Aref.DoAdd(&I, &J); /* changes &J but not &I */
&Aref.DoAdd(10, 20); /* error - second argument not variable */

D ECLARATION

OF

A BSTRACT M ETHODS

AND

P ROPERTIES

Sample code:
classMyInterface
method MyMethod1() abstract;
method MyMethod2() Returns string abstract;
method MyMethod3();
property string myproperty1 abstract readonly;
property number myproperty2 abstract;
property number myproperty3 abstract;
end-class;
method MyMethod3
/*body
end-method;

Considerations using abstract methods:

You cannot have private abstract methods.


You will receive an error if you try to provide a method body for an
abstract method.
The method signatures must be identical between the abstract method
definition and the method implementation in the derived.

I NTERFACES
Defining an application class which is totally composed of abstract
methods and properties is called interface it avoids the problem in multiple
inheritance.
Interface MyInterface
method MyMethod1();
method MyMethod2() Returns string;
property string myproperty1 readonly;
property number myproperty2;
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
property number myproperty3;
end-class;

When you provide an implementation for an Interface you can also use the
keyword Implements instead of Extends

C ONSTRUCTORS

The constructor for a class is the public method with the same name
as the (short name of the) class. The statements contained in this
method (if any) provide the initialization of the class.
This constructor is always executed when an object of the class is
instantiated
class a
method a();
end-class;

I MPORT D ECLARATIONS

Import Fruit:*;
Import Fruit:Banana;
Import Fruit:Drinks:*;

Here any import classes having same short name we must use full name of the
class for creating or initiating object to that class.

M EMBER R EFERENCING
1. %THIS - Self-Reference
A method can refer to the current object using the %This. system
variable.
%This is an object of either the method's class or a subclass of the
method's class.
Ex:1
classFactorialClass
method factorial(&I as number) returns number;
end-class;
method factorial
if&I <= 1 then
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
return 1;
end-if;
return&I * factorial(&I - 1); /* error - factorial undefined */
return&I * %This.factorial(&I - 1); /* okay */
end-method;

2. %SUPER Super Class Reference


A method can refer to a member of its superclass by using the %Super
system variable. This construction is needed only to access superclass
members that are hidden by overriding members in the current class.
class BuildingAsset
methodDisasterPrep();
end-class;
methodDisasterPrep
/* some body*/
end-method;
classVancouverBuildingextendsBuildingAsset
methodDisasterPrep();
end-class;
methodDisasterPrep
%Super.DisasterPrep(); /* call superclass method */
end-method;
localBuildingAsset&Building = Create VancouverBuilding();
&Building.DisasterPrep();

G ET

AND SET METHODS :

class xxx
property string StringProp get set;
end-class;
getStringProp
return "string"; /* Get the value from somewhere. */
end-get;
setStringProp
/* Do something with &NewValue. */
end-set;

U SING V ARIABLES

IN

Instance variables.
Global variables.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

A PPLICATION C LASSES :

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Overriding variables and properties.

S COPE

OF

A PPLICATION C LASSES :

Application classes can be instantiated only from PeopleCode.


These classes can be used anywhere you have PeopleCode, that is, in
message notification PeopleCode, Component Interface PeopleCode,
record field PeopleCode, and so on.

L ESSON 11: T RAVERSING

THE

C OMPONENT B UFFER

In My Example I have used following levels and rowset, in your case it could be
another rowset or derived/work record too:
Level0= PERSONAL_DATA (Example EMPLID=1234567)
Level1=EMPL_CAREER (Example CAREER=UnderGrade)
Level2=EMPL_ACAD_PROG (Example Program = BBA, BSC)
Level 1:
Employee
Personal Data

Level 2:
Employee
Qualification Details

Level 3:
Employee Program

Level 0 Rowset

You first obtain the level zero rowset, which is the PERSONAL_DATA rowset. You
do not need to know the name of the level zero rowset to access it:
&LEVEL0 = GetLevel0();
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Rows of Level 0

The next object to get is a row. As the following code is working with data that is
loaded from a page, only one row is at level zero. However, if you have rowsets
that are populated with data that is not based on component buffers (for
example, an application message), you may have more than one row at level
zero.
&LEVEL0_ROW = &LEVEL0(1);
Child Rowsets

To obtain the level two rowset, traverse through the level one rowset first.
Therefore, the next object to get is the level one rowset, as shown in the
following example:
&LEVEL1 = &LEVEL0_ROW.GetRowset(SCROLL. STDNT_CAREER);
Obtaining Subsequent Rows (usually we go to level3 but if you have more
then you can go further)

If you are traversing a page, obtain the appropriate row after you get a rowset. To
process all the rows of the rowset, set this functionality up in a
loop, as shown in the following example:
Obtaining Level2 Rowsets, Rows and Field Value(Complete Code)

We want to process all the rows at level two


&LEVEL0 = GetLevel0();
&LEVEL0_ROW = &LEVEL0(1);
&LEVEL1 = &LEVEL0_ROW.GetRowset(SCROLL. STDNT_CAREER); /*it will loop every
career*/
For &I = 1 to &LEVEL1.ActiveRowCount
&LEVEL1_ROW = &LEVEL1(&I);
&LEVEL2 = &LEVEL1_ROW.GetRowset(SCROLL. STDNT_ACAD_PROG);
For &J = 1 to &LEVEL2.ActiveRowCount /*it will loop every program under career*/
&LEVEL2_ROW = &LEVEL2(&J);
&RECORD = &LEVEL2_ROW. STDNT_ACAD_PROG;
&FIELD = &RECORD.Descr;
/* Do processing */
End-For;
End-For;

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 12: P USH B UTTON

AND

H YPER L INKS

PeopleTools allows you to add buttons and hyperlinks to your web pages. A push
button and a hyperlink are really the same thing. The only difference is their
appearance, which you choose when you create the button.
When you create push buttons you have several different options for the type
that you will use. The most common type of Push button is a PeopleCode push
button. PeopleCode push buttons are attached to a field on a record definition,
just like an edit box on a page. You must place your PeopleCode program within
the FieldEdit and/or FieldChange event of the Record PeopleCode.
When push button is selected, FieldEdit or FieldChange PeopleCode that has
been attached to that field will be performed.
You can also choose other actions for your push button. You can link a push
button or hyperlink to any one of nine different actions:

External Link

Internal Link

Page Anchor

PeopleCode command

Process

Prompt Action

Scroll action

Secondary page

Toolbar action
Push buttons allow the application developer the flexibility to trigger
processing based on a user request by clicking the push button or
hyperlink.

Use of Push Buttons & Hyperlinks:


Trigger an email
Perform data inquiries
Assign defaults or accomplish whatever you want.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Just remember that push buttons are attached to fields on a page. It can
be any field, on any record definition. However, most buttons and
hyperlinks are attached to derived/work records.
Event Sequence for Push Buttons.
When a push button is selected, the component processor determines the
field where it is attached. Any FieldEdit PeopleCode attached to the field is
then executed. Once the FieldEdit executes successfully, FieldChange
PeopleCode is triggered.
Steps to create a Push Button or Hyperlink.
1. Add your Push Button or Hyperlink control to the page and attach it to a
record / field.
2. On the Page Field Properties, select the action for the button and set its
properties.
3. If you are using PeopleCode, place your Program within the
FieldEdit/FieldChange event(s). When the push button is selected, the
Component processor determines the field where it is attached, then any
FieldEdit and FieldChange PeopleCode attached to the field is executed.

L ESSON 13: D ATA B UFFER C LASSES


In PeopleCode there are four data buffer classes

Rowset Class
Row Class
Record Class
Field Class

These four classes are used for accessing Component Buffer data.
Below is the Traversing Order of these classes:
Rowset -> Row -> Record -> Field

Now lets have a detail overview of these classes one by one.


1.Rowset Class: A rowset object, instantiated from a Rowset class, is a
collection of rows associated with buffer data. A component scroll is a rowset.
You can also have a level 0 rowset.
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

If a rowset object is instantiated using the CreateRowset function, the rowset


object thats instantiated is a standalone rowset. Any records and field references
created by this function are initialized to null values, that is, they do not contain
any data. You can populate this rowset object using the CopyTo, Fill, or
FillAppend methods.
Built-in Functions for Rowset Class:

CreateRowset
GetLevel0
GetRowset

a. The CreateRowset function creates an unpopulated, standalone rowset.


Syntax:
CreateRowset ({RECORD.recname | &Rowset} [, {FIELD.fieldname,
RECORD.recname |&Rowset}] . . .)
Example :
Local Rowset &RS;
&RS = CreateRowset (RECORD.QA_INVEST_DTL);

b. GetLevel0 creates a rowset object that corresponds to level 0 of the


component buffer. This function returns a rowset object that references the
base rowset. For a component, this is the level 0 of the page. For a
PeopleSoft Application Engine program, this is the state record rowset.
For a message, this is the base rowset.
Example :
The following code sample returns the level one rowset.
Local Rowset &ROWSET
&ROWSET = GetLevel0()(1).GetRowset(SCROLL.LEVEL1_REC);

c. The GetRowset function to get a rowset object based on the current


context. That is, the rowset is determined from the row containing the
program that is running.
Syntax :
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

GetRowset ([SCROLL.scrollname])
Example:
In the following example, RS1 is a level 1 rowset, and RS2 is a child
rowset of RS1.
Local Rowset &RS1, &RS2;
&RS1 = GetRowset();
&RS2 = GetRowset(SCROLL.EMPL_CHKLST_ITM);

With no parameters, GetRowset returns a rowset object for the rowset


containing the currently running program. If a parameter is specified, it
returns a rowset for that child scroll. Scrollname must be the name of the
primary record for the scroll.
2.Row Class: A row object, instantiated from the Row class, is a single row of
data that consists of one to n records of data. A single row in a component scroll
is a row.
A row may have one to n child Rowsets. For example, a row in a level two scroll
may have n level three child rowset. CopyTo and GetRecord are two commonly
use methods for this class.
Visible and IsChanged are two commonly used properties for this class.
Built-in Functions :

GetRow

Methods :

CopyTo
GetRecord

The GetRecord method creates a record object that references the specified
record within the current row object.
Example:
&REC = &ROW.GetRecord(RECORD.QEPC_LEVEL1_REC);
Properties:

Visible

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Ischanged
Childcount
Ischanged property returns True if any field value on the primary database record
of the row has been changed.
Example :
&tmp = &ROW.IsChanged;
if&tmp = True then
Warning("A Field on this row has been changed");
End-If;

Childcount property returns the number of child rowsets of the row. It is defined
by the "structure" of the scroll, so it is the same for all rows of the rowset.
It might be used, in conjunction with the GetRowset method, to write code that
examines all child rowsets.
Example
For &I = 1 to &ROW.ChildCount
&ROWSET = &ROW.GetRowset(&I);
/* do processing */
End-For;

3.Record Class : Record object, instantiated from the Record class, is a single
instance of a data With in a row and is based on a record definition. A record
object consists of one to n fields.
CopyFieldsTo is a commonly used method for the record class. Name,
IsChanged, and FieldCount are commonly used properties.
Built-in Functions:

GetRecord
CreateRecord

CreateRecord creates a standalone record definition and its component set of


field objects. The specified record must have been defined previously, that is, it
must have a record definition.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Example:
Local Record &REC2;
&REC2 = CreateRecord(RECORD.OPC_METH);

Methods:

CopyFieldsTo
CompareFields

The CopyFieldsTo method copies all like-named field values from the record
object executing the method to the specified record object. This copies all field
values. To copy only changed field values, use the CopyChangedFieldsTo
method.
Example:
Local Record &REC, &REC2;
&REC = GetRecord(RECORD.OPC_METH);
&REC2 = CreateRecord(RECORD.OPC_METH_WORK);
&REC.CopyFieldsTo(&REC2);

The CompareFields method compares all like-named fields of the record object
executing the method with the specified record object.
Example:
&REC = GetRecord(RECORD.OP_METH_VW);
&REC2 = GetRecord(RECORD.OPC_METH);
If &REC2.CompareFields(&REC) Then
WinMessage("All liked named fields have the same value");
End-If;

4.Field Class : A field object, instantiated from the Field class, is a single
instance of data within a record object, and is based on a field definition.
SetDefault is a frequently used method. Name, Enabled, and Type are several
commonly used field properties.
Built-in Functions:

GetField

GetField creates a reference to a field object for the current context; that is, from
the row containing the currently executing program.
Example:
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

&FIELD = GetRow().recname.fieldname;
Methods:

SetDefault

SetDefault sets the value of the field to a null value, or to a default, depending
on the type of field.
Example:
&CHARACTER.SetDefault();

Properties:

Name
Enabled
Type

L ESSON 14: E XECUTING SQL

IN

P EOPLE C ODE

We can execute the SQLs in PeopleCode by the following ways

Where a SQLExec(built-in function) only delivers a single row, using


the SQL class you can retrieve and process multiple rows.

Instantiate a SQL object with the CreateSQL built-in function.

Use CreateSQL("SQLString") when you pass a text string to your


SQL object.

Use GetSQL(SQL.sqlname) when you get the SQL from a SQL


definition.
Example
&SQL = CreateSQL("SQL Statement",[bind values]);
(You can also choose to omit the values for the bind variables and supply those values
later. For Insert, Update, or Delete commands these values would be supplied

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

using Execute method. If you supply all the necessary input values, the SQL is executed
immediately.)

&SQL = CreateSQL("SQL Statement");


&SQL.Execute([bind_values]);

For a SQL object containing a Select statement, the Fetch method is used
to retrieve the next row from the cursor.

L ESSON 15: A CTION M ODES

IN

P EOPLE S OFT

PeopleSoft allows you to access most records of information in the following 4


action modes.

Add
Update/Display
Update/Display All
Correction

AddMode - Allows you to add a new person or other item to the database.
Update/Display Mode -Allows you to view and update information in existing
records by inserting new rows of data. It displays all current and future
information.
Update/Display AllMode - Allows you to update information in existing records
by inserting new rows of data. It displays all current, future, and historical
information.
CorrectionMode - It is very powerful. As such, very few users will have access
to Correction mode. It allows you to view and make changes to data currently in
the database.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

A PPLICATION E NGINE
Application Engine is a People Tool designed to help you develop
background SQL processing, Interfacing and Reporting. Advantages of
Application Engine Program include Restart Facility, Platform
Independent, Meta SQL Support, Performance, Effective Date and
Parallel Processing.
In this chapter we will cover the following topics:

Lesson 1: Running Application Engine Program.

Lesson 2: Types of Application Engine Program.

Lesson 3: Sections, Steps and Actions.

Lesson 4: Constructing Application Engine Programs.

Lesson 5: Working with State Records.

Lesson 6: Tracing and Debugging.

Lesson 7: Actions in Application Engine Program.

Lesson 8: Inserting and Updating data into tables using AE.

Lesson 9: People Code techniques for AE Program.

Lesson 10: Dynamic calls to program Sections.

Lesson 11: Writing efficient SQL in Application Engine Program.

Lesson 12: Meta SQL.

L ESSON 1: R UNNING A PPLICATION E NGINE P ROGRAM .


We can run Application Engine Program in following ways.

Creating Process Definition.


Navigate to People Tools >> Process Scheduler >> Processes to access
Process Definition Page.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

AE Process Request Page.


Navigate to People Tools >> Application Engine >> Request AE to
access Application Engine Request Page.

Using People Code.


To call a specific Application Engine program from a page using People
Code, use the CallAppEngine function in SavePreChange or
SavePostChange People Code. The basic syntax for CallAppEngine is:
CallAppEngine (applid[, statereclist, processinstance])

Command Line.
To start application engine program from command line, you must specify the
AE executable (PSAE.exe) file followed by the required parameters.
Ex: psae -CTdbtype -CSserver -CDdatabase_name -COoprid -CPoprpswd?
-Rrun_control_id -AIprogram_id -Iprocess_instance -DEBUG (Y|N)? -DR (Y|
N) -TRACEtracevalue -DBFLAGSflagsvalue -TOOLSTRACESQLvalue?
-TOOLSTRACEPCvalue -OTouttype -OFoutformat -FPfilepath

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 2: T YPES OF APPLICATION E NGINE


P ROGRAMS .
There are 5 types of Application Engine Programs. We can specify
program type in the Application Engine properties.

Standard- This is normal standard Application Engine Program

Upgrade Only- This is used in PeopleSoft import utilities.

Import Only- This is used in PeopleSoft import utilities

Daemon Only- This is used in Daemon process

Transform Only This is used to support XSLT (Extensible


Stylesheet Language Transformations)

L ESSON 3: S ECTIONS , S TEPS AND ACTIONS


Application Engine is made up of below key elements:

Sections.
Sections include one or more steps and are equivalent to a COBOL
paragraph or an SQR procedure. All Application Engine programs must
contain at least one section entitled MAIN.
A section is a set of ordered steps that is executed as part of a program.
You can call sections (and other programs) from steps within other
sections.

Steps.
Steps are the smallest unit of work that can be committed within a
program. Although you can use a step to execute a PeopleCode
command or log a message, typically you use a step to execute a SQL
statement or to call another section. The SQL or PeopleCode that a step
executes are the actions within the step.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

When a section is called, its steps execute sequentially. Every program


begins by running the first step of the required section called MAIN and
ends after the last step in the last section completes successfully.

Actions.
We can use multiple Actions within the Steps. Application Engine is
having below Actions.

Do Select: Used to write SQL statements. It works like FOR loop.


Subsequent Actions will be executed based on the no. of rows
return by the query.

Do While: Used to write SQL statements. It works like WHILE


condition. Subsequent Steps will be executed until the select not
return any row.

Do When: Used to write SQL statements. It works like a IF


condition, if the select statement returns rows or a row it will
execute the subsequent Steps once.

Do Until: Used to write SQL statements. Preceding Actions of a


DO UNTIL executes atleast once. If DO UNTIL returns rows
preceding actions will be executed.

SQL: This Action is used to write update, insert and delete sqls.

Peoplecode: This Action is used to write people code.

Log Message: This Action is used to write data in to log file. We


need to mention MsgSet and MsgNbr to write message from
message catalog.

Call Section: This Action is used to call another Section within the
program or we can call Section from other program.

L ESSON 4: C ONSTRUCTING AE P ROGRAMS .


Application Engine program includes a logically ordered set of Sections, Steps
and Actions. MAIN Section is the starting point of the program. Section should
contain atleast one Step and Action.
To create a new Application Engine program, select NEW from FILE menu of
Application Designer and select App Engine Program.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

You can see two different views in the Application Engine Program. Definition
view and Program Flow view.
Definition view to create definitions within a defined hierarchical structure, in
which nodes represent the definitions. A node is the visual representation of a
section, step, or action that you can select, collapse, modify, and so on.

The sections that appear in Definition view do not necessarily appear in


the order that they execute. To see the actual order in which the sections
execute, switch to Program Flow view.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 5: W ORKING WITH STATE RECORD .


State Record is used to pass values between Section, Steps and Actions.
State record name must be suffix with _AET. Process_Instance should be
one and only key field. It can be SQL Table or Derived Work Record. We
can have up to 200 State Records associated with a particular AE
program, in that only one can be default state record.

Application Engine program automatically updates State record with


Process_Instance value while starting. %SELECT is used to insert values
in State record and %BIND is used to pull value from State record.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 6: TRACING AND DEBUGGING .


TRACING :
This lesson we can see how to enable tracing for AE program and locate
a trace file: We can set People Tools trace, People Code trace, SQL trace
and Timing trace for Application Engine program.
At the top of each trace file, we can see People Tools version, database
name and database platform type.
The first section of the trace file is the SQL section. It records the
performance of each SQL in the program. Peoplecode is the second
section of the trace file and records the performance associated with all
the PeopleCode actions in AE program.
Below is the list of parameters used to trace Application Engine program.

0 Disable

1 Step trace

2 SQL trace

4 Temp table trace

128 Timing trace

256 People Code trace

1024 Statement timing trace

2048 Database optimizer trace

4096 Explain plan table of the current database

8192 Integration Broker trace

16384 SQL timing trace

By default, Application Engine traces are turned OFF. To see a trace


combination of traces, set trace options before you run a program. We
can set trace via
Command Line: To enable tracing from the command line, specify
TRACE option within the command line with PSAE.exe parameter.
Ex:

psae.exe TRACE 2

Server Configuration Files: You can also enable traces in the


configuration files for both the application server and the PeopleSoft
Process Scheduler server.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

For programs invoked by PeopleCode and run on the application server,


set the TraceAE parameter in the Trace section of the Application Server
configuration file (PSAPPSRV.CFG). You can use PSADMIN to set this
parameter.
In the PeopleSoft Process Scheduler configuration file, set the TraceAE
parameter in the Trace section to indicate a level of tracing. You can use
PSADMIN to set this parameter.
This option is available on Microsoft Windows NT and UNIX, and it
applies only to Application Engine programs invoked in batch mode.
Configuration Manager: For processes running on a Microsoft Windows
workstation, you can set trace options using PeopleSoft Configuration
Manager. This procedure is valid only if you are running Application
Engine programs on a Microsoft Windows workstation in a development
environment.
Image: Application Engine Trace check boxes
This example illustrates the check boxes on the Application Engine Trace
check boxes.

To set Application Engine traces:

Start Configuration Manager, and select the Trace tab.


Select the appropriate trace options.
You can select any combination of options.
Click either the Apply or OK button to set trace options.

DEBUGGING :
To run a program in debug mode, Set the debug option.
You can set the debug option in the following locations:
Start PeopleSoft Configuration Manager and select the Process
Scheduler tab.
In the Application Engine group, enable debug by selecting the Debug
check box. This method applies to all methods of invocation.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

If you used the command line option to invoke your Application Engine
program, then you can include the DEBUG Y parameter in the command
line you submit to PSAE.EXE.
If the Debug check box is already selected in PeopleSoft Configuration
Manager, then you do not need to include the DEBUG parameter in your
command line.
If you have PeopleCode in your Application Engine program, enable the
PeopleCode debugger.
When you launch your program and the PeopleCode action runs, enter
the PeopleCode debugger.
Run the Application Engine program to debug.
At the Application Engine Debugger prompt, enter a command to enable
a debugging option.
Each command is represented by a single letter, such as X,L, orM. Enter
the letter that corresponds to the option you want to engage. To see a list
of the available debugging options, enter? at the prompt.
To enable the PeopleCode debugger for Application Engine:
Sign on to PeopleTools using the same user ID that you will use to invoke
the Application Engine program.
Open Application Designer.
Select Debug, PeopleCode Debugger Mode.
Your Application Engine program can be open on the desktop, but you do
not need to open the Application Engine program or the PeopleCode
action that you want to debug.
Select Debug, Break at Start.
This command will cause the Application Engine program to break before
executing any PeopleCode programs within it.

L ESSON 7: T HE A CTIONS IN AE P ROGRAM .


You can include 8 types of ACTIONS within a STEP, and you can add
multiple ACTIONS to a STEP. The actions you define for a STEP depend
on the results that your program requires at each stage of execution.
The only mutually exclusive actions within a single step are Call Section
and SQL Statement; you cannot add a Call Section action to a step that
already contains a SQL Statement action, and vice versa.
At runtime, the system evaluates actions by type and runs them within a
strict hierarchy. For example, if both a Do When and PeopleCode action
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

exist within a given step, then Application Engine always executes the Do
When action first.

Do When:
This action is similar to IF statement. A Do When statement runs before
any other actions in a step. If the Do When statement returns any rows,
the next action is executed. If the Do When conditions are not met, the
remaining actions within that step are not executed. Your program runs a
Do When action only once when the owning step executes.
The only property that you can specify for a Do When action is the ReUse
Statement property, which applies to all SQL-based actions.
Do While:
The Do While action is a Select statement that, if present, runs before
subsequent actions of the step. If the Do While statement does not return
any rows of data, the action terminates. The Do While statement is
identical to the COBOL While statement. Subsequent actions within the
step are executed in a loop as long as at least one row is returned by the
Select statement for the Do While action. If the Do While statement does
not return any rows, the step is complete.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

The only property that you can specify for a Do While action is the ReUse
Statement property, which applies to all SQL-based actions.
Do Until:
A Do Until action is a Select statement that runs after each action when a
step completes. If the Select statement returns any rows of data, the step
terminates. When using a Do Until action, note that:
You use a Do Until action if you want the processing actions to execute at
least once and to execute repeatedly until a certain condition is true, such
as a Select statement returns some rows.
You can use a Do Until action to stop a Do Select action prematurely.
For example, if a Select statement for a Do Until action does not return
any rows, then the actions in the step are repeated (except if a Do When
action appears in the step). Normally, a Do Select action continues until
no rows are returned. If any rows of data are returned, the Do Select
action stops and the step is not repeated.
The only property that you can specify for a Do Until action is the ReUse
Statement property, which applies to all SQL-based actions.
Do Select:
The Do Select action is a Select statement that executes subsequent
actions once for every row of data that the Do Select statement returns.
For instance, a Do Select statement can run a SQL statement for each
row returned from the Select statement. The subsequent actions within
the step are executed in a loop based on the results of the Select
statement. The type of the Do Select determines the specific looping
rules.
Like the other Do actions, you can specify the ReUse Statement property
for the Do Select action; this property applies to all SQL-based actions.
In addition to the ReUse Statement property, you must also specify this
Do Select property: Do Select Type.
SQL:
This action is used to write SQLs in the Application Engine program, we
can write Insert, Update and Delete SQLs.
People Code:
We can write Peoplecode with in Application Engine using this
PeopleCode action. We can specify only one property On Return with
peoplecode action.
Call Section:
Use the Call Section action to call another section defined in an
Application Engine program. You can call a local section defined within

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

your current program, and you can make external calls to a section
defined in another Application Engine program.
The external section you intend to call must have its access property set
to Public. If the access property of a section is set to Private, that section
can be called only from within the same program. By default, the access
property of a section is Private. If you attempt to make a call to a section
that does not allow external calls, you receive an error message at
runtime.
We can also call the section dynamically at runtime, we need to specify
program name and section name as per requirement.
Message Log:
Use this action to write a message to the message log. We need to
provide Message Set Number and Message Number in order to write
message.

L ESSON 8: I NSERTING AND U PDATING DATA INTO


TABLES USING AE.
The main objective of Application Engine program is background SQL
processing. We can do mass insert, update and delete with the
Application Engine. We can directly write insert, update and delete sqls in
SQL action of Application Engine. By buffering rows to be inserted, some
databases can get a considerable performance boost. Application Engine
offers this nonstandard SQL enhancement for the following databases:
Oracle, Microsoft SQLServer, and DB2. This feature is named Bulk Insert.
For those database platforms that do not support the Bulk Insert feature,
this flag is ignored.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 9: P EOPLE C ODE TECHNIQUES FOR AE


P ROGRAM .
Inserting PeopleCode into Application Engine programs enables you to reuse common
function libraries and improve performance. In many cases, a small PeopleCode
program used instead of Application Engine PeopleCode is an excellent way to build
dynamic SQL, perform simple If/Else edits, set defaults, and perform other tasks that do
not require a trip to the database.
When to use PeopleCode:
Application Engine is not intended to run programs that include only PeopleCode
actions. The primary purpose of Application Engine is to run SQL against your data.
Use PeopleCode primarily for setting If, Then, Else logic constructs, performing data
preparation tasks, and building dynamic portions of SQL statements; rely on SQL to
complete the bulk of actual program processing. Also use PeopleCode to reuse
previously developed online logic. PeopleCode is the tool to use to take advantage of
new technologies such as component interfaces and application classes.
Most programs must verify that a certain condition is true before they run a particular
section. For example, if the hourly wage is less than or equal to X, do Step A; if not, fetch
the next row. In certain instances, you must modify variables that exist in a state record.
PeopleCode enables you to set state record variables dynamically.
When writing or referencing PeopleCode in a PeopleCode action, you must consider the
environment in which the Application Engine program runs. Environment indicates the
differences between online and batch modes. Application Engine programs usually run
in batch mode; consequently, your PeopleCode cannot access pages or controls as it
can while running in online mode. Any PeopleCode operations that manipulate pages
will not run successfully. Even if you invoke your Application Engine program online from
a record or a page using the CallAppEnginePeopleCode function, the Application Engine
PeopleCode still does not have direct access to component buffers.
Any record field references that appear in a PeopleCode action can refer only to fields
that exist on an Application Engine state record. Component buffers, controls, and so on
are still inaccessible even if you define the page records as state records in the Program
Properties dialog box. An Application Engine program can access only state records or
other objects you create in PeopleCode.

L ESSON 10: D YNAMIC CALLS TO PROGRAM


S ECTIONS .
As you know we can call the Sections using Call Section Action, we can call a local
section defined within our current program, and we can make external calls to a sections
defined in another Application Engine programs.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

We have dynamic calling functionality within Call Section action; we need to specify
Application Engine Program name and Section name before calling a section
dynamically.
Use AE_APPLID and AE_SECTION fields in the default state record to call different
sections as per requirement at runtime. We need to specify Application Engine name
and Section name in PeopleCode Action before Call Section Action and we must check
Dynamic check box in the Call Section properties. If AE_APPLID (Program name) is
blank, then process will consider current program name as AE_APPLID, if AE_SECTION
(Section name) is blank then an error occurs.

L ESSON 11: W RITING EFFICIENT SQL IN


A PPLICATION E NGINE P ROGRAM .
Do Actions and SQL Action is used to write SQLs in Application Engine Program.
Application Designer invokes a SQL editor to write SQLs. We can do row by row
processing and set processing using sqls as per requirement. We must use Do Action
for row by row processing and single SQL action is enough for set processing.

L ESSON 12: M ETA SQL.


You can write SQL within Application Engine, or you can copy SQL statements into
Application Engine from any SQL utility with few, if any, changes. This capability enables
you to write and fine tune SQL statements before you try to incorporate them into an
Application Engine program.
Database platforms can have different syntax rules, especially in regard to date, time,
and other numeric calculations. Generally, you can work around syntax differences using
PeopleSoft meta-SQL, which Application Engine supports. Meta-SQL is a set of
predefined terms (meta-strings) designed to replace relational database management
system (RDBMS)-specific SQL syntax with a common syntax.
In addition, PeopleSoft meta-SQL enables you to dynamically generate portions of SQL
code. For example, to join two tables based on their common keys, use the following
meta-string:
%Join (COMMON_KEYS, PSAESECTDEFN ABC, PSAESTEPDEFN XYZ )
At runtime, the function would be expanded into the following:
ABC.AE_APPLID = XYZ.AE_APPLID
AND ABC.AE_SECTION = XYZ.AE_SECTION
AND ABC.DBTYPE = XYZ.DBTYPE
AND ABC.EFFDT = XYZ.EFFDT

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 5: P EOPLESOFT

QUERY

The purpose of this class is to provide you with the skills you need to effectively
use the PS Query.
In this chapter we will cover the following topics:

Lesson 1: Introduction to Query Manager.


Lesson 2: Create Private Queries and Share Public
Queries.
Lesson 3: Output Queries to HTML and Excel.
Lesson 4: Filtering Output Data by Adding Criteria to
Queries.
Lesson 5: Creating and Using Runtime Prompts.
Lesson 6: Working with Multiple Tables.
Lesson 7: Query Viewer and Query Scheduler.
Lesson 8: Writing Expressions for Use as Fields and in
Criteria
Lesson 9: Creating Subqueries
Lesson 10: Outer Joins When and How to Create Them
Lesson 11: How and When to Use Unions

L ESSON 1: I NTRODUCTION TO PS QUERY


C HAPTER S TRUCTURE
Most chapters are structured the same way and generally consist of
the following:

Objectives. The objectives are found at the beginning of the


chapter and define what you will learn in the chapter.

Lessons. Each chapter has several lessons that explain the


various concepts. Some lessons contain practices and
exercises.

Practices are step-by-step instructions for completing a


procedure that the instructor and class participants walkthrough together.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Review Questions. You will find review questions at the end


of the document that recap material covered in the chapter.
The answers to the questions will be discussed among class
participants and the instructor.

I NTRODUCTION
All business data is stored in a database in order to be used to manipulate that
data, answer questions, perform analysis and solve business problems.
However, retrieving particular information from the database can be difficult and
time-consuming.
With PeopleSoft Query, you can easily create queries to access data in the
PeopleSoft database. The queries can be simple or complex based on your
requirement. In addition, they can be one-time or can be used repeatedly.

L ESSON 2:C REATE P RIVATE Q UERIES AND S HARE


P UBLIC Q UERIES
C REATING B ASIC Q UERY P ROCESS
The following steps are the basics for creating a simple query.
Select records.
Add fields to query content.
View fields selected for output.
Change the column order for multiple fields.
Change the sort order for multiple fields.
Edit field properties.
View and edit query properties.
View underlying SQL code.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

N AVIGATION TO Q UERY MANAGER :

R ECORDS T AB :

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

It will help to search the record names that you will use in the querry.

Recname This is the database record name the Record description


Add Record Click this hyperlink to select the record for this query
Show Fields Click on the icon to display all fields associated with the
record. This is to determine if the record is the correct one required for the
query.

Q UERY T AB

Once a record has been selected, the Query tab will be the active page listing the fields
associated with the selected record. For each Chosen Record you will see:
Folder Icon: Hide or Unhide the list of fields associated with the selected record. This is
useful when you are using more than one record for the query and only need to view the
fields associated to one record at a time
Alias: The database record name the record description. For example, Department is
the Alias for DeptID
Record: The record name in the database and the description of the record
Hierarchy Join: This hyperlink allows you to join a child record to its parent
Minus Button: Used to delete a hierarchy join
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Once you unhide the list of fields for each record, you will find the following information:

F IELDS T AB

The tab shows all output fields that have been selected from the Query tab as well as
from the expression tab. It allows users to delete an output field, change field heading,
apply an aggregate, or change the translate value.

V IEW SQL

All design efforts are written and stored in a SQL language format and can be viewed by
clicking on the View SQL tab. If you are familiar with the SQL programming language
you can confirm you work by going to this tab.

S AVE
Once you creation process is completed save the Query.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Complete the following to save the Query:


Query Enter a name for the query. Note: The query name may
only contain letters, numbers or underscores (NO SPACES),
follow naming convention

Description Enter a brief description (optional). Entering a


description
here allows you to search by keywords when trying to find a query.

Folder Enter a folder name (you create it by entering it here),


if you wish
to store this query in a folder.

Query Type Select User, Archive, Process, or Role. Standard


queries are
defined as User, and queries that use workflow are defined as Process
or Role. Archive is used to identify queries that may be stored for now and used
later.

Owner Select Private or Public. A Private query can be


accessed and
modified by only the user who created the query. However, any user who has
access to the query records can run, modify, or delete a Public query.

Query Definition Enter a more complete description of what


the query
Click the OK button.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 3:O UTPUT Q UERIES TO HTML AND E XCEL


Q UERY V IEWER

Query Viewer allows users to view existing queries, even if they do not have access to
create their own. Query results can be run to HTML, which displays them in the web
browser, or they can be exported to Microsoft Excel.

When you open Query Viewer all available queries are displayed. The following
information is displayed for each query:
Query Name The database name of the query
Query Description The description of the query entered upon creation
Query Owner:
Private Only the logged on User ID can modify or delete this query
Public Any user can modify this query
Run to HTML The query will be executed and the results will display in a
new browser window
Run to Excel The query will be executed and the results will display in a
new Excel Spreadsheet

Schedule Schedule the query to run at a later time


Favorites Allows you to save a query to the Favorites menu.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 4: F ILTERING O UTPUT D ATA BY ADDING


C RITERIA TO Q UERIES .
C RITERIA
Criteria is used to define our query to retrieve specific records instead of all records in a
table or tables. Criteria design is critical to ensure query efficiency and effectiveness.The
criteria screen is divided into three main parts. These parts are Expression 1, Condition
Type, and Expression 2. This screen simply allows us to write the following statement as
one complete criterion:

(Expression 1)(Condition Type)(Expression 2)

E XPRESSION 1 I TEMS :
Field any table field can be selected from the selected tables within a query
Expression functions that can be written in the expression screen to formulate values
based on calculations or data manipulations.

T HE C ONDITION T YPE :
Defines the relationship between Expression 1 and Expression 2. The default Condition
Type in this example is equal to. Other Conditions can be selected from the drop down
list.

E XPRESSION 2 I TEMS :
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Field any table field can be selected from the selected tables within a query
Expression functions that can be written in the expression screen to
formulate values based on calculations or data manipulations.
Constant a value that is entered directly in space provided
Prompt allows an interactive query where end users can enter values
based on their needs
Subquery allows the filtering of a queried records from a nested statement.

L ESSON 5: C REATING AND U SING R UNTIME


P ROMPTS

Steps Used to Create a Runtime Prompt

Click the Add Criteria button on the Criteria page.

The Edit Criteria Properties page appears.

Select the record.field in Expression 1 you wish to use.

In the Choose Expression 2 Type select the radio button for


Prompt.
In the Expression 2 group box select the New Prompt link.

The Edit Prompt Properties for the record.field you selected


appears and all properties are filled in for you.
Click the OK button.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Click the OK button again to bring you back to the Criteria tab.

Click the Run tab to see the prompt and test.

Save if you like the results if not you may go back and adjust
your prompt or criteria.

L ESSON 6: W ORKING WITH M ULTIPLE T ABLES


J OINS
PeopleSoft query design environment allows adding multiple tables to be joined up to a
maximum of six tables in one level. Joining additional tables allows the inclusion for
significant data or the exclusion of certain records. However, query designer must take
caution when joining tables. It is best to plan table join order, because Left Outer Join is
only possible to the last table. If a required table join has to be Left Outer Join type, it
must be joined to the last table in the query. Therefore careful planning is advised.
Joining tables can be very tricky, as it may exclude many records or add many more that
are not relevant or duplicates.
In PeopleSoft Query, a predefined join is one of the following:

Record-hierarchy join

Related-record join

Record-Hierarchy Joins
Record-hierarchy joins use records that are related through a parent-child relationship.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Steps:

Select the Query page, and then click the Hierarchy join link.

Select the record to join from the list of parent-child records.


This record appears on the Query page and is assigned an alias
letter in the order that you added the records.
Select the necessary fields from the joined record.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Adding a Related-Record Join


Access the Query page and locate the A.ACAD_ORG_TBL
record click the plus sign on the yellow file folder to expand the
B record.
Click the Join hyperlink that is next to the INSTITUTION field .

Click the OK button to accept the default standard join, and


select the DESCR field.
Save the query, and view the query results.

L ESSON 7: Q UERY V IEWER AND Q UERY


S CHEDULER
Q UERY V IEWER
Query Viewer is the primary place to run and view queries. Upon searching for a
query, you can choose to run the query immediately and view the results in a new
browser window or to schedule it to be run at a later time (or predefined schedule).
Queries Viewer enables you to:

Search for a query

Preview a query in the active browser window

Run a query and display results in a new browser window

Print a query

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Schedule a query

When you open Query Viewer all available queries are displayed. The following
information is displayed for each query:
Query Name The database name of the query

Query Description The description of the query entered upon


creation
Query Owner:
Private Only the logged on User ID can modify or delete this
query
Public Any user can modify this query

Run to HTML The query will be executed and the results will
display in a new browser window
Run to Excel The query will be executed and the results will
display in a new Excel Spreadsheet
Schedule Schedule the query to run at a later time

Favorites Allows you to save a query to the Favorites menu

Q UERY S CHEDULER
When a query is scheduled, this allows it to be run without user intervention. The user
can work in other pages in PeopleSoft then pick up the results when the query has
finished running. If the query is scheduled to run under a recurrence, the query will be
run at the days and times defined for that recurrence, automatically being rescheduled to
run again at the appropriate time.
To schedule a query, search for it in the Query Manager search page, then click the
Schedule link.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

You will then be asked to select or create a run control to identify the process submitted
to the PeopleSoft Process Monitor for running your query on a schedule. If you have no
run controls that run the selected query you will automatically be put on the Add a New
Value tab for creating a new run control; otherwise you will be taken to the Find an
Existing Value tab from which you can select a run control you have already made for
scheduling the query.
This example will involve creating a new run control by clicking the Add a New Value tab.
The Private Query and Query Name fields are filled in automatically. Enter a Run Control
ID to assign to this run control then click the Add button. If the query has any prompts
you will be asked to enter values for each prompt.

You will then be asked to enter a description for this scheduled run. Enter this then click
the OK button.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

The Process Scheduler Request page appears. To pick a specific date and time at which
the query should be run, enter the date and time into the Run Date and Run Time fields.
To instead have the query run repeatedly at the same time every day or every week,
select a predefined recurrence from the Recurrence dropdown.

In the Process List section you will see one process named PSQUERY; this is the
internal process that will run the query. In the Format dropdown there are several
different formats for the output of the query, including:

HTM: web page, similar to the output of a query when run from
Query Manager
PDF: a document in the Adobe PDF format

TXT: a comma-separated variable (CSV) text file

XLS: an Excel workbook

Select the format that you want for the output. When you are ready to submit, click the
OK button. You will be returned to the Query Manager search page.
To see the results of the query navigate to Reporting Tools > Report Manager. The List
tab is selected and recently generated reports are displayed.

Click the link in the Report column corresponding to the scheduled query for
which you want to view results. The details of that report are displayed. In the

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

File List section, find the link with the name of the query (not the run control ID)
that you scheduled.

Click the file link to open the file directly or right-click it and choose Save Target As to
save it to your computer.

L ESSON 8: W RITING E XPRESSIONS FOR U SE AS


F IELDS AND IN C RITERIA
E XPRESSIONS
Expressions are ways to perform calculations and conversions and to edit or combine
text strings. They can be displayed as a column in the result set and can be used in
criteria. Expressions are comprised of fields, values, operators, and functions. Operators
generally perform a calculation on the fields and values preceding and following them.
To add or edit expressions for queries:
Select Reporting Tools, Query, Query Manager, then click the
Create New Query link, and then select the
Expressions tab to open the Expressions page.

The query name appears in the Query Name field.

The default for this field is New Unsaved Query until you change
it on the Properties page.
Click the Add Expression button to open the Edit Expression
Properties page, where you can select expression types.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Select an option from the Expression Type drop-down list box.

If you select Character, enter the maximum length of the


expression result in the Length field.
If you select Number or Signed Number, enter the total number
of digits in the Length field and the
number of digits after the decimal point in the Decimal field.

Note. For Number and Signed Number, expression types, the


Length field defines the total length of the number (integer
portion + decimals portion). For example, if Length = 10 and
Decimals = 3, then this means that the integer portion = 7
(Length - Decimals = Integer). In the Expression Text field, enter
the expression (for example, A. Total * .1, where A represents
the first record.)
Query Manager inserts the expression into the SQL for you. You can include
Oracle hints in PeopleSoft Query expressions as long as you adhere to the
following rules:
Expressions containing a hint must begin with /*+ .

Expressions can contain only one hint. For example, only one
set of /*+ */ is allowed.Expressions must contain a complete hint.
For example, an expression can't have only /*+ or */ . Both must
be in the same expression.
Click the Add Prompt button to add prompt properties for this expression; click the
Add Field button to add another field to this expression, if needed.

Expressions in Criteria

Criteria Icon
and
add
criteria to the
field(Expression). Click on OK.
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 8: C REATING S UBQUERIES


A subquery, sometimes called a sub-SELECT,is a query whose results are used by
another query. The main query uses the subquery's result set as a comparison
value for a selection criterion.You create a subquery when you need to compare a
field value to the results of a second query.
Select Reporting Tools, Query, Query Manager.

Click the Use As Criteria link on the Query page, or click the Add
Criteria button on the Criteria page.On the Edit Criteria
Properties page, select Subquery as the comparison
value.PeopleSoft Query displays a special Query

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

5. Click the Subquery/Union Navigation link to display a


hierarchical view of the main query and all subqueries and
unions.Use the hierarchy to navigate between the main query,
subqueries

L ESSON 9: O UTER J OINS W HEN AND H OW TO


C REATE T HEM
A LEFT OUTER JOIN first is thinking about the two tables laid out from left to right
in the order that they are added to the query. A LEFT OUTER JOIN will return ALL
the rows from the first table and any matching rows from the second table. If there
isnt a match in the second table, a blank or NULL is returned for fields that are
pulled from that table.

Create a new query

Navigation: Reporting Tools Query Manager Create New Query

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Select first table (left) in Records tab The first table will be the
Left Table of the query. This is the table that will show all results
ased on the criteria.

Select field(s) for query

Select second table in Records tab and join

The second table will be the table used to compare values to the
first table. Any matching rows will be in the result set. If there
isnt a match in the second table a blank or NULL is returned.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Select Left outer join

Confirm or deselect criteria join conditions

Select field(s) on second table

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Once you have joined the two records, you can use expressions
(discussed later in this guide), prompts, field options, criteria,
and HAVING (discussed later in this guide) to fine tune query to
desired result set. Use the Distinct check box under the
Properties link to exclude duplicates from the result set.
Run query.

L ESSON 10: H OW AND W HEN TO U SE U NIONS


A UNION selects all rows from two tables for the result set , but has some
restrictions.

Same number of output columns must be specified from each


table.
Each corresponding column must have the same data type (ex.
character to character, or numeric to numeric, or date/time to
date/time).
Columns must be in the same display order.
Create a new query

Select first table in Records tab

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Select field(s) for query

Create UNION join

To create a union, click New Union at the bottom of any tab


except the Run tab. The second
table will be designated as Union 1.

Select second table

In Records tab, search and select table to be joined by UNION

Select field(s) for query

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Additional components of query page:


Working on selection displaying which record/table you are
working with
Subquery/Union Navigation link used for toggling between Top
Level of Query and
Union1 records

Delete Union link used to delete union

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 6: SQR
In this chapter we will cover the following topics:

Lesson 1: SQR Overview


Lesson 2: SQR Sections and Paragraph.
Lesson 3: Program Flow in SQR.
Lesson 4:SQR Data Elements
Lesson 5: Functions
Lesson 6:Important Commands

Lesson 7:SQC
Lesson 8: Local and global procedures
Lesson 9: Running an SQR program
Lesson 10:Debugging strategies for SQR
Lesson 11: LOAD LOOK UP & Array
Lesson 12: Error handling
Lesson 13: Multiple reports

L ESSON 1: SQR O VERVIEW


Structured Query Report Writer is a programming language that combines the
power of SQL queries, the sophistication of procedural logic, and the freedom of
the multiple-platform development. It works equally well on client and server,
crosses almost seamlessly between different platforms, and covers nearly allrelational databases.
With SQR we can do the following:

Reports
Background SQL process
Interfaces (file handling)

Note: SQR will be stored on File Server not on the DB

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 2: SQR S ECTIONS & P ARAGRAPH


In SQR there 5 Sections available:

Setup Section Begin-Setup/End-Setup


Heading Section - Begin-Heading /End-Heading
Footing Section - Begin-Footing/End-Footing
Program Section - Begin-Program/End-Program
Procedure Section - Begin-Procedure/End-Procedure
In SQR there are 3 Paragraphs available:

Select Paragraph - Begin-Select/End-Select


SQL Paragraph - Begin-SQL/End-SQL
Document Paragraph - Begin-Document/End-Document

L ESSON 3: SQR P ROGRAM F LOW


Following is the basic program flow of an SQR:
SETUP section
BEGIN-SETUP
{setup commands}
END-SETUP

Then HEADING and FOOTING


BEGIN-HEADING
{heading commands}
END-HEADING

BEGIN-FOOTING
{footing commands}
END-FOOTING

Then PROGRAM section


BEGIN-PROGRAM
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

{commands}
END-PROGRAM

Then PROCEDURE section


BEGIN-PROCEDURE
{procedure commands}
END-PROCEDURE

We can write PROCEDUREs and can call in PROGRAM.

L ESSON 4: SQR D ATA E LEMENTS


Each SQR data element begins with a special character that denotes the type of
data element. They are of following types:
Columns
Variables
Literals

Columns
Columns are fields that are defined in the database. They always begin with $
and can be any type of column such as character, number, or date.

Variables
Variables are storage places for text or numbers that you define and manipulate.
Variables begin with special characters:
$ begins a text or date variable.
# begins a numeric variable.
% begins a list variable.
@ begins a variable name for a marker location.
Marker locations identify positions to begin printing in a BEGIN-DOCUMENT
paragraph.
There are lots of SQR reserved variables which cant be used as an ordinary
variable. Examples are #current-column, $current-date, $sql-error, #end-file etc.

List Variables
List variables contain an ordered collection of SQR variables and are
nonrecursivethat is, you cannot nest lists inside lists.
List variables starts with the percent symbol (%). Create list variables with the
LET command and a list ofvariables. For example:
LET %list1 = list (num_var1|str_var1, num_var2|str_var2,...)
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 5: F UNCTIONS
SQR version 6 offers more than 50 different built-in functions. In addition, we can
write our own functions in C using the supplied source file ufunc.c
The following are the different types functions available in SQR:

Numeric Functions Example Abs()


File-related Functions Example Delete(),Exists(),Rename()
Date Functions Example StrToDate(),DateAdd(),DateDiff()
String Functions Example IsBlank(),IsNull(),Length()
Miscellaneous Functions Example Array(),Ascii(),Chr()

L ESSON 6: IMPORTANTC OMMANDS


L ET
Syntax :Letdst_var= expression

Assigns the value of an expression to a string, numeric, or date variable.


A single Let command may be capable of replacing a number of
datamanipulation and logic commands.
Expressions in the Let command can be combinations of operands,
operators,and functions.

Example
let #answer = #float_ no* #decimal_ no/ #integer_ no

M OVE
Syntax :Movesource_fldtodest_fld [ edit _ mask]

The Move command is more versatile than the let commands.


In addition to moving data from one field to another, it can also perform
dataconversions and data editing using special edit masks.

Example
move 1234567.89 to #value
move #value to $value 999,999,999.99
Here it is converting a number to string using an edit mask .
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

D ISPLAY

AND

S HOW

There is no fancy step-through debuggers to de-bug an sqrprogram .Our


main weapons are the two SQR commands: Show and Display.
We can use these commands anywhere in your program except the
Setupsection.
Both the Show and Display commands display the specified texts and
variables on the screen and also write the same information into the
program log file.
!Using the Show command to display selected columns
Show 'Select Started'
Begin-Select
A .Emplid
A .Name
Show 'Selected Emplid= ' &A .Emplid ' Name= ' &A .Name
From PS _ PERSONAL_ DATA Where Name Like 'Abr%'
End-Select

The Display command is somewhat similar to the Show command, but it


has less power: you cannot display multiple fields in one Display
command.
For the same above example, if we use Display we need to use four
display commands.

P RINT
The Print command places data on the page, we must specify the position and
length of each output field with the help of 3 parameters (x,y,z)
X - specifies the line position of the page
Y - the column number
Z - the number of positions allocated for the field (length)
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Print $Name (+1, 1, 20) ! prints $Name on the next line, position 1, width=20
Print $Name (+2, +3) ! prints $Name 2 lines below the current line starting from
current column +3 and usewidth = actual length of $Name
Print $Name () ! Print in the current line, current column,
Print $Name(0, 0, 0) ! Print in the current line, current column.
We can also use substitution variables defined in the beginning of program to
code all printing parameters.
Formatting output

Print $Name (+1, 1) Bold - Prints the output in Bold


Print $Header (2, 5) Underline - Prints the output in Underlined
Print Test Report () Center - Prints the text in Center of the page
Print * (1, 1, 25) Fill - Fills line with 25 Asterisks
Print $Comments (1, 1) wrap 15, 3 - This command prints the value of
string variable Comments in 15 Characters per line for a maximum of 3
lines.
Print $Empl_Status (0, 16) Match
A 0 25 Active
T 0 25 Terminated
L 0 25 On Leave - If match is found in EMPL_STATUS field then the
corresponding substituted value (Active, Terminated, On Leave) will be
printed in position 25 of the current line. In no match is found, an original
employee status code will printer in position 16 of the current line.

Explicit printing
If we print data using print command then it is called explicit printing:
Begin-select
Count(*) &EE_COUNT
Print Employee Count = (1,1)
Print &EE_COUNT (,+1)
From Employee_Data
Where Hire_Dt<Sysdate
End-Select
Implicit printing
If we print data without using print command then it is called implicit printing:
Begin-Program
Do Get_ Employees
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

End-Program
!*****************************
Begin-Procedure Get_Employees
Begin-Select
Emplid(+1,1) !Implicit Printing
Move &Emplidto $Emplid
Name ( ,+2)
City ( ,+2)
State ( ,+2)
From Personal_ Data
Where State = 'NY'
End-Select
End-Procedure

L ESSON 7: SQC
PeopleSoft delivers many SQC files with their software. These are commonly
used procedures and statements that can be used in any SQR program. SQC
files are added to your program using the #include operator.
Difference between SQRs and SQCs:
SQR

SQC

This is nothing but the Actual Source


program

This is a function that is used in SQR

This consists of Program Section

This does not consist of program


Section.

This can be Compiled & Executed.

.This cannot be Compiled and


Executed.

We cannot call one SQR from or SQC.


SQR program

We can call one SQC from another


SQC or another SQR

Important SQCs
#include 'setenv.sqc'
#include 'stdapi.sqc'
#include 'prcsdefn.sqc'
#include 'prcsapi.sqc'

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 8: LOCAL

AND

G LOBAL

PROCEDURES

All procedures in SQR are considered global by default. In order to make a procedure
local, it must have parameters or must be explicitly declared local.
Example:

begin-procedure Other-Procedure local


begin-procedure Other-Procedure(#number)

Variables that appear in local procedures are not available outside of their respective
procedures. This way, the same variable name can be used in different local procedures
without creating an error situation.
Local procedures can communicate with other local and global procedures via
parameters. Since global variables defined outside of a local procedure can be accessed
only by using initial underscore. Example #amount is an global variable and can be used
in local variable by using #_amount.
Examples:
begin-procedure Main
let #n = 1
do Other-Procedure
show #n
end-procedure
begin-procedure Other-Procedure local
let #n = 2
end-procedure
What is the value of #n at the SHOW statement? It is 1. The assignment within OtherProcedure (a local procedure) creates another variable called #n. There is no connection
between this local #n and the global #n.
If, however, Other-Procedure contained this line:
let #_n = 2
then the value of the global variable #n would be changed to 2, and the SHOW would
display 2.
Now consider this:
begin-procedure Main
let #n = 1
do Other-Procedure(#n)

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

show #n
end-procedure
begin-procedure Other-Procedure(:#number)
let #number = 2
end-procedure
This time, the value of #n at the SHOW statement is 2. #n was passed as a parameter to
Other-Procedure, which knows it as #number. In addition, Other-Procedure's parameter
list includes the leading colon (:#number), indicating that it will pass a value back to the
caller. Since the caller provides the variable (#n), it will receive the modified value of this
variable, which is 2.
Be careful to code the leading colon if you need it. Suppose the BEGIN-PROCEDURE
was coded like this:
begin-procedure Other-Procedure(#number)
In this case, #number would contain the value of #n passed by the caller (1) but it
would not be passed back to the caller. Even though Other-Procedure changes the value
of #number, this will not affect the value of #n, since the leading colon is not coded.
Here's a trick question. What's the value of #n at the SHOW statement in the example
below?
begin-procedure Main
let #n = 1
do Other-Procedure(#n)
show #n
end-procedure
begin-procedure Other-Procedure(#n)
let #n = 2
end-procedure
It's 1. The leading colon was not coded, so the #n in the local procedure is not passed
back to the caller.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 9: R UNNING

AN

SQR P ROGRAM

SQR Program can be run by the following way:

SQR Window
Process Scheduler
Command prompt

SQR W INDOW :
Sample Program
Begin-Program
do main
end-program
begin-heading 1
print 'First Name' (1,1)
print 'Last name' (1,15)
end-heading
begin-procedure main
print 'Alice' (1,1)
print 'Bob' (1,15)
end-procedure

To run the Program:


Open SQRW Window
Browse Report name, fill the details of Data Source, Username and Password
Fill up the Report arguments

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Click Ok ,To get SPF format

P ROCESS S CHEDULER :

Select Run Control Record - Run Control Records are used to save the input
parameters for processes. Lets use predefined record PRCSRUNCNTL with
some of the Required Fields (OPRID,RUN_CNTL_ID ..), Here there are no I/P
Parameters are there

Select Run Control Page - Lets use the predefined page PRCSRUNCNTL
(Standard Page). Note that Run Control page is linked to the PRCSRUNCNTL
Run Control record. Here PRCSRUNCNTL uses fields exactly from
PRCSRUNCNTL Record.

Create a new custom component for report

Here OPRID & RUN_CNTL_ID are key fields

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Add Search record

Add Component to Menu & Register.


Create Process Definition
Navigation : PeopleTools - Process Scheduler - Processes -Add a New Value

a. Add a new process definition like below

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Here note that no extension is needed when entering the program name
b. Click Add

c. Process Definition Page Opens


d. Click on next tabProcess Definition Options & Give the details of our previously
created Component & Process Groups under Process Security

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

e. Finally Save the Process & place theprogram into right directory as shown below

Now Finally we need to make our program API Aware

!********************************
! P1
! Making Programme API Aware
!********************************
#include 'setenv.sqc'
!********************************
Begin-Program
!********************************
doStdapi-Init
do main
doStdapi-Init
end-program
!********************************
begin-heading 1
!********************************
print 'First Name' (1,1)
print 'Last name' (1,15)
end-heading
!********************************
begin-procedure main
!********************************
print 'Alice' (1,1)
print 'Bob' (1,15)
end-procedure
#include 'datetime.sqc'
#include 'stdapi.sqc'
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Process Monitor Page

Click on Details

Click View On Log/Trace

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Click On File List ,PDF File to O/P

R UNNING

IN

CMD

Use the following command to run in command line

L ESSON 10: D EBUGGING S TRATEGIES

FOR

SQR

Show and Display commands


When it comes to debugging an SQR program, there are no fancy step-through debuggers. The
main weapons are 2 SQR commands: Show and Display. We can use these commands
anywhere in our program except the Setup Section. Both the Show and Display commands
display the specified texts and variables on the screen and also write the same information into
the program log file.
If for example, we ran and completed a program successfully, but output is not what we expected,
then we need to find out whether our program had some logic flaws, or whether the unexpected
results have been caused by an incorrect selection in the programs query. The simplest way to
find this out is to add some Show or Display commands to the program.
Show Select started
Begin-Select
A.Emplid
A.Name
Show selected emplid= &a.emplid Name= &A.Name
FromPersonal_data
Where name like Abr%
End-Select

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

In the above example, each selected record is displayed on the screen and written to the program
log file.
The Display command is somewhat similar to the Show command, but it has less power; we
cannot display multiple fields in one Display command.
Display Selected Emplid = Noline
Display &A.Emplid
The #Debug Command
We can optionally use the #Debug conditional compiler directive by executing the Display, Show,
Print or other commands in our program during testing, and then deactivating them when the
program is released to production. This approach is called Debugging Encapsulation.
Any SQR command that immediately follows the #Debug statement will be compiled only when
the corresponding Debug flag is specified in the SQR command line. The #Debug command
may be appended with one or more letters or numbers: ex #Debugxy, to provide additional
flexibility in debugging. We may optionally specify up to 10 different suffix letters or numbers.
#Debug Show Start proce1
#Debugx Show Start proc2
#Debugy Display start proc3
#Debugz Display Start proc4
#Ifdef or #Ifndef / #End-If
#If / #Else / #End-If
Key Points
1. The Display and Show commands are the main instruments in debugging SQR programs.
2. The DEBUG SQR command line flag in combination with the #Debug, #Ifdef, and #Ifndef
statements, can help to encapsulate the debugging logic in your program.
3. The S, -T, -C and E SQR command line flags can provide additional help during the
debugging process.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 11: L OAD L OOK

UP AND

A RRAY

ARRAY:
An Array is a collection of similar groups of fields in the program memory, wherein its relative
position number in the array can refer to each group.
Important functions of array:

Create-Array (to create arrays)


Clear-Array (Initializing arrays)
Get (retrieve data from arrays)
Put (place data into arrays)
Array-Add
Array-Subtract
Array-Multiply
Array-Divide

Load Look up & Look up:


Load-Lookup and Lookup is very useful technique of retrieving information from multiple tables.
This method significantly improves the performance, but also simplifies table joins.
Load-Lookup: this command creates an internal memory array and populates this array with keys
and the corresponding column values from a specified table. This command can be used in either
the Setup section or any procedure, but it is important to remember that, if the Load-Lookup
command is used in the Setup section, it is processed only once, when used in a procedure, the
command is processed every time the procedure gets executed.
Load-Lookup retrieved 2 fields from the DB: 1. Key field 2. Return_value field. The key field may
be of the string or numeric format, and it must refer to a column with unique values in the table.
No NULL values are allowed in the field. The Return_value field may refer to just one table
column or a combination of several table columns. In case of a column combination, the columns
must be concatenated. We can have the Load-Lookup command populate its array with only
certain records based on some specified selection criteria.
Ex: Begin-Setup
Load-Lookup Name = Company_Name
Rows = 200
Table = Company_tbl
Key = company
Return_value = Descr
Where = country = USA
End-Setup
In this ex, the Load-Lookup command creates an array named Company_Name and populates
the array with the company names from the Descr column of the Company_tbl. When populating
array, Load-Lookup uses the SQL where clause to select only table rows with the Country column
value equal to USA. The Rows parameter specifies the initial size of Lookup array as 200 rows.
This parameter is optional and, if omitted, a default value of 100 will be used. When an array
becomes full, another optional parameter, Extent, will be used to increase this array size. If no
Extent is specified, 25% of the initial size will be used as a default value. Note that the only limit of
the size of a Lookup table is the amount of memory available in your computer.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
Lookup: this command is used to search through internal memory arrays created and populated
by the Load-Lookup command. It returns the Return_value field value for each specified key field
value. SQR uses the binary search algorithm to search through the array.
Begin-Select Distinct
Emplid (+1,1)
Company
Lookup Company_Name&Company $Comp_Name
!(the lookup command retrieves the $Comp_Name value based on the key stored in &Company)
From Job A
where A.effdt = (select max(effdt) from job
where emplid = A.emplid
and empl_rcd = A.empl_rcd)
and A.effseq = (select max(effseq) from job
where emplid = A.emplid
and empl_rcd = A.empl_rcd
and effdt = A.Effdt)
End-Select

L ESSON 12: ERROR H ANDLING


On-Error clause can be used in SQl paragraph. This clause specifies the name of the procedure
to be executed if an error occurs during the Sqlexection.
Begin-Sql On-Error=Db_Error
Update Personal_data
Set Postal = $Old_zip
Where Postal = $New_zip
End-Sql
On-Error=Warn => is used when we want a warning message to be displayed when an error
occurs.
On-Error=Stop =>is used when we want to halt the program if an error occurs. Note that the rest
of the program will be scanned for errors but will not be processed.
On-Error=Skip => is used when we want to ignore all errors and to continue to run the program.

Sample Interface Program

INTRFC.sqr

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 13: M ULTIPLE R EPORTS


In a multiple-report SQR program, each report must be defined with a separates Declare-Report
command, this command is coded in the Setup Section.
In the Declare-Report command, specify the following attributes
Name of the report
Name of the Layout to be used for the report
Type of the printer to be used for the report
Depending on the specific business requirements, each report can use its own Layout or printer
definition, or some reports can share same Layout or Printer definitions. If no Printer-Type is
specified, the default is LINEPRINTER for the report. If no Layout is specified in the DeclareReport command, the Default Layout is used.
Declare-Report My_Report1
Layout=My_Layout1
Printer-Type=PS
End-Declare
The Declare-Layout command is also coded in the Setup Section. This command allows
specifying the attributes of the layout for our output file and defining as many layouts as we need
for our application.
If we dont code the Declare-Layout in our SQR program, a default layout with the name Default
will be created.
Begin-Setup
Declare-Layout Layout1
Left-margin=1
Right-margin=1
End-Declare

Declare-Layout Layout2
Left-margin=5
Right-margin=5
End-Declare

Declare- Empl_detail
Layout=Layout1
Printer-Type=HP
End-Declare

Declare-Report Empl_Summary
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15
Layout=Layout2
Printer-Type=PS
End-Declare

End-Setup
Begin-Heading 4 For-Reports=(Empl_Detail)
Print Employee Detail Report (1) Center
Print .
End-Heading

Begin-Heading 2 For-Reports=(Empl_Summary)
Print Employee Summary Report (1) Center
Print .
End-Heading

Begin-Footing 1 For-Reports=(Empl_Detail)
Print End of Employee Detail Report (1) Center
End-Footing

Begin-Program
Let $Emplid='12345'
Let #count=1
Use-Report Empl_detail
Print Emplid:||$Emplid (1,1)
Use-Report Empl_Summary
Print Total Employees: (+1,1)
Print 'Total count'||#count (,1)
End-Program

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 7: XML P UBLISHER


In this chapter we will cover the following topics:
Lesson 1: XML Publisher Overview.

Lesson 2: XML Publisher Configuration.

Lesson 3: Creating Query-Based XMLP Report

L ESSON 1: XML P UBLISHER A N

OVERVIEW

XML Publisher is a Java-based reporting tool that makes report generation more efficient
by separating the data extraction logic from the report layout
Publisher is synonymous with BI Publisher (Business Intelligence). The two terms are
interchangeable.

F E ATU R E S

OF

XMLP:

Report templates can be created using common software such as Microsoft


Word, Excel, Adobe Acrobat, etc., while data sources can come from PeopleSoft
Queries, rowsets, XML document objects, or XML files.
The separation of data sources and report templates allow end users to modify
the report layout, using familiar desktop applications, without the assistance of
technical developers once the data source of the report is created.
There are four XMLP report output types:

XMLP Report Output Types

HTML

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

PDF

RTF

XLS

L ESSON 2: XML P UBLISHER C ONFIGURATION


XML Publisher configuration includes the following phases:
Set up XML Publisher
Provide security
Register data sources
Create Templates
Create Reports and attach templates
Run and view the reports
Step 1: Setting up XML Publisher
Install the MS Word Plugin. This will help in creating rtf templates to be attached with
report.
You can find it from Reporting Tools XML Publisher Setup Design Helper

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Pre requisite jre 6.21 32 bit (minimum version)


Once the design helper is installed we can view it under the Add Ins in
Word.

Step 2: Providing security


Before creating any report, create a report category to provide security to the report.

For example, if we want to create compensation reports, then we can create category
compensationand assign the role / users to it that can view or run the report.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Step 3: Register Data Sources


The next step is to register the data sources. Data sources are entities that will hold the
logic to retrieve the data to be displayed on the report.
There are three types of data sources that are available in PeopleTools 8.51 viz. XML
File, Connected Query and PS Query.
Step 4: Create Template and Layout
Now, create report layout which will define how our report will look like. We can design
the templates through rtf in MS Word, PDF and XSL.
Step 5: Create Report
Now, we will define the report where we will attach the data source, template and output.
Step 6: Run the report
There are 2 ways to run XML Publisher Report
Now run the report by Query Report Viewer.Navigation:

Reporting Tools XML Publisher Query Report Viewer and click on View
Report
By PeopleCode. On the PIA, create a page with a text box and a push button On
the FieldChange event write the following peoplecode

L ESSON 3: C REATING Q UERY -B ASED XMLP R EPORT


1. Create PS Query
We have created a simple PS Query DR_XMLPUB_QRY which prompts for an
employee id and displays the output from NAMES table.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

2.Create Data Source

Now, we will create a data source.


Navigate to Reporting Tools > XML Publisher >Data Source

Generate the Sample Data File.


Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Save the changes.


3.

Create Template

Save the above generated XML. Now, open MS Word.Navigation


Add-Ins > Data > Load XML Data

Select the above XML File and we will get the following message.

Now, we will generate the template using uploaded xml file.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Select all the columns except @rownumber.

Here, we have select EMPLID as the field on which grouping will be done.
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Enter valid column labels.

Finally the template is generated.

Save the template.


Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

4.

Create Report

Now, we will create the report where we will attach the above create template
and we will provide the output options.
Navigate to Reporting Tools > XML Publisher > Report Definition
Add a new value

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Click on the Template Tab and upload the above created template.

Click the Output tab and select PDF as output.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Now, save the report.


5.

Run the Report

Navigate to Reporting Tools >XML Publisher > Query Report Viewer


Open the above create report.

Now, click on view report.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

C HAPTER 8: I NTEGRATION T OOLS


In this chapter we will cover the following topics:
Lesson 1: Introduction to Integration Tools.

Lesson 2: Working with Flat Files.

Lesson 3: File Layout Definitions.

Lesson 4: PeopleCode and Flat Files

Lesson 5: Creating and Testing Component Interfaces

Lesson 6: Component Interface PeopleCode

Lesson 7: Excel to Component Interface Utility

Lesson 8: Integration Broker Overview and Setup

Lesson 9: Configuring IB

Lesson 10: Service Operation Monitor

L ESSON 1: I NTRODUCTION TO I NTEGRATION T OOLS


PeopleSoft Integration tools are used to integrate with other PeopleSoft databases
and third-party systems. These tools include Integration Broker and component
interfaces. We can configure PeopleSoft Integration Broker to send and receive
Service Operations, Integrate data using component interfaces. The benefits are to
ensure smooth and efficient integrations of your PeopleSoft applications with other
PeopleSoft databases and third-party systems to help your organization can
quickly adapt to competitive and customer challenges.
Produce real-time synchronous and asynchronous integrations, and leverage
adapters to several key technology interfaces, such as web services, ftp, and
email.

L ESSON 2: W ORKING WITH F LAT F ILES


A flat file, in the simplest sense, is a collection of data fields in text format.
In other words Flat files are data files that contain records with no structured
relationships.
Plain text files usually contain one record per line.
There are comma-separated, delimiter-separated and fixed length flat files, Fields
can be separated by delimiters such as comma or tab characters.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Eg:

L ESSON 3: F ILE L AYOUT D EFINITIONS


A file layout is a definition that represents the data structure of a flat (text) file to be
processed. When reading from or writing to a flat file, PeopleCode can use a file
layout as a template to identify and correctly process the records and fields of the
file.
Using a file layout greatly simplifies reading, writing, and manipulating hierarchical
transaction data with PeopleCode. It can facilitate transactions between a
PeopleSoft application and a third-party system when the third-party system does
not support PeopleSoft Integration Broker or component interfaces.

C ONSTRUCTING F ILE L AYOUTS

Create new file layout definitions

Add file records and file fields

Reorder file layout nodes

Name file layouts, records, and fields

Apply field formats

C REATE

NEW FILE LAYOUT DEFINITIONS

Open Application Designer, select File, then select New, then select File Layout
definition.
A new file layout contains only one element, the root node (NEW FILE) to which file
records are attached. The default root node name is NEW FILE.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Save the new file layout definition. You are prompted to name the file layout, which
also becomes the name of the root node.

A DD

FILE RECORDS AND FILE FIELDS

Drag and drop a database record / Insert a database record


Drag a record definition Drag a record definition from the Project window into the
definition window of the file layout, dropping it on the root node or on any existing
file record or file field. The new file record appears at the same level and the
system inserts all the fields of that particular record.
Insert a database record Right click on the root node or a file record highlighted,
select Insert, then select Record. The new file record appears following the
highlighted file record and at the same level. The system automatically inserts all of
the fields of that particular record.

Drag and drop a database field / Insert a database field / file field
Drag a field definition Drag a field definition from the Project window into the
Definition window of the file layout, Give the field a name and click OK. The new
file field appears following the node that you dropped it on.
Insert a database field On a file record or file field highlighted, select Insert, then
select Database Field. Give the field a name and click OK. The new file field
appears following the highlighted node.
Insert a file field On a file record or file field highlighted, select Insert, then select
File Field, then select and enter a file field name. When you click OK, the new file
field appears following the highlighted node.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

R EORDER

FILE LAYOUT NODES

There are directional arrow buttons in the toolbar. With the help of these you can
reposition any file record within the hierarchy of the file layout or any file field within
its parent file record.
The up and down arrows do not change the level of the selected item, just its order
among other items at that level. The right and left arrows move the selected item
lower and higher in the file layout hierarchy.

N AME

FILE LAYOUTS , RECORDS , AND FIELDS

File layout names can be 30 characters in length, and file record and file field
names can be 15 characters in length. All names should follow PeopleSoft naming
standards.
Using WriteRecord, ReadRowset, and WriteRowset
If you are using WriteRecord, ReadRowset, or WriteRowset file layout methods for
writing to or reading from records, the application record and the file record must
have the same name, and the application record fields and the file fields must have
the same names. These methods write only to like-named records and like-named
Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

fields within a given record. If you rename a record or a field after you use it to
create a file layout definition, you must rename the file record or file field to the
exact same name.
In a file layout definition containing more than one record, the system ignores
records and fields that are not like-named. Like-named records do not have to
contain all of the same fields, and like-named fields do not have to be the same
length. Like-named fields should, however, be of the same type.

A PPLY

FIELD FORMATS

Numbers Format in FIXED Files When you write numeric data to a FIXED format
flat file, all the numbers are right-justified in the file field. Numbers with decimal
places specified are written with zeros padding the unused decimal places.
For example, a sequence of records with numbers of varying precision is written
this way:
001
53.2700BUY
002 2174.0933SELL
003
108.0000SELL
Date, Time, and Datetime Field Lengths
Date fields have a fixed length of 10.
Time fields have a fixed length of 20.
Datetime fields have a fixed length of 31.
Single digits in dates in the form MMDDYY or MMDDYYYY must be padded with
zeros.
That is, if the date in your data is February 3, 2002, the form must be:
02/03/2002
02/03/02
The following is not valid: 2/3/02.

Datetime fields must use one of these below formats.


CCYY-MM-DD HH:MM:SS
CCYY-MM-DDTHH:MM:SS (with time separator)
CCYY-MM-DD HH:MM:SS.ssssss (with fraction of seconds)
CCYY-MM-DDTHH:MM:SS.ssssss (with time separator and fraction of seconds)
CCYY-MM-DD HH:MM:SS.ssssss+hhmm or CCYY-MM-DD HH:MM:SS.ssssss-hhmm (with
fraction of seconds and universal time zone offset)

L ESSON 4: P EOPLE C ODE AND F LAT F ILES


Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

R EADING AND W RITING D ATA TO A F LAT F ILE

Methods to Read and Write (Plain Text Files)

Writing Files (Defined by a File Layout)

Writing files using peoplecode

M ETHODS

TO

R EAD

AND

W RITE (P LAIN T EXT F ILES )

We use file class methods to read and write data from a flat file. PeopleCode can
use a file layout as a template to identify and correctly process the records and
fields of the file. Below are the File class methods.
ReadLine (string parameter)

WriteLine (string parameter)

WriteString (string parameter)

The ReadLinemethod reads one line of text from the external file. The line includes
the newline character. The result is stored into the string variable string.
The WriteLine method writes one line of text to the output file followed by a
newline character.
The WriteString method writes one string of text to the output file associated with
the file object without any newline character.

W RITING F ILES (D EFINED

BY A

F ILE L AYOUT )

First we need to specify the properties for:


File Layout

File Record

File Field

File Layout Properties Right-click on the file layout root node and select Data
Object Properties.
Give the specific required information in the Use tab for the file layout.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

File Record Properties Right-click on the file record and select Selected Node
Properties to give the specific file record level properties.

File Field Properties Right-click on the file field and select Selected Node
Properties to give the specific file field level properties.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

W RITING

FILES USING PEOPLECODE

Local File &MyFile;


Local Record &rec1;
Local SQL &SQL1;
/*Create Instance of Record */
&rec1 = CreateRecord(record.person);
&MyFile = GetFile(c:\temp\help_me.txt, A, %FilePath_Absolute);
&MyFile.setFileLayout(FileLayout.root_node);
/*Create SQL object to populate rowset */
&SQL1 = CreateSQL(%selectall(:1), &rec1);
While &SQL1.Fetch(&rec1)
&MyFile.WriteRecord(&rec1);
End-While;
&MyFile.Close();

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 5: C REATING AND T ESTING C OMPONENT


I NTERFACES
Component Interface is a set of application programming interfaces (APIs) that you
can use to access and modify PeopleSoft database programmatically. Means you
can access the peoplesoft component without using the peoplesoft pages. It has
the real time access to the peoplesoft data and business rule. PeopleCode events
typically fire in the same order as in the online case.
Creating a new component interface

Select File, New from the Application Designer menu.

Select the Component Interface object type from the New dialog.

Select the component on which this component interface will be

based.
Save the component interface.

Testing a component interface


Select Tools, Test Component Interface from the PeopleSoft in Application
Designer menu. The Component Interface Tester search dialog box appears. This
dialog box displays the keys (in the left-hand columns) for getting, creating, or
finding an instance of the component interface. The right-hand columns provide a
place for you to enter sample key values for testing.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Once you enter the search (get) key (or add a new value - create key), you are
presented with the data in the underlying component or the opportunity to enter
new data into the component.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Enter the data manually in the right hand side columns to check how the
Component Interface is working. If there are any errors they will get displayed in
the Error Message Log.

L ESSON 6: C OMPONENT I NTERFACE P EOPLE C ODE


PeopleSoft can automatically generate code for a component interface but it is
important to note that it will not be completely correct. You will need to tweak the
create/get/find keys and should ensure that all the scroll 0 properties that you
require have been added.
Also very important is to give your fields and collection scrolls meaningful names
so that it is very handy for when you are coding. It makes referring to data
collections so much simpler.
Create an Application Engine to generate the code for the Component Interface.
Open the App Engine peoplecode action and drag and drop the CI from the left
hand side pane.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

The generated code contains the standard set of peoplesoft methods and
properties. Open the generated code and modify the source to meet the needs of
your application.
Below are the standard set of methods
Cancel() Cancels the instance of the component interface object executing this
method and rolls back changes. This closes the component interface and returns
its created state. Returns True if component is succesfully cancelled, otherwise
returns False.
Create() Creates (adds) a new set of keys to the component - essentially the same
as pressing add and entering the relevant keys through the component. The
created keys are associated with the component interface object. At this point the
CI is instantiated with the created data. Returns True if data is successfully
created, otherwise returns False.
Find() Find allows for a partical key (wildcard) search for data in the underlying
component.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Get() Gets the data from the underlying component interface matching on the get
keys specified. Returns True if data is successfully retrieved, otherwise returns
False.
Save() Save changes made to the component data through the component
interface object. The save method triggers standard PeopleCode Processing.
Returns True if data is successfully saved, otherwise returns False.
Error Handling
The errors which are generated while running the component interface are logged
into the PSMessages collection. Use this collection to troubleshoot the errors.

L ESSON 7: E XCEL TO C OMPONENT I NTERFACE


U TILITY
Excel to Component Interface utility is used to upload data from Microsoft Excel
into your PeopleSoft database, using component interfaces.
It uses Excel workbooks as a template to create worksheets that are specific to the
business logic that you need to use when you are uploading data to the PeopleSoft
system. You can copy the data input sheet to other workbooks for distribution
without copying the code modules.
The code formats spreadsheet data into a PeopleSoft readable Document Object
Model (DOM) structure, and submits it to the PeopleSoft database. Next a
PeopleCode program parses the DOM structure and uses the component interface
to create entries in the PeopleSoft database, validating the data submitted against
the business logic that is built into the PeopleSoft component. Because the
component interface is a wrapper around the component, all logic applied during
data entry is applied when you are loading data through this tool.
The component interface executes all the necessary PeopleCode events and the
field-level edits. Based upon results from saving the component interface, another
DOM is created in the PeopleCode that returns success, warnings, errors, or a
combination of the three to the Microsoft Excel document. Records in error can be
corrected and resubmitted.
Getting Started with the Excel to CI Utility
1. To launch the Excel to Component Interface utility, you will need to locate
the ExcelToCI.xls executable file in the PS_HOME\excel folder.
2. Grant Access to WEBLIB_SOAPTOCI
3. Enable Macros in Excel

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

4. The coversheet of the Excel to Component Interface utility workbook


gives a brief overview of the process flow and functionality of the tool.
5. Enter Connection Information
6. Connect to the Database to Create a Template and Submit Data
7. Create a Template. Template page is a graphical representation of the
component interface structure that you would be using to upload the data.
8. Access the Data Input tab to enter data
9. Access the Staging and Submission tab to submit data.

The Process
1. Connection Information SheetThe information provided on this sheet is
required to create a new template or submit data to the database. You will need to
specify environment information as well as information in regard to how each
transaction should be handled. The action will be filled in automatically.
2. Template Sheet The template is based upon the structure of a component
interface on the peoplesoft database. Enter the peoplesoftUserID, Password and
the component interface you wish to use.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

3. Data Input sheet Here you enter data values for the submission to the
peoplesoft database. The data entered on the data input sheet is then staged in
hierarchical form in preparation for the submission to the database.
4. Staging & Submission Sheet This is used to format the data and submit to the
database. This submits the data to the database. Each row submitted is marked
with the reply from the database which will be ok, warning or error. This posts the
status for each row submitted to the database on the data input sheet so that data
in a status of error can be corrected and resubmitted.

L ESSON 8: I NTEGRATION B ROKER O VERVIEW

A middleware technology that facilitates PeopleSoft in exchanging data with


PeopleSoft or 3rd party applications.
Features Service Oriented Architecture so that business logic can be
exposed/consumed as a Web-Service
Exchanges data in XML form.
Allows data transformation.
Facilitates both Synchronous/Asynchronous communication
Integration components:

Messages
Contains application data in XML (Extensible Markup Language) format
Service
Can have multiple service operations
Queue
Facilitates the processing sequence of the service operations
Service Operations
Contains request/response/fault messages
Specifies the type of communication
Node
Define what application a message belongs to - any system that
integration broker can talk to (including the local system) will have a node.
Event Handler
Handles request
Integration Gateway
Are the pathways between systems.There is always a LOCAL gateway in
PeopleSoft which refers to the source PeopleSoft system and remote
gateway which refers to the remote system.
Routing
Link a service operation to a node, and can also specify transformation of
a message.

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 9: C ONFIGURING IB
S TEP 1 A CTIVATE P UB / S UB S ERVERS
Open PSADMIN and make sure that the Pub/Sub Servers option is Yes in Application
Server.

STEP 2 CONFIGURE LOCAL GATEWAY


Please follow the step as given in the attachment:

Configuring the
Gateway.docx

S TEP 3 C REATE M ESSAGE


To create a Rowset message:
Navigate to Main Menu PeopleTools Integration Broker Integration SetUp Messages
Click Add a New Value tab and provide message name, type and version of the message
and click Add button

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

S TEP 4 C REATE S ERVICE

Navigation Main Menu PeopleTools Integration Broker Integration SetUp Services

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

S TEP 5 C REATE Q UEUE

S TEP 6 C REATE S ERVICE O PERATION


Steps:
1. Navigation Main Menu PeopleTools Integration Broker Integration SetUp Service
Operations
2. Click Add New Value
3. Provide
a. Service name: TEST_IB_SERVICE
b. Service Operation : TEST_IB_SERVOPR
4. Operation type : Asynchronous One-way
5. Click Add button
6. Provide default version of the service operation as V1
7. Provide message information and queue name
8. Save Service operation definition

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

S TEP 6 C REATE R OUTING


Steps:
1. Open Service operation definition TEST_IB_SERVOPR
2. In the general tab look for Generate Local-to-local check box. Select the same and click
Save
3. To view the routing details, go to the Routings tab and select the routing to view details

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

L ESSON 10: S ERVICE O PERATION M ONITOR


This tool helps us to monitor all the publications and subscription message for both the
Asynchronous and Synchronous message:
Navigation for Service Operation:
Asynchronous Message - Main Menu PeopleTools Integration Broker Service
Operations Monitor Monitoring Asynchronous Services

Synchronous message - Main Menu PeopleTools Integration Broker Service


Operations Monitor Monitoring Synchronous Services

Asynchronous Service Operation Monitor:

Synchronous Service Operation Monitor:

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

PeopleSoft v9.1 Accounts Receivable


Training Guide

June 15

Proprietary, and, Confidential, to, CedarCrestone, Inc.>

Page

You might also like