Professional Documents
Culture Documents
1
P EOPLE T OOL 8.52
T RAINING G UIDE
June 2015
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
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
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:
How It Is Used
bold text
June 15
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.
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:
June 15
Notes
June 15
L ESSON 1: PIA
C HAPTER S TRUCTURE
Most chapters are structured the same way and generally consist of
the following:
June 15
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.
Web Server
Application Server
Database Server
June 15
Extensive Portability
Single Sign On
You are encouraged to ask your instructor questions throughout the entire
course.
June 15
B. OBJECT WORKSPACE
To create and modify definitions, which can be maximized,
minimized, cascaded or tiled in the workspace.
C. OUTPUT WINDOW
June 15
OBJECTS IN PEOPLETOOLS
Field
Record
Page/Panel
Component
Menu
FIELDS
Proprietary, and, Confidential, to, CedarCrestone, Inc.>
June 15
TYPES OF FIELD
TYPES OF FIELD
Field Types
Character (Char)
Description
Alphanumeric field of fixed length.
Long Character
(Long)
Number (Nbr)
Date (Date)
Time (Time)
DateTime (DtTm)
Image (Img)
ImageReference (Iref)
Attachment (Att)
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 TYPES
TYPES OF FIELD
Field Types
Description
SQL Table
June 15
TYPES OF FIELD
Field Types
Description
SQL View
Dynamic View
Derived/Work
SubRecord
Query View
Temporary Table
PAGE
Pages are the graphical interface between your users and your
application database.
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
June 15
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.>
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.
June 15
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.
June 15
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.
June 15
Search Page
June 15
June 15
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
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.
June 15
Select
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.
June 15
8. Click
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
1. Click File
2. Click New
3. Click Record
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.
June 15
7. Click
10. Click
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.
Click
To expand the
view of the
subrecord.
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
1. Click File
2. Click New
3. Click Page
4. Click
June 15
June 15
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
1. Click File
2. Click New
3. Click Page
June 15
4. Click Insert
5. Click Subpage
June 15
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).
June 15
PeopleCode Example
June 15
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.
June 15
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
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
June 15
L ESSON 6: PEOPLECODE
BUILT IN FUNCTIONS
Like any other Object Oriented Language PeopleSoft also have functions.
PeopleCode supports the following types of functions:
Internal: Functions that are defined (using the Function statement) within
the PeopleCode program in which they are called.
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.
June 15
L ESSON 7: WRITING
ON YOUR OWN
F UNCTIONS
THE
FUNCTION
THE
FUNCTION
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)
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 :
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.
AND
OOP C ONCEPTS
A PPLICATION C LASS :
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.>
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
June 15
Import class
Class name
Class extensions
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.
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
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
June 15
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.>
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;
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.>
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.>
June 15
return 1;
end-if;
return&I * factorial(&I - 1); /* error - factorial undefined */
return&I * %This.factorial(&I - 1); /* okay */
end-method;
G ET
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.
A PPLICATION C LASSES :
June 15
S COPE
OF
A PPLICATION C LASSES :
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.>
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)
June 15
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.
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.
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
June 15
CreateRowset
GetLevel0
GetRowset
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);
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
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
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.>
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
IN
P EOPLE C ODE
June 15
using Execute method. If you supply all the necessary input values, the SQL is executed
immediately.)
For a SQL object containing a Select statement, the Fetch method is used
to retrieve the next row from the cursor.
IN
P EOPLE S OFT
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.
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:
June 15
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
June 15
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.
June 15
Actions.
We can use multiple Actions within the Steps. Application Engine is
having below Actions.
SQL: This Action is used to write update, insert and delete sqls.
Call Section: This Action is used to call another Section within the
program or we can call Section from other program.
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.
June 15
June 15
0 Disable
1 Step trace
2 SQL trace
psae.exe TRACE 2
June 15
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.
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.
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.
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
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.
June 15
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.
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:
June 15
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.
June 15
R ECORDS T AB :
June 15
It will help to search the record names that you will use in the querry.
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.>
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.
June 15
June 15
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
June 15
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.>
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.
June 15
Click the OK button again to bring you back to the Criteria tab.
Save if you like the results if not you may go back and adjust
your prompt or criteria.
Record-hierarchy join
Related-record join
Record-Hierarchy Joins
Record-hierarchy joins use records that are related through a parent-child relationship.
June 15
Steps:
Select the Query page, and then click the Hierarchy join link.
June 15
Print a query
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
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
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.
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.
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
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
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.
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.
June 15
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.>
June 15
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
June 15
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.
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.
June 15
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.
June 15
June 15
June 15
C HAPTER 6: SQR
In this chapter we will cover the following topics:
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
Reports
Background SQL process
Interfaces (file handling)
June 15
BEGIN-FOOTING
{footing commands}
END-FOOTING
June 15
{commands}
END-PROGRAM
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.>
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:
Example
let #answer = #float_ no* #decimal_ no/ #integer_ no
M OVE
Syntax :Movesource_fldtodest_fld [ edit _ mask]
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.>
June 15
D ISPLAY
AND
S HOW
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.>
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
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.>
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
Important SQCs
#include 'setenv.sqc'
#include 'stdapi.sqc'
#include 'prcsdefn.sqc'
#include 'prcsapi.sqc'
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:
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)
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.
June 15
L ESSON 9: R UNNING
AN
SQR P ROGRAM
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
June 15
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.
June 15
Page
June 15
Here note that no extension is needed when entering the program name
b. Click Add
Page
June 15
e. Finally Save the Process & place theprogram into right directory as shown below
!********************************
! 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
June 15
Click on Details
Page
June 15
R UNNING
IN
CMD
FOR
SQR
Page
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.
Page
June 15
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:
Page
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
INTRFC.sqr
Page
June 15
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
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
Page
June 15
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:
HTML
June 15
RTF
XLS
June 15
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.
June 15
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
June 15
June 15
Create Template
Select the above XML File and we will get the following message.
June 15
Here, we have select EMPLID as the field on which grouping will be done.
Proprietary, and, Confidential, to, CedarCrestone, Inc.>
June 15
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
June 15
Click on the Template Tab and upload the above created template.
June 15
Page
June 15
Page
June 15
Lesson 9: Configuring IB
Page
June 15
Eg:
C REATE
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.
Page
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
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.
Page
June 15
R EORDER
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 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
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.
Page
June 15
M ETHODS
TO
R EAD
AND
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)
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.
BY A
F ILE L AYOUT )
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.
Page
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.
Page
June 15
W RITING
Page
June 15
Select the Component Interface object type from the New dialog.
based.
Save the component interface.
Page
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.
Page
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.
Page
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.
Page
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.
Page
June 15
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.
Page
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.
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.
Page
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.
Configuring the
Gateway.docx
Page
June 15
Page
June 15
Page
June 15
Page
June 15
Page
June 15
Page