iq 2011 by gvr

100
Page | 1 Peoplesoft Interview Questions Application Designer Project A user-defined collection of related object definitions created for the purpose of developing, customizing, or upgrading a PS application What are the 9 Development Steps? Design the application. Define New Fields Create the Record Definition Build the SQL Table Create the Panel Definition Define the Panel Group Add the Panel Group to a Menu Enable Security Test the Application Record All the data that resides in PS applications is stored in tables, or records, as part of a relational database system. Each record definition describes the properties of an underlying SQL table. Record Types 1.SQL Table A record definition that has a corresponding physical SQL table in the database. Create this table when you run the Build Operation from the Build menu. This is the default setting. (A physical SQL Table present in the database, this is the default.) 2. Sql View A record definition that corresponds to a SQL view, which is not a physical SQL table in the database, but rather fields from one or more SQL tables that are reorganized into a different sequence. This provides an alternate view of information that is stored in tables. To create the SQL view, click the Click to open SQL Editor button, enter a SQL Select statement, and then run the Build process. Not a physical SQL Table but corresponds to a view written in SQL referring one or more fields from different tables. This gives a filtered view of information stored in tables. Stored in the database as a view. (Query view is system generated and SQL views are created by developer) whenever you modify a record you need to take care: check if any views are dependent on this record. 3. Dynamic View 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. 4. Derived/Work Record 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. We can use it to calculations. It is not an object, and also we can use it as a funclib. 5. Sub Record The record definition as a sub record—a group of fields that are commonly used in multiple record definitions—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. Group of fields used in multiple records like companies having address data of employees. If you have to use the same fields in different record definitions, then we will store all those fields in a subrecord and add this subrecord as a field to the record definitions. Stored in the database. 6. Query View The record definition as a view that is constructed using the PS Query tool. Before you can create the view, PS APP.Designer prompts you to save the definition. Using the PS Query we don’t need to write a query it will automatically generate by dragging and dropping. 7. Temporary Table

Upload: gvenrey-gmailcom

Post on 28-Nov-2014

237 views

Category:

Documents


6 download

DESCRIPTION

PS

TRANSCRIPT

Page 1: IQ 2011 BY GVR

Page | 1

Peoplesoft Interview Questions

Application DesignerProject

A user-defined collection of related object definitions created for the purpose of developing, customizing, or upgrading a PS application

What are the 9 Development Steps? Design the application. Define New Fields Create the Record Definition Build the SQL Table Create the Panel

Definition Define the Panel Group Add the Panel Group to a Menu Enable Security Test the

ApplicationRecord

All the data that resides in PS applications is stored in tables, or records, as part of a relational database system. Each record definition describes the properties of an underlying SQL table.

Record Types1.SQL Table

• A record definition that has a corresponding physical SQL table in the database. Create this table when you run the Build Operation from the Build menu. This is the default setting. (A physical SQL Table present in the database, this is the default.)

2. Sql View• A record definition that corresponds to a SQL view, which is not a physical SQL table in the database, but

rather fields from one or more SQL tables that are reorganized into a different sequence. This provides an alternate view of information that is stored in tables.

• To create the SQL view, click the Click to open SQL Editor button, enter a SQL Select statement, and then run the Build process.

• Not a physical SQL Table but corresponds to a view written in SQL referring one or more fields from different tables. This gives a filtered view of information stored in tables. Stored in the database as a view. (Query view is system generated and SQL views are created by developer) whenever you modify a record you need to take care: check if any views are dependent on this record.

3. Dynamic View • 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. 4. Derived/Work Record

• 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. We can use it to calculations. It is not an object, and also we can use it as a funclib.

5. Sub Record• The record definition as a sub record—a group of fields that are commonly used in multiple record definitions—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.

• Group of fields used in multiple records like companies having address data of employees. If you have to use the same fields in different record definitions, then we will store all those fields in a subrecord and add this subrecord as a field to the record definitions. Stored in the database.

6. Query View• The record definition as a view that is constructed using the PS Query tool. Before you can create the view, PS APP.Designer prompts

you to save the definition. Using the PS Query we don’t need to write a query it will automatically generate by dragging and dropping.

7. Temporary Table• Temporary images of the table can be specified on the People Tools Options page. Temporary tables are used for running PS AE

batch processes. Temporary tables can store specific data to update without risking the main application table.• we will do all the manipulations on the data present in the temporary table. • Increases the performance, as it is not stored in the database.

Build option available for below record types only: SQL Table, SQL View, Query View, Temporary table

What is a dynamic view? Where we can use dynamic View?• It can be used like a view in pages and people code but not stored in database as a sql view,• Instead the system uses the view text as a base for the sql select that is performed at runtime.• These views shows superior performance in some situations such as search records and people code

selects.What is difference between SQL View and Dynamic View?

• SQL views are written against the RDBMS catalog tables. Dynamic view is declared only to people tools and not to the system catalog. SQL views are not recommended for performance tuning as they run against the database. Dynamic views improve performance. SQL views reside in the database dynamic views are not.

Advantages of Using Search Views instead of Search Table• As the search view is created with selected fields there will not be much stress on AS

Page 2: IQ 2011 BY GVR

Page | 2

Peoplesoft Interview Questions

• and there by improves the performance. Search View also gives additional search criteria.

Effective dates enable you to keep historical, current, and future information in tables. You can use the information to review the past and plan for the future. There are three types of effective dates :

• 1. Future: Data rows that have effective dates that are after the system date, which is usually today’s date. • 2. Current: Data row with the most recent effective date that is closest to today’s (system) date, but not a future

date. Only one row is the current row. 3. History: Data rows that have effective dates before the current data row. • The EFFDT (effective date) field has special properties related to the processing of effective dates on rows

and should be used only when needed. • Unlike regular date fields, which you can use anywhere in the system, use the EFFDT field only on record

definitions for which you want to maintain data history—future, current, and past—to store rows of data in sequence. This enables you to store multiple occurrences of data based on when it goes into effect.

• For effective-dated rows, you can have multiple occurrences of future and history, but only one current row of data. • EFFDT is almost always a key and almost never a list item. Activate the Descending Key attribute so that

the row with the most recent effective date appears first on pages. You might enter %DATE (current system date) as the default constant for this field.

Effective Status• In prompt tables, EFF_STATUS (Effective Date Status) usually accompanies EFFDT. When used with EFFDT, it’s part of

the mechanism that enables the system to select the appropriate effective-dated rows. • You can also use EFF_STATUS by itself as a simple status field, but don’t change the translate values. They must be

A (active) and I (inactive) for EFFDT to work properly. If you need a status field with different values, use or define a different field.

The EFFSEQ (Effective Sequence) field serves different purposes, depending on whether it’s paired with EFFDT. If EFFSEQ isn’t paired with EFFDT, EFFSEQ has no special function and can be used as a simple sequencing field wherever you need one.

• If EFFSEQ is paired with EFFDT, it enables you to enter more than one row with the same effective date. You assign a unique sequence number to each row that has the same effective date. Do not make EFFSEQ a required field—unrequired allows the first EFFSEQ to be zero. Select Display Zero in the page definition to have zeros appear on the page.

• For example, suppose that you want to enter both a transfer and a pay rate change for an employee, and both actions are effective on the same day. Enter the transfer on the job data pages as usual, and leave the Effective Sequence Number field as 0 (zero). Then, insert a row to enter the change in pay rate. This time, the effective date is identical to the previous row, but enter 1 in the Effective Sequence Number field.

What is Effective Date ? Date on which a table row becomes effective, the date that an action begins. For example, if you want to close out a ledger on June 30, the effective date for the ledger closing would be July 1. This date also determines when you can view and change the information. Pages or panels and batch processes that use the information use the current row. Effective date enables us to keep historical, current, and future information in tables. There are three types of effective dates: Current, History and Future.What is Effective Status ? In prompt tables, EFF_STATUS usually accompanies EFFDT. For example in Department table suppose we inactivated one dept from so and so future EFFDT, from that future date onwards this dept is going to be inactivated, after that whenever we click the link prompt button of dept id field we can see only active departments.What is Effective Sequence ? Whenever we want to enter more than one transaction on the same day for an employee like promotion and salary hike we will use effective sequence. Effseq number starts with 0 Component Represents a logical business transaction or a set of logically related pages that are processed together. CI* Externalizes access to a component, so it can be used by a third party or an application message.

Defining Component, It is a set of logically related pages that are processed together. • Components are the bridge between pages and menus. After the creation of each page we must add

that page to the component. We can add more than one page to the component• Component name length may vary up-to 18 characters, Search record is mandatory to save the

component • Force Search Processing: Select to always run search logic (SearchInit PeopleCode) for this

component. Add Select to add a new high-level key, such as a new employee ID or customer. Except in the case of

effective dating, Add is used to insert a new current row or to update future rows. . If we select only Add action then we can’t modify the existing rows. (Doesn’t have any effect with EFFDT)

Page 3: IQ 2011 BY GVR

Page | 3

Peoplesoft Interview Questions

• Update/Display Select to update existing rows only. • Update/Display All Select to update current and future rows in an effective-dated record. Use only with effective-

dated records. Do not use these actions unless the main record that is associated with the page definitions is effective-dated. This is translated to include history at runtime. Correction Select to update any rows (history, current, and future) in an effective-dated record. Use only with effective-dated records. This is translated to correct history at runtime. Disable Saving Page Select when you want to hide the Save button in the toolbar and disable the Alt+1 (Save) hot key. This prevents the user from being prompted to save when exiting a page. However, it doesn’t prevent using PeopleCode to save a page with the DoSave() or DoSaveNow() functions. This can be helpful for applications in which the user isn’t making database changes and doesn’t need to be prompted to save.

Can we use the same Component in 2 Menus? Yes, we can use same component in any no of menus

You select Update/Display All and Correction properties only with tables that contain the EFFDT field.Note. Remember that you grant all possible actions. You restrict actions later through security features.

Data Entry: Not supported in PeopleSoft Internet ArchitectureUnderstanding Processing Modes:Interactive Mode (formerly called standard)

• In interactive mode ,when the user exits a field that has a field-level event (for example, FieldChange, FieldEdit, RowInsert PeopleCode, prompt validation, related display, and so on),A transmission to the application server is performed to run that field-level event.

• The page is displayed again. Deferred Mode

• Deferred mode enables you to defer many of the conditions that need server processing until running them on the AS is required or requested. 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 run 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. Logic on the application server runs the appropriate system edits and PeopleCode events (in field layout order).

• U can select deferred mode processing at the field, page, and component levels. For a field in the component to run in deferred mode, you must select deferred mode at each of those levels. Deferred processing is the default mode at the field, page, and component levels.

In Interactive mode for every cursor action there will be a trip to the server. In deferred processing mode, trips to the server are reduced.In Differed processing until a user performs an action, which requires a trip to the server there won’t be any trips to the AS.

Expert entry :The Allow Expert Entry check box on the Internet tab of the Component Properties dialog box and Enable Expert Entry check box in the user's profile. If these check boxes are selected, an Expert Entry check box appears on the bottom of the page at runtime.Allow Expert Entry

• This is available for both processing modes. See To use expert entry, select:– The Allow Expert Entry check box on the Internet tab of the Component Properties dialog box. – The Enable Expert Entry check box in the user's profile. – If these check boxes are selected, an Expert Entry check box appears on the bottom of the page at

runtime. If the user selects this check box, the transaction runs in deferred mode, regardless of the setting on the component, page, or field property.

– When you set the component property to deferred mode, that component operates in deferred mode processing for all users, not just those who have expert entry enabled in their profiles

What is PIA Architecture? In PIA end users do not have any peoplesoft specific software installed on their machines, they use Internet browser to connect web server, which interacts with application server.What are components of PIA? 1. Web browser 2. Web server 3. Application server 4. Batch server 5. Database serverWhat are major tasks that the application server (AS) performs in PIA? The AS maintains a persistent connection to the database, and converts PeopleTools and application table data into HTML. The server then

Page 4: IQ 2011 BY GVR

Page | 4

Peoplesoft Interview Questions

provides the HTML to the WS for delivery to the browser. The AS also plays a role in connecting development workstations to the database for 3-tier connections.What are the major tasks performed by the web server (WS) in PIA?WS acts as the front end of the PIA. The WS includes Web services software that displays the HTML to the browser. It also includes java servlets that manage each session’s connection to the AS.What is Tuxedo/Jolt? Tuxedo manages the multiple connections to the database. Jolt is a java based communication protocol. The assembled HTML is sent to the web server.How many types of tables are there in database and what are their differences?1. System Catalog Tables 2. People Tools Tables 3. Application Data Tables

System Catalog Tables: System Catalog Tables stores physical attributes of the tables and views. Naming convention is SYS.

PeopleTools Tables: The objects that we develop using the People Tool Objects are saved inPeopleTools Tables. Naming convention for these tables prefixed with PS. Once a field is created it would be stored in PSfield definition table, once a record is created it would be stored in PSrecdef. (Only definition/structure is stored)

Application Data Tables: stores the data, which is entered by the user through PS application windows and pages. Naming convention for these tables is PS_. Application Data Tables are divided into 2 types: 1. Control Tables 2. Transaction TablesControl Tables: Define the company structure and processing rules.Transaction Tables: These are tables used to record our day-to-day transactions, such as personal data about employees.What is a prompt table? Prompt tables are the most common methods for validating data entry in PS applications. This is like application data table the only difference is that it stores values that other tables can validate against. Prompt table is a control table. (Country table and Company table)Prompt table is used to prompt the valid values for a specific filed on a page. Prompt table can be a view or a table.How many table edits are there in Record field properties?1. Prompt Table With Edit 2. Prompt Table No Edit 3. Translate Table 4. Yes/No Table EditPrompt Table No Edit: Provides List of Suggested values, which users cannot edit.Defines the record to use as the prompt, as above, but you allow the user to type in whatever they wishPrompt Table With Edit: Defines the record to use as the prompt. The value must be in the record if you are to be allowed to continue.Users can edit the contents of the field against the values that are maintained in the specified prompt Table.

Translate Table Edit: Which is nothing but a translate table created by developer.Yes/No Table: I n some situations we want the user to enter only Boolean values like yes or no, true or false in this situation we will use yes no table. The Translate Table for ex: PSYESNO. When you select the Yes/No Table Edit, the system automatically points to the PSYESNO field in the Translate TableSet Control Field: set control field that overrides the set control field of the record definition specified in the prompt tableSet Control Field: If you plan to use the Table Sharing feature to add an additional high-level key to identify common sets of values and handle exception values, add the name of the key here. The set control field determines which set of values appears, based on how you define table sharing. Rs Dt ( reasonable date ): Specifies whether a reasonable date test is performed on a date field. All date fields are automatically edited to ensure that you can enter only valid values. The reasonable date test warns if the date is outside a 30-day range before and after the current date. You can use this, among other things, to guard against entering the wrong year in a date.Search Record and Add Search RecordSearch Record: The search record controls access of rows of data in a table, and its keys andAlternate search keys appear on the search page as criteria. The search record might also contain logic to filter the search to secure rows of data—row-level security is implemented in this way. search returns all data rows to a maximum of 300.Add search record: Add search record is specifically used for add actions. If we are using a search view as a search record for performance in this situation we will put the main record as a add search record so that we can enter new values in this main record. The system default is the standard search record if we don't specify an add search record

Audit Table and their fields? Record and Field Level AuditsRecords the information of user actions details as well as the changes or additions or even modifications done on the table. Audit records are prefixed with Audit_.AUDIT_OPRID Identifies the user who caused the system to trigger the audits —either by performing an add, change, or delete to an audited field. AUDIT_STAMP Identifies the date and time the audit was triggered.AUDIT_ACTN Indicates the type of action that the system audited. Possible actions include:

Page 5: IQ 2011 BY GVR

Page | 5

Peoplesoft Interview Questions

A: Row inserted. D: Row deleted. C: Row changed (updated), but no key fields changed. The system writes old values to the audit table. K: Row changed (updated), and at least one key field changed. The system writes old values to the audit table.N: Row changed (updated), and at least one key field changed. The system writes new values to the audit table. AUDIT_RECNAME Identifies the name of the record definition that was audited.Record Level Audit: for creating a record for record level audit we need to have 3 fields: Audit_operid, Audit_stamp, and Audit_action. We can create our own audit records by prefixing Audit_Field level Audit: By using delivered PS_AUDIT table we can set field level audit.What are the key disadvantages of auditing? Auditing adds overhead to transactions that will slow database performance. Audit tables can grow to be quit large, again draining resources.What is SQL Object? People tool object that we can create and use it wherever we want – PC, views, and dynamic views. %SQL.What are the considerations that you take while altering a table?Any time one intends to change an existing object we should always attempt to find out if thechanges are effecting on other system objects. Edit> find definition reference: If a definition reference any other definitions we must research the connection and determine with the referenced object will have any effects – then we need more follow-up.write People Code in Secondary (Y) as well in Sub Page(N); Level 0 fields must be associated with record fields of search record.Can we keep 2 records at level 0? Yes , provided should match the key fields.Can we use the same Component in 2 Menus? Yes ,we can use same component in any no of menusCan we have a subpage at 0 Level? Yes, we can have a sub page at 0 level.Can we have a Secondary page at 0 Level? We cannot have a secondary page in 0 Level.Can we have a Grid in Level 2 and scroll area in level 3? Yes we can. But performance issues say that a grid should always reside in the last level

Display Control Field / Related Field: Create a view with OPRID (key) and NAME as fields in it. The SQL definition for the view should be like: select a.oprid,b.name from psoprdefn a, ps_personal_data b where a.oprid = b.emplid; Make the OPRID field a Display Control field and hide it . Place the NAME field from the new view as a related display field to the OPRID field on the page. This should display the Name of the person instead of the OPRID on the page.

Component Buffer? Area in memory, which stores data for the currently active component. Whenever you open a component the entire data for that component is retrieved upfront and stored in the application server. Component buffer is a temporary buffer allocation. What data comes into Component Buffer? …………Primary record data, related display fields, translate values and derived work records. If you keep key and alternate search key on 0 level then only 2 values will appear in Component Buffer the other field values will not available. In Component Buffer if you want to see the other field values then place a non-key field on 0 level and make it invisible. Every level will have its own primary record. A level 0 primary record and a search record can be different but the key field values should match.What is Parent Child Relationship ? To maintain parent child relationship if the parent table contains one key field the child table should contain the same key field and one additional key.In parent child relationship we should have a relation between two tables ex: if “A” is the parent table with “x” as a key and “B” is another table then “B” should have “x” as a key with another key “y”, then “B” is the child table of for table “A”.**Standard page: Only Standard page can be attached to the component It is the graphical interface between users and database. The important data is displayed in the standard page. We can place secondary as well as a sub PG in std pG.Secondary Page: Secondary Page contains supplemental information or information that is accessed from more than one main page. Page that will open on users request but remains as a secondary to the primary page display. We can open it through standard page only. The data within secondary page is at the same level or below the level of the page control that launches the secondary page. Page: Pages provide a way to enter, view, and edit data online.

Sub page: sub page controls are used to provide standard look for the commonly used fields.A sub page is referenced as a page control on multiple standard pages.Rather than duplicating the same set of page fields on two or more pages, you can create a single sub-page that contains those page fields and add it to any page. Difference between sub page and sub record All the fields in a sub page must be associated with fields of a sub record in the specified record definition. Sub record contains all related fields, whereas subpage contains fields from sub record.How many levels can we have on a page? Page allows Nested levels up to 3 levels.Can we have a subpage at 0 Level? Yes, we can have a sub page at 0 level.How many Grids can we insert in a single component or page? Well, we can insert as many required grids at a particular level on the page... but we can only have 4 such levels on the page

Page 6: IQ 2011 BY GVR

Page | 6

Peoplesoft Interview Questions

What are Level Based Controls and their Difference? Level Based controls are Scroll Area, Grid and Scroll Bar.Scroll areas have their page fields arranged by the developer. Page fields in a gird always appear in a single row. In grid we can view no of rows by giving occurrences. Scroll areas provide a row separator when you select multiple occurrences of data. We can view multiple rows in a grid while in a scroll area you can retrieve only one row at a time. One can have nested scroll areas but not grids. You can insert grid in a scroll area but not scroll in a grid.What is occur level and occur count?

Occurs Level: Occurs level determines the level of the object that we inserted. By using this we can set levels for example after inserting a level based control in level 2 if you want to change the level based control to level 1 you can change the occurs level.Occur Count: Occur Count determines how many rows should be displayed. For ex if you want the scroll to display only 5 rows then we will give occurs count to 5. What is the difference between a Grid and a scroll? Scroll areas single row of data will be displayed whereas in grid multiple rows of data will be available.Scroll area is used to maintain parent child relationship we insert grid in low level scroll .Example: assume we have 3 scroll levels in our page level1, level2 and level3 we insert grid in level 3 One of the differences between a grid and scroll is that a Grid can be inserted into a scroll but vice-versa is not possible. In fact a Grid is incapable of housing another grid.From an end-user perspective, a Grid provides visual access to many rows of data (from the record) at the same time, whereas a scroll will

display the details of one row of data. What happens if you don't specify a Search Record ... If you don’t specify a search record, you won’t be able to save the component definition. Search record is always required for the component. Menu Enables access to the components you build, along with the pages contained in the components.Defining Menu: A menu is a logical grouping for assigning security to your system. You create a menu as a placeholder for components

Menu Types: 1. Custom (component) menus provide an internal reference for components and pages. They are grouped logically into menu groups to assign security. They are not used for navigational purposes. 2. Pop-up menus appear when a user clicks a pop-up button. Registering Component: The Component Registration wizard in the PS AD attaches components to menu definitions, assigns security access for users, and places navigational links in the registry.The Component Registration wizard is a new feature in PeopleTools 8.4. Once the components are registered, the user interface phase is complete and you can view your application in a browser. Ways of Component registering 1. Component Registration wizard 2. After adding a component to menu right click and click on register menu item 3. In browser people tools -> Portal -> Structure and Content 4. In browser people tools -> Portal -> Menu import

Overriding the Search Record:You might want to reuse a component, changing only its search record. • You can accomplish this by overriding the component search record at the time that the component is invoked from a menu.

To override a component search record, specify a different search record in the properties of the menu item that invokes the component. The component uses the override search record when it is invoked from that specific menu item; the search record

set in the component properties remains unchanged. • By reusing components in this way, you can limit redundancy, keeping your application smaller and easier to maintainCI: 1. The main attributes of a Component Interface (CI) are? Keys, Properties & Collections, Methods and Name What r the different keys in CI? The different keys in CI are Get key, Find key and Create key. Can u differentiate it? Yes, Get key is the search key field in search record of component. Find keys are the search key & alternate search key fields in search record. Create key are generated only when the CMPT is in Add action only.What is Collections? Collections are referred as scrolls(level based controls will be having a primary record) in component for CI. CreateKeyInfoCollection: Returns a set of items that describes the create keys.GetKeyInfoCollection: Returns a set of items that describes the get keysFindKeyInfoCollection: Returns a set of items that describes the find keysPropertyInfoCollection: Returns a set of items that describes properties.What is Component Interface Methods? How many Methods are there?Methods are objects that perform a very specific function on a component interface at run-time.The event of a component interface is methods (like on execute for app-engine.)2 types of methods are there: Standard methods,User defined methodsStandard methods are those that are available for all component interfaces. Cancel, Create, Find, Get, Save.We can disable the standard methods, if we don’t want that functionality by going to the CI properties dialog box. These standard methods provide basic functionality for any CI.

Page 7: IQ 2011 BY GVR

Page | 7

Peoplesoft Interview Questions

User defined methods: User-defined methods are created in PeopleSoft Application Designer to provide added functionality to the component interface. These methods are functions that are made accessible through the component interface. Each function maps to a user-defined method. 2. Which one of the following are standard properties when a Component Interface (CI) is created? GetHistoryItems 3. With reference to the Component Interface Tester which of the following is NOT TRUE? GetExisting option is equivalent to opening a record in Update/Display Mode only 4. Which of the following are TRUE when a Component Interface (CI) is created on component that has Add action enabled? Get keys, Create keys and Find keys gets created automatically. The Create method is created along with the other Standard methods for the CI 5. Which of the following can be mapped as Find Keys for a Component Interface? A OR b 6. Which of the following is NOT TRUE in Component Interface (CI) Architecture? A CI can be mapped to multiple PS components 7. The following are various steps that describe the PeopleCode logic while implementing a Component Interface? 1. Establish a user session 2. Get the Component Interface 3. Populate the Create Keys4. Create an Instance of the CI 5. Populate the required fields 6. Save the CI

ApplicationEngine“”””AE is used for BATCH or ONLINE processing where you have a large (or small) amount of data that needs to be processed without user intervention. Program for NON-REPORT PROCESSING. Programs that perform HIGH VOLUME BACK GROUND PROCESSING against your data.

Technical DefinitionAn AE program is a set of SQL statements, People Code, and Program Control Actions defined in Application Designer that performs a business process. Think of AE as a tool that allows you to define a program's framework, as in its algorithm, structure, and looping constructs. Allows you to take advantage of features such as the People Code File objects and Interlink objects, Component Interfaces, Application Messaging, and so on.

FEATURES: AEprograms reside completely within your database.No Compilation required. Database Flexibility.Does not generate SQL or PeopleCode. Built in Re-Start Logic.Mostly used for SET based processing.PeopleCode can be written.AE program can be called from People Code. AE/SQR: Restart Facility >>>Inbuilt Tool>>>>>Graphical User Interface“The definition view is to create definitions with in a defined hierarchical structure.Program Flow view is a read-only view that shows the expected sequence of steps to be executed at runtime for the program you are developing.” “” ********The five types of AE programs are :• Standard, which is a normal entry-point program. • Upgrade Only, which is used in PS upgrade utilities.• Import Only, which is used by PS import utilities. • DaemonOnly, a type of program used as a daemon process.

Page 8: IQ 2011 BY GVR

Page | 8

Peoplesoft Interview Questions

• Transform Only, a program type used to support Extensible Style sheet Language Transformations (XSLT).Daemon Program Type

• PS AE provides a daemon process, called PSDAEMON that runs continuously when PS Process Scheduler is running, and is intended for recurring jobs.

To add a daemon program: 1. Select PeopleTools, Process Scheduler, Daemon Group.2. Select the Add New Value page. 3. Enter a daemon procedure group name, and click Add.4. On the Daemon Group page, add the appropriate programs to the program name list.APPL.LIBRARY: These definitions are called Application Libraries. They are intended to store shared code (similar to FUNCLIB’s) that can be called from other AE programs. Application Libraries cannot be executed. --An AE program without the main section. It is a collection, or "library," of common routines (in the form of "callable" Sections) that do not run as a standalone program. When sections are defined as "Public," other programs can call the Sections, or routines, that exist in the "library" at runtime. Since this type of Program is not designed to run as a stand-alone program, it does not require the MAIN Section, or initial entry point.

ELEMENTS OF AE: A PS AE program comprises the set of processes to execute a given task, and is made up of several key elements: • Sections • Steps • Actions • State records

Program . Identifies the set of processes, and is in the top a tree like structure of a app engine program. It should contain at least one section. And the first section should be named as MAIN. Section. Sections comprises of one or more steps .

Steps .A step is the smallest COMMITABLE WORK that could be done within a program. Actions . Each step could consists of multiple types of action. Its common to have many actions in a single step. Sections : comprise one or more steps All AE programs must contain at least one section entitled MAIN. The execution of the program always starts with the section defined as

MAIN. A section is a set of ordered steps that gets executed as part of a program. You can call sections from steps within other sections. 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.

Understanding Use Of Temporary TablesPurpose:

Temporary Tables Temporary Tables are used to improve the performance of AE while running in batch mode (multiple instances of same program run in parallel)When this happens, there is a significant risk of data contention and deadlocks on tables. To avoid this PS PeopleTools has a feature that enables you to dedicate specific instances of temporary tables for each program run. To define a temporary table:1. in PS Application Designer, select File, New. 2. Select Record from the New Definition dialog box.3. Select Insert, Field, and insert the PROCESS_INSTANCE field. 4. Select the Record Type tab and select the Temporary Table option.Temporary Tables

• PS batch applications employ the technique of SET processing, and set processing involves extensive use of temporary tables.

• Any Program can access temporary tables.• Contains only those rows which are affected by business rule. Used for storing the transient data for the current run or iteration of program.

Page 9: IQ 2011 BY GVR

Page | 9

Peoplesoft Interview Questions

By storing transient data in the temporary tables, you avoid the situation where the batch program fetches the data, row-by-row , and runs the business rule, processes the data and then passes the updated data back to the database

Improve performance for e.g. If you find that multiple times during a run of program access a small subset of rows from a much larger table, you can insert the necessary rows into a temporary table. Then the program accesses the data residing in the smaller temporary table rather than the large application table.

• Temp Tables has the ability to dedicate physical table instances to one, and only one AE program.• AE automatically manages the assignment of temporary table instances by controlling the

locking/unlocking the table before/after use.• When AE “manages ” a dedicated temp table instance , it controls the locking of table before use and

unlocking after use– Naming convention: --base table name>nn (Where nn is a number between 1 and 99 , as in PS_TEST_TMP23.)

To reference a dedicated temp table, you need to use %Table(record)Temporary Table Instances To run processes in parallel, you need to (Instance Count edit box) enable multiple instances of the same temporary table.

Creating temporary tables enables you to achieve one of the main objectives involved with set based processing—

the processing remains on the database server. By storing transient data in temporary tables, you avoid the situation where the batch program fetches the data, row-by-row, and runs the business rule, processes the data, and then passes the updated data back to the database. If the program were running on the client, you encounter performance issues due to the network roundtrip and the diminished processing speed of a client (compared to the database platform).

• To use a temporary table with a specific program, you assign the table to the program and set the number of instances created when a particular program is run.

The system builds temporary table instances at the same time it builds the base table for the record definition. (Anytime you change the instance counts, you need to rebuild the temporary tables to ensure that the right number of instances gets created and are available for your programs. As long as table is keyed to PROCESS_INSTANCE , and the application SQL includes the Process instance in the where clause, then the table can be shared among multiple process) The Runtime options enable you to control how an AE program behaves in the event that an instance of its specified dedicated

temporary tables are not available. If you select Continue, then AE uses the base version, or undedicated version, of the temporary tables. If you select Abort, then the program exits with an error message.

ASSIGN ONLINE TEMP TBLS: Temp Table Instances (Online) is: Number of temp tables built for all temp tables used in an AE program not designated as batch only. Temp Table Instances (Total) is: Difference between Total and Online is the number of temp tables built for custom allocation

Online Temp Table Usage Temp table is reserved at CallAppEngine time by a random distribution algorithm ‘Online’ AE program is one that is started by the CallAppEngine() function call Online is part of a transaction, so no commit Same table instance locked for every table,,Released when online transaction is committed In the case of a crash, tables do not remain locked -------If no temp tables program will enter a queue and wait CallAppEngine is available from exit points where a transaction will happen

Use the PeopleTools Options page to set the number of temporary table instances for AE processes started online from the PeopleCode CallAppEngine function.

o (Select PeopleTools, Utilities, Administration, PeopleTools Options to access the PeopleTools Options page) Batch Temporary Table Usage

Each table is reserved separately at program load time. A single program may get a different instance table number for each table Locked by a record entry in a shared table when program is loading Programs that can restart retain lock until successful completion Table is cleared when loaded (unless it’s the base table) If no temp tables are available, program may use a shared base table

ASSIGN BATCH TEMP TBLS: Instance count is the number of concurrent instances.Batch Temp tables = Sum of the instance count for each program a table is used , Naming convention PS_NAME_TMPnn

o We can assign more than one temp table to an AE program.View temporary table usage by record.

(Select PeopleTools, Application Engine, Review Temp Table Usage to access the Temp Table Usage by Record page)• Manage abends - way to view and manage batch App Engine programs that have crashed that were not started by

process scheduler (cmd line, two tier, third party schedulers)

PARALLEL PROCESSING:

Page 10: IQ 2011 BY GVR

Page | 10

Peoplesoft Interview Questions

Parallel processing is used when considerable amounts of data must be updated or processed within a limited amount of time, or batch window.

Achieved using Temporary tables only. How – partition the data between multiple concurrent runs of a program, each with its own dedicated version of a

temporary table.– Add logic select the distinct set of records from the bunch or create separate files to load.– Define and build required Instances of Temp Table before all above steps. To implement parallel processing, you need to complete a set of tasks in the order that they appear in the following list.

With each task you need to consider important details regarding your specific implementation.

– Application Designer. ( Define and save all of the temporary table records. You don't need to run the SQL Build process at this point.)

– AE Designer. (Assign temp tables to AE programs, and set the Instance Counts dedicated for each program. Assign each Temporary table to the AE program(s) using it, set the appropriate number of Instance Counts, and employ the %Table meta-SQL construct so that AE can resolve table references to the assigned temporary table instance dynamically at runtime.)

– PeopleTools Options. ( Set the global instance counts for online programs in PeopleTools Options. Set the number of temporary table instances on the PeopleTools Options page. )

– Application Designer. (Build all the temporary table records in Application Designer (SQL Build).)Note:

1. PS recommends that you insert the PROCESS_INSTANCE field as a key into the temporary tables you intend to use with AE. 2. Application Designer only creates a maximum of 99 temporary table instances.

SET processing: Set processing is a SQL technique used to process groups, or sets, of rows at one time rather than processing each row individually. Set processing allows us apply your business rule directly on the data (preferably while it resides in a temporary table) in the

database using an UPDATE or INSERT/SELECT statement. Most of the performance gain is because the processing processing occurs in the database as opposed to pulling the data

into the application program, processing it, and then inserting the results back into the database tables Since the data never leaves the database with set processing (whether or not it remains in the same table), you effectively eliminate

the network round trip and database API overhead required to pull the data into the application program and then insert the results back into the database..SET Processing Advantages of SET Processing

Improved Performance. Minimized (PeopleTools) SQL Overhead. Easy Maintenance. Leveraging the RDBMSIn this example, suppose the payroll department needs to give a $1000 salary increase to everybody whose department made

more than $50,000 profit. The following pseudocode enables you to compare the row-by-row and set-based approaches.

Row-by-Row:declare A cursor for select dept_id from department where profit > 50000;open A;fetch A into p_dept_id while sql_status == OKupdate personnel set salary = (salary+1000) where dept_id = p_dept_id;fetch A into p_dept_id;end while;close A;

Set-Based:

update personnel set salary = (salary + 1000)where exists (select ‘X’ from department where profit > 50000 and personnel.dept_id = department.dept_id)

The various methods in which a Set Processing could be achieved are: (Using Temporary tables)…. Two pass approach – run in two pass; that is first a set update updates all records, and the 2nd pass ‘corrects’ the exception rows alone, if they are only few to exceptions. Parallel processes – Using many instances of temporary table instances.

To release the deadlocks, you can use commitwork() and collectgarbage() after processing each set of data, (say count=10000 rows) in Application Engine peoplecode.

Page 11: IQ 2011 BY GVR

Page | 11

Peoplesoft Interview Questions

State records:The State Record is a PS record, keyed by process instance, Developer. You assign variables for your AE program through state records, while sections, steps, and actions pass values to subsequent program steps through state records.

Purpose: It defines the fields a program uses to pass values from one Action to another. These fields can be thought of as the working storage for your AE program. You can have up to 200 state records associated with a particular AE program. However, only one record can be the default state record. You can think of State Records in AEas global variables without scope limiting rules.Characteristics

It can be either a physical record or a work record. We can specify both work (derived) and physical (SQL table) records to be used as state records. The only difference is that derived State Records cannot have their values saved to the database at commit time, and so the values would be lost during a restart.

Any number of state records can be associated with a program. Physical state records must be keyed by process instance and is used for maintaining session. Its name always ends in _AET

To reference variables that exist within a state record: %BIND(fieldname)To reference a state record other than the default : %BIND(recordname.fieldname)Q) How can we change State Record during Run time %Bind(Recordname.fieldname)WORKING:

1. When a program starts, it INSERTS a row into the State Record that corresponds to the Process Instance assigned to that program run. AE updates the record whenever a COMMIT occurs. When Restart is enabled and a commit occurs, all State Records that have been updated in memory will be written to the database, except for derived State Records, which are instead initialized.

Page 12: IQ 2011 BY GVR

Page | 12

Peoplesoft Interview Questions

2. Then, after the program completes successfully, AEdeletes the corresponding row in the State Record. There is only one row in the State Record for each Process Instance, or program. Multiple programs can use the same State Record, and each program has it's own row based on the unique Process Instance key.

• To set values in the State Record, you use the %SELECT construct in a SQL statement or write PeopleCode that references the State Field with the standard "record.field" notation.--------- To reference fields in the State Record you use the %BIND construct.

During batch processing AE automatically performs all State Record UPDATEs. When a program starts, it INSERTS a row into the State Record that corresponds to the Process Instance assigned to that program run.

AE updates the record whenever a COMMIT occurs. When Restart is enabled and a commit occurs, all State Records that have been updated in memory will be written to the database, except for derived State Records, which are instead initialized.

Then, after the program completes successfully, AE deletes the corresponding row in the State Record. There is only one row in the State Record for each Process Instance, or program.

To set values in the State Record, you use the %SELECT construct in a SQL statement or write PeopleCode that references the State Field with the standard "record.field" notation. To reference fields in the State Record you use the %BIND construct.

%Bind Retrieves a field value from a state record in any Do or SQL action. To reference variables that exist within a state record, use the following: %BIND(fieldname) Unless a specific record name is specified preceding the fieldname, %BIND references the default state record.To reference a state record other than the default, use the following: %BIND(recordname.fieldname) • The AE function, %Bind is used to retrieve a field value from a State Record. The %Bind function can be used anywhere in a SQL statement.

The syntax for %BIND is: %BIND([recordname.]fieldname[,NOQUOTES][,NOWRAP][,STATIC])• NOQUOTES If the field specified is a character field, its value will automatically be enclosed in quotes unless you use the NOQUOTES option. • NOWRAP If the field is a date, the system automatically wraps its value in %datein() or %dateout(), unless you use the NOWRAP option. • STATIC The STATIC parameter allows you to include a "hard-coded" value in a reused statement. %Select or %SelectInit The %Select or %SelectInit meta-SQLs identify the state record fields to hold the values returned by the corresponding SELECT statement.With AE PeopleCode a state record data elements can be accessed using only a “Record.field” notation.%Select is used to insert values from the Records.The %SELECT function identifies the State Record fields to hold the values returned by the corresponding SELECT statement. The syntax for %SELECT is: %SELECT(statefield1[, statefield2]...[, statefieldN]) SELECT field1[, field2]...[, fieldN]

Consider the following sample example%SELECT(BUSINESS_UNIT,CUST_ID) SELECT BUSINESS_UNIT, CUST_ID FROM PS_CUST_DATA WHERE PROCESS_INSTANCE = %BIND(PROCESS_INSTANCE)

The following steps illustrate the execution of the previous statement:• The string %BIND(PROCESS_INSTANCE) is replaced with the value of the State Record field called PROCESS_INSTANCE.• Execute the following SQL SELECT statement. -----%Select, Update the State Record

%SELECT is used to pass values to the state record buffers. %BIND is used to retrieve a field value from a state record and can be used anywhere in a SQL statement. %SELECT(BUSINESS_UNIT,CUST_ID) SELECT BUSINESS_UNIT, CUST_ID FROM PS_CUST_DATA WHERE PROCESS_INSTANCE = %BIND(PROCESS_INSTANCE) State records that are common between the two programs “share" values. This means that if you need to communicate

between the two programs, you must define the same state records in both programs.

The %Table function returns the SQL table name for the record specified with recname. syntax: %Table(recname)For example %Table(ABSENCE_HIST) ------ It Returns the record PS_ABSENCE_HIST.

• You can use the %Table function when you want to be able to run the same AE program, in parallel, across different subsets of the data.

%AeProgram : Returns a quoted string containing the currently executing AE program name.%AeSection : Returns a quoted string containing the currently executing AE Section name%AeStep : Returns a quoted string containing the currently executing AE Step name.%ProcessInstance Returns the numeric (unquoted) Process Instance. %RunControl :Returns a quoted string containing the current Run Control identifier. The Run Control ID is available to your program, when using %RunControl, regardless of whether there's a row in the AEREQUEST table.META-SQL

%AeProgram %AeSection %AeStep %COALESCE %InsertSelect %RunControl %Bind %Bind([recordname.]fieldname [, NOQUOTES][, NOWRAP][, STATIC]) %Select/%SelectInit :%Select(statefield1[, statefield2]...[, statefieldN]) Select field1[, field2]...[, fieldN]• Meta constructs simplify building programs

– %InsertSelect, %List, %Bind, %Table and others• less coding . portable .less maintenance . enable features

• Functions in SQL help by performing an action or calling other functions

Page 13: IQ 2011 BY GVR

Page | 13

Peoplesoft Interview Questions

– %Clear Cursor, %Execute, %ExecuteEdits and othersDifferent sql statements and metasql statements.SQL statements:

• The SQl statements are used to fetch/retrieve, update, insert, delete data from the database. In PS we use the sql stmts using sqlexec or createsql. Different sql statements are: Select, Insert, Update, Delete.

Meta Sqls: • Different RDBMS have different date and time formats. Though the component processor takes care of the automatic conversion but at the

time of using the Sql Exec the automatic conversion does not take place. So in order to understand this Meta sql concept has come. Which we can use in diff sql stmts. for example %DATETIMEIN, %DATE, %TIME, %CURRENTDATETIME, %DATETIMEOUT etc.

• %DATEIN: This is used in the where caluse of "Select and update" %DATEOUT: This is used while selecting the data.• SQL Statements are Platform Dependent where as Meta-SQL statements are Platform Independent• %DateIn: Where dt is either a Date value or a date literal in YYYY-MM-DD format, expands into platform-specific SQL syntax for the date.

%DateIn should be used whenever a date literal or Date bind variable is used in a comparison in the WHERE clause of a SELECT or UPDATE statement, or when a Date value is passed in an INSERT statement

• %DateOut: Where dt is a date column, expands to a platform-specific SQL substring representing dt in the SELECT clause of an SQL query.• %Mode: Gives the correct user action Mode, like add/update…%Join: Expands the join dynamically while executing this Meta sql• %Execute edit: Enables People Soft Application Engine to support data dictionary edits in batch

(When a section gets called, its steps execute sequentially. Every program begins by executing the first step of the required section called MAIN and ends after the last step in the last section completes successfully.) There are “ 9” types of Actions that you can include within a STEP.

You cannot have more than one action of a specific type within the same step. Because there are eight types of actions, and two are mutually exclusive, the “maximum number of actions a single step can contain is 7 . ”

You cannot have a SQL action and a Call Section action within the same step.U can only define XSLT type actions for programs defined as Transformation types. There are 8 types of actions that you can specify to include within a step

Do Actions > Do When > Do While > Do Select > Do Until , (Program Flow Actions: control the execution of your program)DO-SELECT: The DO Select Action is a SELECT statement that executes subsequent Actions once for every row of data that the Do Select returns. For instance DO Select can execute 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. Types of do select are :Select/Fetch (default) Select/Fetch Performs a Fetch for each iteration of the loop to get each row from the SELECT. When a FETCH results in an "end of table", the looping is complete. (uses a cursor to fetch each iteration); this means we can’t restart this type of select statement and we cant perform a check point or a commit within this step. “””AE opens a cursor and performs a Fetch statement for each iteration of the loop to get each row from the Select statement. When a Fetch statement results in an end of table message, the looping is complete. Non-restartable, because AE does not perform a checkpoint or a commit within the step containing this action while Select/Fetch is running. “””Re-Select a new cursor and fetch is done for each row and the ‘first row’ returned is processed. These types of loops are restartable. Re-Select It opens a cursor and fetches the first row. This means that, with Re-Select, your program processes the "first row" returned from the Select statement. Cursor gets re-opened for each iteration of the loop. This type of Do-Select is restartable.“For each iteration of the loop, AE opens a cursor and fetches the first row from the Select statement.

Page 14: IQ 2011 BY GVR

Page | 14

Peoplesoft Interview Questions

The cursor is reopened for each iteration of the loop. There is no mechanism in place by which to exit this type of loop. “ Re-Startable is similar to select / fetch but restartable because AE performs check points in between. But upon restart AE doesn’t keeps tracks of stop points when restarted. Its upto the developer need to keep track of restart logic. (Like having a flag and updating it all along etc)User must make sure that the SQL you include within this action is such that, upon restart, the program recognizes where the previous run failed and where to restart processing. Restartable This option is similar to the Select/Fetch in that AE opens the cursor associated with the DO Select once, and then it performs a Fetch on each iteration of the loop to get each row from the SELECT. It can be Restarted .Do When: A DO When statement runs before any other actions in the Step. Your program executes a DO When Action only once when the owning Step executes. It is a Select statement that allows subsequent actions to be executed if any rows of data are returned.. If the DO When statement returns any rows, the next Action will be executed. If the Do When conditions are not met, the remaining Actions within that Step are not executed. This Action is similar to a COBOL " IF" statement. Do While : In other words, the 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.

Similar to above but the actions will be executed atleast once even if there are no rows are returned.And it will continue to execute the actions until

no rows are returned. If the Do While does not return any rows of data, the Action terminates. (Works like a loop with condition check at the end)

Select Statement that runs before subsequent Actions of the Step. The Do While is identical to the COBOL "WHILE" function. Do Until : It runs after each action when a step completes. If the Select returns any rows of data, the step terminates.

It stops when there are no rows of data. Use this step in case a processing action has to run again and again until a certain condition is true. Select Statement that runs after each Action when a Step completes.You can also use a Do Until action to stop a Do Select action prematurely. Use a Do Until if you want the "processing actions" to execute at least once , and to execute over and over until a certain condition is true, such as until a SELECT returns some rows. SQL: Do not control the flow of the program .following types of SQL statements can be included:UPDATE,DELETE,INSERT and SELECT.

PeopleCode PS AE PeopleCode provides an excellent way to build dynamic SQL, perform simple if/else edits, set defaults, messaging , File Layouts ,CIs and other operations all from within AE program that don’t require a trip to the database. It also enables you to reference and change active AE state records. LOG MESSAGE:Used to write a message to the Message Log based on a particular condition in your program. The system stores the message generically as a message set, message number, and parameter values. The Message Log refers to the PeopleTools table (PS_MESSAGE_LOG)where execution messages reside.You can use the Log Message action to

insert any type of messages you need. CALL SECTION: Used to call another section defined in an AE programYou can call a (local) section defined within your current program and you can make external calls to a section defined in another AE program. The external section you intend to call must have its access property set to Public. If a section's access property is set to Private, that section can be called only from within the same program. By default, a section's access property is Private. Configurable Properties (. Note: PS AEsupports up to 99 levels of nested Call Section actions.) Section Name If you are calling another Section, you need to specify the appropriate Section here. Only the names of Public Sections defined

in the program identified in Program ID will appear in the Section Name drop-down list.Program ID Since you can call Sections in the current program or Sections that exist within other programs, you need to specify the Program ID, or Program Name, of the program containing the Section you intend to call. The drop-down list contains all of the program definitions that

currently exist.— >>>>>>>>>>> XSLT : enabled for Transform Only program<<<<<<<<<<MESSAGE LOG: Use this type of Action to write a message to the Message Log.

The Message Log refers to the PeopleTools table PS_MESSAGE_LOG where execution messages reside. >>Configurable Properties<< Message Set Identifies a message set within the Message Catalog.--Number Identifies a particular message within a Message Set. Parameters A list of comma-delimited values to substitute for %1, %2, and so on markers in the message text.Q) SQL vs Call Section:• The main reason behind it is a deadlock. Once an SQL is run there is lock upon the table by database till that section is

completed, during that time there runs some other process which will use the same table locked by our section using call section. Automatically this process will fail.So,call section and sql are mutually exclusive.

• In brief SQL and Call sections are mutually exclusive because they may result in - Infinite loop, - Database conflicts, - Return of control is not synchronous.

**************** Depending on the ACTION type you select, the properties that appear change.*********************ReUse Statement Property: Selecting this means the database engine only needs to compile the SQL once, which reduces SQL overhead.

• The ReUse Statement property is available for all SQL action types (SQL, Do When, Do While, Do Until, Do Select) The ReUse Statement property to optimize the SQL in your batch program and increase performance. Converts any %BIND references to real bind variables (:1, :2, and so on). Enables the AE runtime process to compile the once, dedicate a cursor, and then re-execute it with new data as often as your

program requires. ReUse Statement converts any %BIND references to state record fields into real bind variables (:1, :2, and so on) , > Bulk Insert > No > Yes

A Bulk Insert can be used when an Insert SQL statement is called multiple times in the absence of intervening Commit statements.• PS AE ignores the Bulk Insert setting in the following situations:

The SQL is not an Insert statement & The SQL is other than an Insert/Values statement that inserts one row at a time. Bulk Insert. Holds all the data in a buffer and only performs an insert after a large volume of rows has gathered in the buffer.

– Used with statements like

Page 15: IQ 2011 BY GVR

Page | 15

Peoplesoft Interview Questions

INSERT INTO tablename (field1, field2...) VALUES (%BIND(ref1),%BIND(ref2)– Other than Insert, the Bulk Insert option is ignored. - This option turns on ReUse Statement.

Note: Do not use it if %BIND variables are building parts of the SQL statement Or are in the field list of a Select statement (this does not apply if you use the Static option in %BIND).

No . Select this option to disable ReUse. With ReUse off, the AE runtime process recompiles the SQL statement every time the loop executes. By default, ReUse will be disabled. Yes. Select this option to enable basic ReUse functionality.

When to use use ReUse : • ReUse is valid only for SQL actions. • Use ReUse only if you do not use bind variables for column names.• Use ReUse only if you have no %BIND variables in the Select list. •Each time the statement gets executed, then you can’t enable ReUse. • If the SQL is dynamic, as in you are using %BIND to resolve to a value other than a standard bind value, and the contents of the bind change No Rows property is available for SQL actions

• If the SQL (Insert, Update, or Delete) associated with the SQL action does not return any rows, you must specify what the AE program should do.

• For example, you could use this in a case where you insert into a temporary table, and then you intend to perform further operations on the inserted rows (provided that some rows meet the criteria). You could also prevent the program from performing set operations on the table when there won’t be any qualifying rows.

• Note: Using No Rows in conjunction with a Truncate Table operation is unreliable.• When you set the No Rows property, you choose from the following values:

Abort The program terminates. Section Break PS AE exits the current section immediately, and control returns to the calling step. Continue The program continues processing. Skip Step PS AEexits the current step immediately and moves on to the next step. AE ignores the commit for the

current step at runtime. If the current step contains only one action, use Skip Step only to bypass the commit.On Return (PEOPLECODE) When you specify the On Return property, you choose from the following values:

– It takes effect if your PeopleCode program issues a “return 1” or “exit 1.” – You can use the True keyword in place of a non-zero numeric return.

If your PeopleCode program provides a false result, you can have AE respond by doing one of the following: • Abort The program issues an error and exits immediately. • Break The program exits the current step and section, and control returns to the calling step. • Skip Step The program exits the current step, and continues processing at the next step in the section.

If this is the last step in the section, the calling step resumes control of the processing.Program ID Property--Each AE program has a Program ID --The default value is (current). ---For accessing external program Sections, select Program ID from the dropdown list. Section Name Property --Defined the Section to be called part of the Program ID.

– A call to MAIN section executes the entire program defined by the value in the Program ID field.“Dynamic Property” Enabled by selecting the Dynamic check box.

– Use the AE_APPLID and AE_SECTION fields in the state record to execute different sections depending on the conditions a program encounters during runtime. ----These two fields must be defined on the default state record for the program.

– When issuing a dynamic call, both the section and the program ID must be dynamically set. – You enable a dynamic call by first having your program store different section names in the AE_SECTION field, and different

program names in AE_APPLID field. – Selecting Dynamic automatically populates the AE_SECTION field with the symbolic value %Section , and the Program ID field with

the symbolic value %AEAPPLID . Specifying Log Message Actions______________** This type of action is used to write a message to the message log.The message log refers to the PeopleTools table (PS_MESSAGE_LOG) where execution messages reside,Any substitution parameters are written to PS_MESSAGE_LOGPARM.

– The following illustration shows a Log Message action:You can use the Log Message action to insert any type of messages. Typically, a Log Message action writes error messages to the message log, but you could also write informational or status messages.Message Set and Number: ---Select the message defined in the message catalog.Parameters ---This field should be a comma-delimited list of values to substitute for the message variables (%1,%2, and so on) in the message text. ---These parameters can be hard-coded values or %Bind references. Note: You can also use MessageBox PeopleCode to populate PS_MESSAGE_LOG instead of using the Log Message action.

USING RESTART:• By default, AE doesn't perform a COMMIT until an entire program successfully completes.• Each time that AE issues a Commit with Restart enabled, it records the current state of the program.

How Restart Works• The recording of the current state that AE performs is referred to as a checkpoint.• So, if a failure occurs at any point in the process, the end user can restart the program and expect the

program to behave in the following manner:

Page 16: IQ 2011 BY GVR

Page | 16

Peoplesoft Interview Questions

– Ignore the Steps that have already completed up to the last successful commit.– Begin processing at the next Step after the last successful commit.

• The ability for AE to "remember" what Steps have already completed and which Steps have not, is attributed to an important record called AERUNCONTROL—keyed by Process Instance.

Restartabilty: What ? In case of abnormal termination or failure at a step in the program, you can restart request from the last successful check point.When ? As a general rule, restart is essential for programs that do set-based processing.

– Program Level Make State record a SQL table. check both the PS AE Program Properties dialog box and PS Configuration Manager to make sure that Disable Restart check box is

not selected.– Section Level: Section Type ( Prepare Only & Critical Updates)– Step Level: Do Select Type – Restartable

How ? There are two ways to restart an AE program: From the command line, From a process request page.

Restarting from the Command Line (Only developers and system administrators use this option)

Steps: Collect the command line values associated with the failed program. Find these variables on the Process Details dialog box.Enter the command line syntax at the command prompt.

PSAE.EXE −CT DB_TYPE -CD DB_NAME -CO OPRID -CP PASSWORD -R RUN_CONTROL -AI PROGRAM_NAME -I PROCESS_INSTANCE

Restarting from the Process Request Page ( Only for those programs that run on the server)

Steps: Open PS Process Scheduler by selecting PeopleTools, Process Scheduler, System Process Requests.Locate the run control ID number of the program to restart. To display the details of the failed process, click the Process Detail link.On the Process Request Details page, select Restart Request, and click OK.Starting AE from Beginning when Restart Enabled

If you attempt to start a new process that matches the run control ID and user ID for another process, you receive a suspend error.Delete the Failed AE row from the AE run control table and state record.

Steps: ------ Run delete statement in your native SQL editor which would be of syntax bellow: – DELETE FROM PS_AERUNCONTROL WHERE OPRID=OPRID AND RUN_CNTL_ID=Run_Control_ID – Delete from your state record DELETE FROM PS_MY_AET WHERE PROCESS_INSTANCE=Process_Instance

Disable RestartFrom PeopleSoft AE Program Properties dialog box. (select File, Definition properties, and select the Advanced tab.)From Configuration Manager profile:

(Start Configuration Manager, select the Profile tab, and click Edit. Then select the Process Scheduler tab)Include the −DR Y option in the command line of PSAE.EXE.Note: If you’ve disabled restart in any of these three places, restart is disabled.

Q) If commit is not specified by the programmer in AE program then during the execution of AE the commit levels will be taken care by either PS or Database

Basing on above lines the PS AE is taking care of commit.

COMMITS IN AE• For new AE programs that you develop, by default, the commit values at the section and the step level are turned off. • No commits occur during the program run, except for the implicit commit that occurs after the successful completion

of the program.• How often you apply commits affects how your program performs in the event of a restart. • For set processing programs, commit early and often. • For row-based processing, commit after every N iterations of the main fetch loop that drives the process.

Page 17: IQ 2011 BY GVR

Page | 17

Peoplesoft Interview Questions

Commit Considerations– By default, the commit values at the section and the step level are turned off.– No commits occur during the program run, except for the implicit commit that occurs after the successful completion of the

program.– Helps in Restartability.– Commit early and often.

How ?– Divide your program into logical units of work by setting commit points within your program.– For row-based processing, commit after every N iterations– Steps like Do While, Do Until, or a Do Select action, you can set the frequency option.– Do Select action – In Do Select type with Select/Fetch, all commits inside the loop are ignored, including the commit frequency if it’s set.

(Overcome this by creating a SQL to keep track of records processed using a simple flag.)– At section Level use “Auto Commit” checkbox to commit after the section is complete.– At Step Level Commit After and Later settings used.

Note: The Commit After, Later setting at the step level enables you to override the section setting if you don’t want to commit after a particular step.

On Error The program only terminates on errors, not warnings. Abort: The application terminates with an error message.

Ignore: The program continues but logs an error message.Suppress: The program continues and presents no error message.SQL: Usually a program terminates if a SQL Prepare statement or execute fails.

PeopleCode: There is a PeopleCode error in the program if the return code satisfies the statement If (nRet & PCM_ERROR).Status Select to activate a step. On Error : Specify how PS AE should respond to an error at the step level.

Behaves the same for both SQL and PeopleCode actions. The program only terminates on errors, not warnings. The On Error property does not apply to compile errors.

Select from:• Abort: The application terminates with an error message.• Ignore: The program continues but logs an error message.• Suppress: The program continues and presents no error message.• SQL: Usually a program terminates if a SQL Prepare statement or execute fails. If you select Ignore or Suppress, errors on executing programs are suppressed, but errors on compiles still cause the program to terminate.

Thus, if you select to reuse on an Update statement, the program fails on the compile if the SQL is incorrect, but it does not fail on a duplicate key error or similar error when the program executes.• PeopleCode: There is a PeopleCode error in the program if the return code satisfies the statement If (nRet & PCM_ERROR).

Following are the ways in which you can RUN an AE Program in the PS.

AE Process Request Page (Which allows you to invoke the program through Process Scheduler with additional parameters).

– To run an AE program in two-tier mode: Select Edit, Run Program from the Application Designer toolbar. After creating or modifying your program, you can test it while in PS AD in two-tier mode. You use the Run Request dialog box:

Page 18: IQ 2011 BY GVR

Page | 18

Peoplesoft Interview Questions

To call a particular AE program from a page using PeopleCode, use the CallAppEngine function in SavePreChange or SavePostChange PeopleCode.

PeopleCode: Using CallAppEngine() CallAppEngine(applid [, statereclist ]) Synchronous process.

– Process Scheduler --By defining the AE Process Definition--asynchronous execution Select PeopleTools, Process Scheduler, Processes to access the Processes Definition page.– Command Line For Restarting, Development or testing, Debugging.

Using Notepad, type or paste a command into an editor and save the file with a type of Text Document and a .BAT extension PSAE.exe :Application execution component followed by the required parameters.

psae -CT dbtype -CS server -CD database_name -CO oprid -CP oprpswd ? -R run_control_id -AI program_id -I process_instance -DEBUG (Y|N)? -DR (Y|N) -TRACE tracevalue -DBFLAGS flagsvalue -TOOLSTRACESQL value ?- TOOLSTRACEPC value -OT outtype -OF outformat -FP filepath Or, if your command line options are stored in a text file, you can enter: psae optfilename

“Debugging AE Programs” You can set the Debug option in the following locations: • Launch the Configuration Manager and select the Process Scheduler tab. In the AE group, enable Debug by selecting the

Debug checkbox. This is the method applies to all methods of invocation.• If you used the command line option to invoke your AE program, then you can just include the —DEBUG Y parameter in

the command line you submit to PSAE.EXE. • If you have PeopleCode in your AE program, you'll want to turn the PeopleCode Debugger on, as well. When you launch

your program and the PeopleCode Action executes, you will enter the PeopleCode Debugger at that point. To enable the PeopleCode debugger for AE:– Sign on to PeopleTools using the same user ID that you are going to use to invoke the AE program.– Open PeopleSoft Application Designer.---Select Debug, PeopleCode Debugger Mode.

Your AE program can be open on the desktop, but you do not need to open the AE program or the PeopleCode action that you want to debug.

– Select Debug, Break at Start.– This causes the AE program to break prior to executing any PeopleCode programs within it.

DEBUG through command line : ---- Execute the AE program that you wish to debug. At the AE Debugger prompt, enter the appropriate command that enables the desired debugging option.

AE Debugger - enter command or type ? for help. AETESTPROG.MAIN.STATS> ? Debug Commands: (Q)uit Rollback work and end program E(X)it Commit work and end program (valid between steps) (C)ommit Commit work (valid between steps) (B)reak Set or remove a break point (L)ook Examine state record fields (M)odify Change a state record field (W)atch Set or remove a watch field

(S)tep over Execute current step or action and stop Step (I)nto Go inside current step or called section and stop Step (O)ut of Execute rest of step or called section and stop (G)o Resume execution (R)un to commit Resume execution and stop after next commit

TRACING

TRACE FILES OF AE: Trace file is a document which helps us understand the internal logic and flow of the AE program.

• -Trace is used to monitor the performance of AE (By default, all AE traces are turned off)– AE step trace. AE SQL trace. AE statement timings trace. Database optimizer trace.• Ideally, with batch programs, you want the program to process as many rows of data in the least amount

of time.• AE tracing functionality to monitor the execution of your Steps, your SQL, the Timings (for PeopleCode and

SQL), and how the optimizer for you database is handling your SQL constructs within your program.We can setup the trace file options at Four places PeopleTools option, Configuration Manager, Command Line, Setting Parameters in Server Configuration Files.

Enabling AE Tracing

Enabling Trace at PeopleTools option Navigation : PeopleTools->Process Scheduler->Processes->Override Options

Page 19: IQ 2011 BY GVR

Page | 19

Peoplesoft Interview Questions

Configuration Manager (Only if you are running AE programs on a Microsoft Windows workstation)– Launch the Configuration Manager, and select the Trace tab to choose the Trace.– Look for a group of checkboxes called AE Trace. This group box contains the traces that are unique to AE.– Select the trace options that apply to your current situation.– After you have selected the appropriate options, remember to press either the Apply or OK button to set

your trace options. Set command line options. Available from Unix and NT, Not available from PeopleCode, Specify –TRACE option in command line.Set parameters in server configuration files.

To enable in the configuration files for both the AS and the PS Process, ----Only for AEs in Batch Mode For programs invoked by PeopleCode and run on the AS, set the TraceAE parameter in the Trace section of the AS

configuration file (PSAPPSRV.CFG). You can use PSADMIN to set this parameter. In the PS 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.TYPES OF TRACES: Step Trace

• The step trace reports each step name that your program executes and in what order. Associated with each step is a timestamp, the Do action level, and the action type.

SQL Trace• The SQL trace report shows formatted SQL processes, including commits, rollbacks, and restarts.

Statement Timings Trace• The AE statement timing trace report is similar to a COBOL timings trace, in which you monitor the

execution of COBOL programs for performance evaluations• This trace enables you to gather performance information to determine program bottlenecks.

The statement timings trace populates the following tables• PS_BAT_TIMINGS_LOG (Parent) This table stores general information for a program run.• PS_BAT_TIMINGS_DTL (Child) This table stores details associated with a program run, such as the execute count, fetch time, and so on.• PS_BAT_TIMINGS_FN This table stores PeopleCode detail timings information.

Database Optimizer Trace The database optimizer trace reveals the execution or query plan for the SQL that your AE program generates.

Where do you set Peoplecode trace?Peoplcode trace can mean setting peoplecode trace for record peoplecode or for AE (On Execute).For getting the trace for peoplecode(record level), need to go to options and select various levels of trace by checking what level u want( Stack, every instruction, list the program, etc) and select the destination file to which the generated trace needs to be copied into.Configuration manager allows debug for app engine where u can select levels of trace needed, that is only SQL, Connect, Disconnect, Peoplecode etc. The former two mentioned here are two tier tricks for setting the trace ( App Designer level)We can still generate trace when on three-tier( Internet).For this we need to select the peoplecode check box in the beginning from people tools option.We can also do this for AE at peopletools-process scheduler- processes (select the AE name), options tab-choose append- write - value TRACETo launch an AE program from another App Engine program, which one of the following is correct? CALLSECTION Action What category of commands can be executed in data mover? Access s groups Tree Manager

Debug, Test and Run• Useful tools for debugging and testing

– Process monitor to view results– AE Trace for Statements, SQL, timing, and PeopleCode (Session nnn)– Command line interactive debugger -PeopleCode interactive debugger

• Many ways to run an App Engine program– Command line -Through process scheduler -Third party process scheduler – CallAppEngine API

Page 20: IQ 2011 BY GVR

Page | 20

Peoplesoft Interview Questions

File Layout File object allows you to perform file operations. Using the combination of file object with AE, file layout object provides a effective way to exchange data between PS and Legacy systems.

Lay Out is a definition of a file to be processed.1. Insert a record by using App Designer à Insert à Record menu option (or a drag drop). Insert all the records (parent, child

etc).

2. Using the icons determine parent / child relationship.

3. In file à definition properties, set the file type (Fixed, CSV or XML) delimiters etc.

4. To set the file layout properties of each record and fields click on each of them. Important of them are length, start position, delimiter etc.

5. Click on icon ‘AE’ to generate the code.

What is SQC? SQRSQC’s are nothing but a library files, and represents any valid SQR commands. (In real time 70% of the SQC’s represents Procedures/Local Procedures). Whenever the same business logic is used in different programs we use the logic in as procedure and attach it to a SQC file and we include this SQC in diff SQRS wherever it is required. What is setenv.sqc? what are the procedures in Setenv.SQC? SETENV.SQC (Sets Environment for Country, Printer-Paper, Language, Date, Platform specific parameters.) It includes 3 SQCs : rdbms.sqc -opsys.sqc -setfile.sQc It defines country, paper size, language, and global date and report environment. It defines file prefixes, file suffix, return status and printer base on the OS mentioned on OPSYS.sqc Defines date and time formats based on database mentioned on rdbms.sqc How many nested levels of #includes does SQR supports? SQR supports 4 nested levels. Write about STDAPI.SQC? STDAPI.SQC includes 2 procedures and 4 sqcs. Procedures are : STDAPI-INIT STDAPI-TERM SQC’S are : STDVAR.SQC ,PRCSDEF.SQC ,PRCSAPI.SQC ,EOJ.SQC

STDAPI-INIT It includes 3 procedures Define-Standard-Vars -- (from stdvar.sqc) used to update the status of the process scheduler

Page 21: IQ 2011 BY GVR

Page | 21

Peoplesoft Interview Questions

Define-Prcs-Vars -- (from prcsdef.sqc) used to declare Process Request variable Get-Run-Control-Parms (from prcsapi.sqc) used to Update Process API STDAPI-TERM --It includes 1 procedure ; Successful-EOJ (from eoj.sqc) Used to Update process scheduler status BNRUNCTL.SQC It retrieves the run control parameters from RUN_CNTL_BEN table, which are required for Benefits Reports. RUN_CNTL_BEN table is used for Batch processing purpose. OPRID, RUN_CNTL_ID are the key fields. PrcsDef : Procedure to define the Process Scheduler variables. DESCRIPTION: It can be used in other SQRs by performing a "do Define-Prcs-Vars"PrcsAPI : Procedure to update the Process Scheduler request record and get the run control parameters. DESCRIPTION : It can be used in other SQRs by performing a "do Get-Run-Control-arms" , "do Update-Prcs-Run-Status" (We need to indicate that we're in Update-Prcs-Run-Status because if there is an error that goes to SQL-Error (sqlerr.sqc), that will try to call back here. If the error came from here, though it would be an infinite loop in all likelihood. So, we set the indication to prevent the call back here.)SQLERR : (SQL Error Handling Procedure) This procedure is typicallly called via the ON-ERROR condition of BEGIN-SQL and BEGIN-SELECT.

"do Update-Process-Status" "do Get-PrcsRqst-Info" "Get-Job-Instance" “do Get-Last-Message-Seq” “do Process-Message-Log” “do Check-Message-Parms” “do Parse-Message-Parms” “do Insert-Message-Log” “do Insert-Message-Log-Parm” “do Set-Client-Info” “do MS-Set-Client-Info”

SETENV : #include 'rdbms.sqc'--- (Database Environment) #define ORACLE #include 'opsys.sqc'----(Operating System Environment) #define AXP #define MVS #define NT #define OS400 #define UNIX #define VAX #define VMS !BasePeopleTools Version !Country !Printer !Process Schedulder OUTDESTTYPE (ODT) !Process Schedulder OUTDESTFORMAT (ODF) ! Print Specific Language !Paper Size !Language ! File prefixes and suffix

#ifdef NT #define FILEPREFIX C:\TEMP\ #define FILESUFFIX #end-if #ifdef MVS #define FILEPREFIX #define FILESUFFIX #define EBCDIC #end-if !Return Status #define GOOD-OS-STATUS 0 !Global Date Defines #define DEFMDY 'MDY' #define DEFDMY 'DMY' #define DEFYMD 'YMD' #define DEFDATE 'DATE' #define DEFCMP 'CMP' #define DEFROM 'ROM' #define DEFKAN 'KAN'

! PTRPTYear - Used in determining what format to display the year in.(This does not affect the format used to talk to DB)! Meta SQL (For Use in SQL Statements Only) ! Standard INFORMIX parameters ! Meta SQL (For Use in SQL Statements Only)

! #define PTConCat || #define PTTRUNCATE DELETE FROM #define PTSubStr substr ! Standard MICROSOFT parameters ! Meta SQL (For Use in SQL Statements Only) ! #define PTConCat + #define PTTRUNCATE TRUNCATE TABLE #define PTSubStr substring ! Standard ORACLE parameters ! Meta SQL (For Use in SQL Statements Only) ! #define PTConCat || #define PTTRUNCATE TRUNCATE TABLE #define PTSubStr substr

STDAPI : (Process Scheduler Interface) DESCRIPTION: It can be used in other SQRs by performing a

"do STDAPI-INIT" "do STDAPI-TERM" #Include 'stdvar.sqc' !Updates process scheduler status STDAPI: Standard Variables begin-procedure Define-Standard-Vars let $Payroll_NID_Type = 'PR' end-procedure #Include 'prcsdef.sqc' !Update Process Request variable declare #Include 'prcsapi.sqc' !Update Process API #Include 'eoj.sqc' !Updates process scheduler statusEOJ : Perform end of job processing if successful status #include "tranctrl.sqc" DESCRIPTION: It can be used in other SQRs by performing a "do Successful-EOJ"TRANCTRL : Common Transaction Control Procedures DESCRIPTION : The purpose of this SQC is to support COMMIT, ROLLBACK, etc., across platforms. For example, it can be used in other SQRs by performing a "do Commit-Transaction" rather than a "commit".

There are 5 main sections in SQR are as follows: Begin-heading, Begin-footing, Begin-setup, Begin-program, Begin-procedureThere are 3 main paragraphs in SQR are as follows: Begin-SQL, Begin-document, Begin-selectHow to create multiple reports from one SQR report?In Multiple report SQR Program, the commands for declaring more than one report, we must write the commands at the setup section. The commands must be coded in the setup section for different layouts for different procedures like as followsBegin-setup Declare-layout layout1 Left-margin=0.5 End-declare End-setupIn this way we can define multiple layouts for multiple reports. To use the layouts for different reports, we must declare the different reports in setup section like Declare-report Report1 Layout=layout1 End-declare

Page 22: IQ 2011 BY GVR

Page | 22

Peoplesoft Interview Questions

Now, for heading and footing part also we must specify the heading and footing for different reports in single SQR program.Begin-heading 4 for-reports=(Report1) Print ‘Emplid’ (1,1) End-headingAnd in procedure part if u want print the data on particular report then before printing we must use the “USE REPORT ReportName” command.In this way we can work with the multiple reports in SQR……..What is Use-report command?The Use-Report command is used while working with the multiple reports in SQR. To display the data from the database we must specify the report on which you want to print the data. Use-Report=ReportName can be used.What is For-reports=(ReportName) command? This command is also used at the time of multiple reports. While printing the heading to the different reports we must specify the report name to which you want to specify the headings

What is on-break command in SQR and how it works?The on-break command in SQR is nothing but the grouping of records being displayed. The SQR skips the field on which the on-break command is used while displaying the output in the report. While displaying the records the SQR groups the records and prints the on-break field once and whenever there will be change in the on-break field SQR prints the new data of the field on the report. Syntax of On-break commandON-BREAK [PRINT= {ALWAYS|CHANGE|CHANGE/TOP-PAGE|NEVER}][SKIPLINES= {num_lit|_var|_col}][PROCEDURE=procedure_name[(arg1[ ,argi]...)]] [AFTER=procedure_name[(arg1[ ,argi]...)]] [BEFORE=procedure_name[(arg1[ ,argi]...)]][SAVE=txt_var] [LEVEL=nn] [SET=nn]

Explain the different commands in SQR. The commands available at the on-break commandPrint=change/top-page: Prints the on-break field data on every page top if the entire page is having the same on-break field. This is useful to identify the records are for which group fieldPrint=always: This command will always the on-break field data for each recordPrint=never: This command will not print the on-break field data.Skiplines=number: This command is useful for skipping the lines between the two rows.Before=procedure name: This command is useful in displaying the headings for the columns. Works as Report HeaderAfter=procedure name: This command is useful in displaying the totals of the records at the report footer. Works as report footer.Save: This command is useful to save the current on-break field data to a variable, which can be used at the group footer.Level: The level command is useful with the on-break command to set the hierarchy of the fields of table if multiple on-breaks are used.What is the usage of Save Parameter in on-break?The Save parameter can be used only with the on-break command. The save parameter saves the current fields data on which the on-break command is used. Whenever the change in on-break field will happen we can use the variable to display the value at the group footer. The syntax of Save Parameter with the on-break command is as follows: Syntax: Emplid on-break save=$emplidBefore and After are the procedures which are available with the on-break command. The Before procedures are use for printing the headings while working with the master details reports. The After procedure is mostly used for totaling the no of records for the particular group. The Before is called as the Report Header and the After is called as Report Footer.If we want to do some insertion, updation, deletion we must use the begin-SQL Paragraph. The begin-SQL Paragraph is used only for the data manipulation the select is not valid in begin-SQL paragraph.

The Begin-Report and End-Report is same of Begin-Program and End-Program. In Old version begin-program and end-program was the begin-report and end-report What is Report Manager? Report manager can be used to see the reports in the report repository. What is report repository? Once the process scheduler finishes processing it will post the out put files to Report repository.How do you debug an SQR program?.By putting Display and Show statements in the program and then check the out put file or use debug statement. What output extension does the SQR will have if you run it from a client ?.It can be .spf or .lis based on the SQR flag set.What kind of out put you can get when you run from web (3-tier) ?.It can be PDF, HTML, e-mail , LIS etc.. Which types of command line flags are useful for creating the .SPF files? -ZIV, -KEEP, -NOLIST. What are the uses of SQR portable files(spf)? We can create the printer independent output files, so that we can view, e-mail, fax and print these files by using the SQR Viewer. And we can also convert back to the .LIS files by using the SQR printer. What is the difference between .LIS and .SPF files? Lis files are printer specific output report files. .spf we can create printer independent output files. .lis files are not convinient for viewing the file before printing or to email. .spf files can be viewed and printed by the SQR viewer and also can be emailed. By default where SQR creates an output file? By default SQR creates an output file with the same name of the program in the same directory. Can we change the directory of the output file? Yes. We can also change the output to any other directory using the report flags.

What is the default extension to the regular SQR report output files? .lis What is the default SQR format type? .pdf What is the default extension to the SQR portable files? spf or .Snn (for multiple reports) Ask and Input Command.

Page 23: IQ 2011 BY GVR

Page | 23

Peoplesoft Interview Questions

The ASK command can be use in the setup section only. The ASK command will be executed at the compilation time only. The input command can be written at any procedure not in setup section. Input is executed at the time of execution only. In input command we can restrict the user by specifying the maxlength for the input. Format for the date input can be specified. MOVE command in SQR? The move command is the most useful command in SQR. This command is useful converting one data type to another data type. At the time of moving from source data type to destination data type we can use the edit command. The Syntax of MOVE command is MOVE $basic to #basic. While date and numeric variables are incompatible.An array is a unit of storage that consists of rows and columns and exists in memory. An array is similar to a database table, but it exists only in memory. SQR arrays are also advantageous in programs that produce charts. With the data for the chart already in the array, presenting this cross-tab as a bar chart is easy. LET, GET and PUT command in SQR?LET Command: The LET command in SQR is useful for assigning any value to particular variables in SQR. This command is useful for doing the calculation with the value of variables. The syntax of LET command is as follows.LET #Basic = #basic + 1000 or LET #Basic = 1000

GET Command: The Get command is mostly used with the arrays. The Get command useful in arrays while retrieving the values of array elements one by one row.The syntax of get command is as follows. Get $name $startdate #salary from emps (#i)PUT Command: The put command is useful for inserting the data into array. The syntax of PUT command is as follows. PUT $name #count $date1 into names (#j)

How do you open/Read and write file in SQR? The Open, read and write using file handling uses commands at the time of importing or exporting data from the database.Open/Read Command: The Read Command is used to read the contents of the file Row by row. The Read commands reads the file contents of the file, which is located at the file server of the systemSyntax: Open ‘C:\Temp\EmpDetails.txt’ as 1 for-reading record=100:vary status=#statThe open command is always is used for reading the file.Write Command: The write command of file handling is used for writing the data into file. By reading the data from the database, records can be write to a file by using the write command.Syntax: Open ‘C:\Temp\EmpDetails.txt’ as 1 for-writing record=100:vary status=#statFor reading and writing we have to use the open command. While opening the file for-writing the file will be created by the SQR on the file server. After that data can be written to the file.What is On-Error in SQR and where it can be used?The on-error is available with the begin-select paragraph. The on-error is mostly used for error handling in SQR. The syntax for on-error is used as follows. Begin-Select on-error=procedurenameIn Begin Select we can specify that on-error is equal to procedure name. The procedure should be define in the SQR. Whenever the error occurred the control will go to the procedure and will print the details of error by using the SQR reserved variable ex. $SQL-error. The on-error can be used with begin-select and begin-SQL paragraphs. While using with begin-SQL we must use as on-error=skip. If we are using on-error=skip it must be used in begin-setup only. Its invalid in other sections.What is next listing, no advance, need command in SQR?These commands are mostly used for the particular column in the begin-select paragraph. These commands are mostly at the time of printing the addresses in SQR Report. These commands means whenever the page space is not sufficient to print the remaining lines of the address then next-listing command will be used. To check this that how many no of lines is required to print the address generally that we can specify by using the command need.How many ways we can define the substitution variables? We can define in 2 ways. #Define Ask advantage : We can define these variables only once and but we can use them in more than one place in the program. Can we change the values of the substitution variables during the program execution? No The values of substitution variables are set during compilation stage and checked for errors before execution begins. At what time SQR substitution variables values are assigned? Substitution variables are compile-time variables. The values of the substitution variables are assigned during the compile stage and it will check syntax errors before the execution stage.

What is dynamic query variables?Give example? When you use variables in a SQL statement in SQR to replace literals and more, you make them dynamic variables by enclosing them in square brackets. For example, when you use the dynamic variable [$my_order] in the ORDER BY clause of the SELECT statement, SQR places the text from the variable $my_order in that statement. Each time the statement is executed, if the text changes, a new statement is compiled and executed. What is the dynamic variable? What is the use? Dynamic query variables are also called Dynamic SQL Variables. These are run-time variables. Dynamic query variables are useful to build the dynamic SQL code

What is a Document marker? Document marker is also a special type of variable. What is the advantage with Document markers? We can mix the static text with the database values. What are the commands mainly we are using with the Letters? 1. Begin-Document 2. .b 3. New-Page. 4. Document Markers.

Page 24: IQ 2011 BY GVR

Page | 24

Peoplesoft Interview Questions

What is the use of the Document paragraph? We can create the Letters. Can we put multiple Documents in a single program? Yes. What is the purpose of the .b command? Using the .b command we can get the blank space. What is document markers paragraph? Document markers are used to place the value of variable or columns into a document. These can be referenced in the position command out side the document paragraph to establish the next printing position. These are prefix with @ symbol.

Types of PRINT commands? Function Puts data on the page at a specified position. PRINT { any_lit | _var | _col } position

position means: BOLD causes the string or number to be printed in bold type. EXP:print &name (+1, 20) bold

BOX Draws a one-line deep graphical box around the printed data. EXP print &grand_total (+5, 20) box

CENTER Centers the field on a line. EXP :print ’Quarterly Sales’ (1) center

EDIT edit_format EDIT causes each field to be edited before it is printed.EXP print #total (7,55,0) edit $999,999.99 ! $ 12,345.67

ON-BREAK What is On-Break and what is its purpose? On-break is the special processing performed when the value of a column is changed. On-Break is used for removing redundancy from the reports, sometimes we may need to skip lines when the value of the column is changed, and Avoid printing redundant data, print a value only if changed, Add white space to your reports, Perform conditional processing on variables that change, execute a special procedure before or after the break, Print subtotals, etc. We can do all these by using the SQR break handling commands. What is the purpose of the On-break Qualifiers? What is the default qualifier? Qualifiers define specific actions to be taken when the break occurs. Print is the default qualifier for the On-break. It can be used for both explicit and implicit printing. Always: The break field will be printed for each detail group. Change: The break field will be printed only when its value is changed. This is the default option. Change/Top-Page: The break field will be printed when its value is changed plus at the top of each new page. Never: The break field will not be printed. What should we do when we want to apply On-break more than one field? We should use the level qualifier. When we have multiple breaks, we must arrange them in a hierarchy. This sort of arrangement is called nesting, and the breaks can be considered nested. Can we Use On-Break in a Process? No, We cannot use On-Break in Process. It is only used for reports. What is save qualifier? Save qualifier is use to save the previous break value in string variable and to print the old values. What is SKIP LINE command? It is used with On-Break command to denote how many lines the printer has to skip before printing the next line. How before and after procedures are executed? The before qualifier will automatically calls specified procedure before the column values are changed. including the process of the 1st row selected(before qualifiers are invoked in ascending level order)after qualifier will automatically call the specified procedure after the column is changed. including the last change i.e. when select is completed (after qualifiers are invoked in descending order) What is the difference between Break and On-Break? Break is used for exiting from a loop Ex: Evaluate. On-break is the special processing performed when the value of a column is changed.

What is an Array? --An array is a collection of similar group of fields. --An SQR array is a memory structure that consists of rows and fields. ---An SQR array is a buffer that is useful to store the data temporarily. At what time arrays are created? In SQR, arrays are created during the compile time, before the program is executed. Can we create arrays in any section? We can create arrays in any section of the program. But it is better to create the arrays in the setup section. What are the valid commands in SQR array? The following commands are valid with SQR arrays: Create-Array ,Clear-Array ,Get ,Put ,Let ,Array-Add ,Array-Subtract ,Array-Multiply ,Array-Divide What is the use of the Create-Array command? used to create an array. Create-Array Name=name of the Array Size=Size of the Array {FIELD = name:type [ :occurs ] [ = { init_value }]

Can we use the substitution variables as the size parameters? Yes. And it is better way to use the substitution variables as the size parameters, So that we can easily change the size of the array if the array is full. What happened if we enter values more than the maximum array size? If we enter the values more than the maximum array size then SQR aborts the program execution and displays the error message. What is a multiple-occurrence field? An array also supports the multiple-occurrence fields. Means for one field we can specify the number of occurrences. In the above example Emp_Phone is the multiple-occurrence fields. What is the starting no of an array row? In array the rows starts from zero.

Page 25: IQ 2011 BY GVR

Page | 25

Peoplesoft Interview Questions

What is the starting no of multiple occurrence field in array? For multiple-occurrence fields, the field occurrence number starting from occurrence number zero. How can we initialize the arrays? By using the Clear-Array command. When an array is created all its field values are automatically initialized based on the default values. The Create-Array command just allocates and initializes memory for an array. For reinitializing the array we can use Clear-Array. What happened if we not specify initial value? If no initialized value specified for a field, the default value will assign to that field. What types of commands are useful to place the data into arrays? Using the LET and PUT commands we can place the data into the arrays. Placing the data into arrays using the LET command: Let Emp_Details.emp_id(10) = ‘100’ The string literal 100 is moved into field emp_id of the 11th row of the Emp_Details array. Let Emp_Details.emp_id(#Row_Num) = 100 (#Row_Num) stores the row number that can be changed by the program. The string literal 100 is moved into field emp_id of the (#Row_Num) row of the Emp_Details array. Placing the data into arrays using the PUT command: Put ‘100’ into Emp_Details(10) The string literal 100 is moved into the first field of the 11th row of the Emp_Details array. If no field What types of commands are useful to retrieve the data from arrays? Using the LET and GET commands we can retrieve the data from arrays. Retrieving the data from arrays using the LET command: Let $Emp_Id = Emp_Detail.Emp_Id(10) Let $Phone= Emp_Detail.Phone(#I, #j) Retrieving the data from arrays using the GET command: Using the GET command we can retrieve all the array’s fields at a time. Get $Emp_Id From Emp_Detail(10) What are the arithmetic operations of an array? Array-Add ,Array-Divide ,Array-Multiply ,Array-Subtract

What is load-lookup and lookup command? Load lookup creates an internal memory array and populates this array with keys and column values in specified table. It will retrieve two fields key field and return value field. key field can be string or numeric but it must refer to a unique column value. Return value field refers to just on table column or a combination of several table columns. Lookup: Used to search through the internal memory arrays created and populated by load-lookup What is the difference between load- lookup and array? Load-lookup Creates internal memory array retrieving information from multiple tables. An Array is a collection of similar groups of fields in the program memory. Arithmetic operations can be performed by using Arrays, which is not possible using load lookup.

How do you write sub queries in SQR? The select statement can be nested with in one query. What is the use of the MOVE Command? It moves the data from on field to another field and it can also perform data conversions and data editing using special edit masks. it can handle data of any format except date to numeric vice versa. What is Let command? A single Let command is capable of replacing a no of data manipulations and logic commands What is the syntax of the LET Command? LET target_variable = expression Expression can be combination of operands, operators, and functions. Operands in the expression can be SQR columns, literals, or array fields. Operators in the expression can be arithmetic, string or relational. What is the difference between Move and Let command? Move command is used for data conversions where as let command used for data conversations as well as logical expressions and calculations. What are different techniques for creating flat file output? 1. Write command ----2. Print and new page command. How we read a flat file and store it in database table? 1. We will Read records from the input files -- 2. Edit inputs fields using SQR function table lookup function and queries. 3. Built logic to insert data into different tables based on the specified criteria -- 4. Check for duplicates. ---5. Print and audit reports. How do we open, close a file? Opening a file: Open my_file as 1 for reading record = 80 :vary Closing a file: close 1 Here The number 1 next to the file name in the open command is the file number (file handle) 80 is the record length. Vary: By using this all records in the file must be terminated by a line terminator. Files with type=vary should not contain binary data. How do you read data and upload data back?

Page 26: IQ 2011 BY GVR

Page | 26

Peoplesoft Interview Questions

Open ‘c: \windows\desktop\1.SQR’ as 1 for-reading record=80: vary(for reading) Open ‘c: \windows\desktop\1.SQR’ as 1 for-writing record=80: fixed (for upload) What is the purpose of the Open command? To open a particular file in read mode or write mode or append mode. Open ‘c: \windows\desktop\1.SQR’ as 1 for-reading record=80: vary Open ‘c: \windows\desktop\1.SQR’ as 1 for-writing record=80: fixed Open ‘c: \windows\desktop\1.SQR’ as 1 for-append record=80: vary We should specify the fully qualified path means Drive name, directory name and file name. If we not specify directory name it takes the default directory that is current directory. 1 is to reference the file in the program. We can choose any one number instead of 1. Why because we are using these file with other commands like input/output and read/write. What is the purpose of the close command? It is used to close an opened file. The file is stay opened until the close command is used. What is the purpose of the Read command? The Read command reads the records from the file into the variable. How can we detect end of file? By using the #end-file command. At end of file it returns 1. What is the purpose of the Write command? The Write command writes a record to a file from the variable. Which report is useful when we want to print each row of information in a new page? Form Reports. Which command is essential for making Form Reports? New-Page. What is the record length in open command? When a file is opened for reading the record length specified in the open command must be equal to or greater than the length of the longest record used in the file. The maximum record length is 32k-1 bytes 32767. What is for-append mode? For-append mode is for creating new file otherwise if the same file is opened and for-append is not mentioned, the existing file is over written. What are the requirements we should to enter for executing a SQR program from command line? The name of the SQR engine (SQRW in windows, SQR in UNIX) Program name Data base connectivity string SQR command line flags Application specific arguments. If we want to run any program we should specify C:\>SQRW <PROGRAM_NAME> <DATABASE_NAME>/<PASSWORD> <OUTPUT_DIRECTORY>

C:\>SQRW SAMPLE.SQR HRMS/PS FC: \TEMP If we want to pass any run time values we should specify C:\>SQRW <PROGRAM_NAME> <DATABASE_NAME>/<PASSWORD> <OUTPUT_DIRECTORY> <values>

C:\>SQRW SAMPLE.SQR HRMS/PS FC: \TEMP ‘100’ How SQR program executes? First the body executes next heading and footing. How you run SQR program through online page? Through process scheduler. How do we run the sqr through peoplecode? This is the code to run the sqr thru PeopleCode. &RQST = CreateProcessRequest(); &RQST.ProcessType = "SQR Report"; &RQST.ProcessName = "HAPDT009"; &RQST.RunControlID = "1"; &RQST.RunLocation = "PSUNX"; &RQST.OutDestType = "File"; &RQST.OutDestFormat = "PDF"; &RQST.RunDateTime = %Datetime; &RQST.TimeZone = %ServerTimeZone; &RQST.Schedule(); &PRCSSTATUS = &RQST.Status;

What is API aware? An API aware process updates the process request (PSPRCSRQST) table with the process run status. Why we have to make SQR program API aware? To allow the process monitor to reflect our program status. How can we make the program to support APIAWARE? We should include STDAPI.SQC. This SQC contains STDAPI-INIT and STDAPI-TERM procedures. How can we create the Run Control Records? Go to Application Designer, open a new record. --Insert OPRID, RUNCNTLID fields. And include other fields, which are required. Save the record and build it. ---Open a new page. ---Insert sub page (PRCSRUNCNTL_SBP). ---Include all other fields, which are required. Save the page. --Then create the component, menu and then register the component. Schedule the process using the process scheduler manager. Then authorize the user to run the programs using the process group.

How do you attach SQR program to Process Scheduler? Steps to schedule the SQR program Go PeopleTools, Process Scheduler, Process. Click on Add a new value. Then it asks the process type and process name. Enter the Process type as SQR report and process name as our program name. click ok. Then it displays Process & definition tab. --Specify all the options in all the tabs, which are required. Then save. Go to our component and enter the values then click on RUN. Then it displays the Process Scheduler Request page. Specify all actions and click ok.Go to the Process Monitor and see the status of the program.

Page 27: IQ 2011 BY GVR

Page | 27

Peoplesoft Interview Questions

What are the most important values we have to give while connecting sqr to process scheduler? Run control id, oper id What is the use of the Process Monitor? Using the Process Monitor we can see the status of the program, when it is APIAWARE. (Success, Posted, Processing) How we attach SQR program to process schedular? For every job that runs under the peoplesoft process scheduler needs a process definition to specify the process attributes and link the process to the appropriate component. In process definition we will give the process name, which is nothing but the SQR program name

Can we create temporary table in SQR if so when we use them?Yes we can create temporary tables in SQR. it is used to increase the performance of SQR program. How can we provide security for SQR? Adding code to the program which checks for the prcsoprid variable. Include hrsecty.sqc program Call the security param procedure to select and build the security clause Add a security search record to your main select to restrict access to non authorised data. How can we prevent running SQR from running outside the process scheduler? There is a simple solution for stopping SQR execution from outside the process scheduler, we have to add a code that checks for $prcs_oprid variable, which is populated by the API code (in the get-run-control-parms procedure) only if the report was initiated from the process scheduler. If the value of $prcs_oprid is null, SQR displays an error message and exits the program. How do you implement row level security in SQR? For this we have to add security-param procedure, this procedure is located in hrsecty.sqc How SQR detects that it has been running from outside the process scheduler? The get-run-control-parm procedure in PRCSAPI.SQC detects whether process is calling from process scheduler or outside the process scheduler. If the process is running from outside the process scheduler get-run-control-param procedure will not detect any input values so it will identify that the process is being run from outside process scheduler. How you can see the SQR Errors (after Execution)?

SQR normally places the SQR PROG output files in the directory from which you run the PROG. The output file has the same file name as the SQR file that created it, but the file extension is different. To produce the desired output file for this exercise, the -KEEP flag .

The output files should appear as soon as your PROG has finished running. If you specified the -KEEP argument, one output file is in SQR Portable Format (recognizable by its .SPF extension). SQR Portable Format is discussed later in this guide but for now, you can easily view the sample PROG’s .SPF file output, ex1a.spf, on Windows platforms with the SQR Viewer GUI (sometimes referred to as an “SPF viewer"). The SQR Viewer is invoked from the command line with “sqrwv”.

Default output file is .lis If u specify -keep the output file will be in .lis or .spf(sqr portable format)

How can you send a mail to person? If this is AE, The command used to send email is.. If this is SQR, the command used to send email is .. .. For this to happen, we have to have mail server set in Unix box.For WF, I did set up the WF in such away that is send email to a person or group by settings the properties in a business process, Activity and Event where in I gave the email address of the person or used a Role Query.Iused PeopleCode at component level or Record level to Trigger the WF. I know how to create Role queries,develop Business process,set WF or Worklist. Using activity ,event and mail setting the properties and connected by routing, I write a WF PeopoleCode using TriggerBusinessEvent function I can send a mail.

SQR DEBUGGING Why we need the Debugging concept? After completion of the program successfully, sometimes the output is not what we expected, then we need to find the mistake. That means we have to debug the program. What are the commands SQR supports for Debugging purpose? Show and Display. What is the purpose of the Show and Display commands? We can use both the commands to display the variables on the screen and write the same information into the log file. What is the drawback to the Display command? We can’t display multiple fields in one display command. Can we use the Show and Display commands in setup sections? No, we can use these commands anywhere in the program except the setup section. What is the difference between Show and Display commands? The purpose of these two commands is same but the difference is Using the Display command we can display only one value at a time Using the Show command we can show more than one value at a time. Show &emplid &name &sal output is: 100 NUTAN 1000000

Display &emplid &name &sal :But it gives an error because we should use separate line for each display command. Display &emplid ---Display &name ----Display &sal Now the output is: 100 -----NUTAN ---------10000

How do you handle errors in SQL paragraphs? By using on error-argument. It will specify the name of the procedure to be executed.

Page 28: IQ 2011 BY GVR

Page | 28

Peoplesoft Interview Questions

What is the use of the Noline parameter? Using this command we can print the values in a single line. Example: Display &emplid noline --Display &name noline ----Display &sal ;Now the output is:100 NUTAN 10000

Can we use the edit format masks for the Show and Display commands while displaying the variables? Yes we can use. What are the outputs to the following? Display '123456789' xxx-xx-xxxx ==== Display 1234567.89 999,999,999.99 1. 123-45-6789 1,234,567.89 What are the other advantages with the Show command? We can control the cursor position on screen. We can send the beeping signals. We can make the screen fields blinks, bold, and underline. What are the commands SQR supports for Conditional Debugging purpose? 1. #debug 2.#if 3. #Else 4. #ifdef 5.#ifdeg 6.#End-if Suppose that #debugx Show ‘Test started’ is a statement. What happen if we not specify the -debugx command line flag? The statement will not be processed during the compile stage, and therefore will not be executed. Suppose that -debugxyz is a command line flag. Then how many substitution variables will create the SQR? SQR automatically creates four substitution variables. Debug, Debugx, Debugy, Debugz. What happens? If we specify like the following: Suppose that –debugxyz is command line flag and the following are debug statements. #debugx show ‘x’ ---#debugy show ‘y’ ---#debugz show ‘z’ ---#debugz show ‘a’ ---#debugz show ‘b’ The output is : show ‘x’ ----show ‘y’ ----show ‘z’ ,,,because #debugxyzab flag was not specified.

What is an effdt query to select the current data row? Begin-programme Do get –current-datetime Begin-Select a.company (+1,1) a.effdt(,+1) a.eff_status(+1) from ps_company_tbl a where a.company=’ccb’ and a.effdt = (select maxof(effdt) from ps_company_tbl where company = a.company and effdt<=$asoftoday) End-Select End-Programme.

how can you call stored procedures in sqr? By using global or local procedures we can call procedures after begin procedure we have to put local keyword.

What are the different types of Arrays in SQR? Single dimensional, and 2 dimensional, 3 dimensional array.

3 DA used in generating the (depend, job, summary salary) of employee --2 DA used in generating the customer details and order details ---- 1 DA company id

How you can declare 2nd dimensional Arrays? Using multiple arrays can allow you to reduce database calls. In the SETUP section, two arrays are created—one to summarize monthly orders by product, and another to summarize monthly orders by price range. BEGIN-SETUP create-array name=order_qty size={max_products}field=product:char field=month_qty:number:3 create-array name=order_qty2 size={max_categories}

field=category:char field=month_qty:number:3 END-SETUP

>>>>>>>>>Create array Name : purchage array size = 100 Field1: price:num Field2: qty :num

create-array name=order_qty size={max_categories} field=category:char field=month_qty:number:3<<<<<<<<

SECURITY:What is PS Online Security? The PeopleSoft system is comprised of many components, such as batch processes, object definitions, application data, and so on. Using PeopleTools security tools you can control access to most of these components. PeopleSoft Security TypesSign-on and Time-out Security (Sign-on : Monday to Friday 9am to 5:45pm,Time-out: 20mins. Idle time) Page and Dialog Security -Menus or specific actions (Enabled/Disabled)Batch Environment Security:a) Process Security((1) Run Control ID,(2) Process Groups,(3) Restricting off-line RDBMS access)b) Reporting Security (Report Repository at Web Server, Server should be locked from outside access

Can distribute reports and view them based on Roles)• Object Security --Field, Record and Page level Security• Application Data Security

Page 29: IQ 2011 BY GVR

Page | 29

Peoplesoft Interview Questions

a) Table Level Security( Works only for queries (SQL),Query Access Groups in Tree Manager,Doesn’t control run-time page access table data)b) Row Level Security (SQL views - security views, saving only rows of data, Tailored to specific applications)c) Field Level Security ( Securing fields or columns by using PeopleCode)________ User Profile: Set of data describing a particular user of PeopleSoft system.Data includes Language Code, SETIDs etc.--Different from application data tables e.g. PERSON_DATAUser Profiles :This data includes everything from the low-level data that PeopleTools requires, such as Language Code, to application-specific data, such as the SETIDs a user is authorized to access within the PeopleSoft financial applications. User Profile Types:

Security related: PasswordsDescriptive: Email AddressPreference: Multilingual

When User Profiles are relevant: When user interacts with the system by: logging in, viewing his/her worklist entry, receiving an email etc.Roles: Intermediate objects that link User Profile with permissionlists. Examples: Employee, Manager, Customer, Vendor,

Student etc. Roles can be assign in two ways: Manually, Dynamically(by using PeopleCode, LDAP and Query Tools)You can assign multiple Roles to a User Profile, and you can assign multiple Permission Lists to a Role. Permission Lists: List or group of authorizations that are assigned to a Role. They store:

Sign-on times, Page access, PeopleTools access etc.Some Permission Lists, such as Process Profile or row-level security, you apply directly to a User Profile.Data permissions, or row-level security, appear either through a Primary Permissions List or a Row Security PL. A security definition refers to a collection of related security attributes that you create using Maintain Security. The three main PeopleSoft security definition object types are: User Profiles, Roles, Permission Lists

Permission Lists• 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. Permission Lists

• A User Profile inherits most of its permissions through the Role(s) or roles that have been assigned to the User Profile. • Some Permission Lists, such as Process Profile or row-level security, you apply directly to a User Profile. • Data permissions, or row-level security, appear either through a Primary Permissions List or a Row Security Permissions list.

The PeopleSoft system uses various authorization IDs and passwords to control user access to the system. You use Maintain Security to assign two of these IDs: User ID and Access ID.

User IDs : A PeopleSoft User ID is the ID you enter at the PeopleSoft signon dialog. • Using Maintain Security, you'll assign each PeopleSoft user a User ID and password. The combination of these two items grants

users online access to the PeopleSoft system. The system can also use a User ID stored within an LDAP directory server.• The User ID is also the key used to distinctly identify the User Profile definition.• UserID/OPRID is stored in the PSOPRDEFN table.

Connect ID : Using Connect ID means you don't have to create a new database user for every PeopleSoft user you add to the system.

• Important! If you are configuring a Windows Client to connect directly to the database (two-tier) then you must specify a Connect ID in the Startup tab of the Configuration Manager. Connect ID

• Note. Connect ID is required for a direct connection (two-tier connection) to the database. So application servers and two-tier Windows Clients require a Connect ID. You specify the Connect ID for an application server in the Signon

Page 30: IQ 2011 BY GVR

Page | 30

Peoplesoft Interview Questions

section of the PSADMIN utility, and for Windows Clients you specify the Connect ID in the Startup tab of the Configuration Manager.Access IDsWhen you create any User ID, you must assign it an Access Profile, which specifies an Access ID and password.--Access ID is stored in PSACCESSPRFL table

• The PeopleSoft Access ID is the RDBMS ID with which PeopleSoft application(s) are ultimately connected to your database once the PeopleSoft System validates the User or Connect ID.

• An Access ID typically has administrator-level database access; that is, it has all the RDBMS privileges necessary to access and manipulate data for an entire PeopleSoft application.

• Symbolic ID : PeopleSoft encrypts the Access ID when it is stored in the PeopleTools Security tables. Consequently, an encrypted value can't be readily referenced nor accessed. So when the Access ID, which is stored in PSACCESSPRFL, needs to be retrieved or referenced, the query selects the appropriate Access ID by using the Symbolic ID as a search key.

Business Unit? What are the major functions? A business unit is a way of tracking specific business information for reporting and other roll-up data collection. It performs 2major functions1) It allows you to maintain a tree structure to facilitate customer-specific roll-up reporting.2) It allows you to distribute and administer certain control tables like the department table. This is extremely important for large or multinational companies.Setid? Setid's are key to linking business units to record control groups. It is the key on all control tables in tableset sharing Every row in a control table includes a setid as its key. Setids partition the data into groups or sets of data that are appropriate for each business unit.Table Sharing? Tableset Sharing is a method of filtering prompt data so that only appropriate values are available for data entry. With tableset sharing, a single table can offer different values based on underlying business rules. Table set Sharing is organized around these basic elements: Business Units and transaction tables SetIDs and control tables Business rules.Business unit and a setid? A business unit is a way of tracking and reporting specific business information for reporting and other roll up data collection. It does not have to be a legal entity for HR. It’s a way of organizing your organization. A SetID is a link to Table Set Sharing. Table set sharing simply consists of assigning specific SetIDs to specific record groups for individual business units to restrict the view of rows of data within control tables. It’s a way of organizing your data in the system.

Dynamic Prompt / Edittable Prompt The following steps help to make Dynamic prompt (Edit Table Prompt).Lets consider a scenario, based on selection Criteria the Character value prompt need to change.For Department Character value prompt should be DEPT_TBL and for Job Code the Character value prompt should be JOBCODE_TBL.

The Selection Criteria, Character Value, Process are fields in SQL Record (May change in different case) and Edit Table (EDITTABLE field) is from DERIVED (delivered) derived and work record.In the above   example your need a record(e.g GR_CRI_TBL) has following fields: SELECTION_TYPE, CHAR_VALUE, PROCESS >> CHAR_VALUE should have %EDITTABLE Prompt Table Edit Type

Page 31: IQ 2011 BY GVR

Page | 31

Peoplesoft Interview Questions

Write the following function in any FIELDFORMULA and call the function as given below.Local string &Type;Function hide_unhide_popfields(&Row As Row); &Type = &Row.GetRecord(Record.GR_CRI_TBL).SELECTION_TYPE.Value; Evaluate &Type When "D" /* Department */ &Row.GetRecord(Record.DERIVED).EDITTABLE.Value = Record.DEPT_TBL; Break; When "J" /* Job Code */ &Row.GetRecord(Record.DERIVED).EDITTABLE.Value = Record.JOBCODE_TBL; Break; When "L" /* Location */&Row.GetRecord(Record.DERIVED).EDITTABLE.Value = Record.LOCATION_TBL; Break; End-Evaluate;End-Function; Call the above function based on FieldChange and RowInit . Declare Function hide_unhide_popfields PeopleCode GR_CRI_TBL.SELECTION_TYPE FieldFormula;SetDefault(GR_CRI_TBL.CHAR_VALUE);--- hide_unhide_popfields(GetRow());Dynamic prompt table for Record Fields. How can we achieve the same in our project????This is accomplished by 2 ways: Using EDITTABLE fields for Prompt Table,Using Dynamic Views1. Usage of EDITTABLE Fields In this method, Prompt table property of Record Fields should be assigned with %EDITTABLE value. Actually what does it mean????Prompt Table value for the Record Field is populated from the Record Field DERIVED.EDITTABLE value. The Record Field DERIVED.EDITTABLE should be assigned with value either in one of the Peoplecode events (Either in FieldChange or FieldEdit or RowInit events). This is simply done by DERIVED.EDITTABLE = “PERSON_NAME”;Note: EDITTABLE Field should be present in the SAME Page, where Record Field (In this case, The Field is nothing but EMPLID) is also referred. If the Record Field is not coming under Component Search Record Field, there is no need for placing the EDITTABLE field in the Page.2. Usage of Dynamic Views As we know, while creating Dynamic view, there is no need to specify the SQL. This SQL should be generated dynamically and the same should be assigned to the Record Field. Record Field TASK_PROFILE_ID, it is assigned with dynamic prompt table view TL_TSKGRP_DVW and this view TL_TSKGRP_DVW is dynamically initialized by the following Peoplecode, which can be assigned both in FieldChange and RowInit events of the Record Field TASK_PROFILE_ID.

RECORDNAME.TASK_PROFILE_ID.SqlText = “SELECT T.TASKGROUP, T.TASK_PROFILE_ID, T.DESCR FROM PS_TL_TSKGRP_PRF_W T WHERE T.TASKGROUP = ‘” | &TSKGRP | “‘ AND T.EFFDT =(SELECT MAX(T1.EFFDT) FROM PS_TL_TSKGRP_PRF_W T1 WHERE T1.TASKGROUP = T.TASKGROUP AND T1.TASK_PROFILE_ID=T.TASK_PROFILE_ID AND T1.EFFDT<= %datein( ‘” | &maxdate | “‘) )”; Both &TSKGRP, &maxdate are dynamic bind parameters.

Changing/Selecting Grid value based on ConditionThe following PeopleCode can be used to change the grid value based on condition. Local Rowset &rsGrid, &rsDataSource;&rsGrid = GetLevel0().GetRow(1).GetRowset(SCROLL.TEST_VW); &rsGrid.Flush();

&rsDataSource = CreateRowset(Record.TEST_VW); &rsDataSource.Flush();&rsDataSource.Fill(" WHERE EMPLID = :1 AND EMPL_RCD = :2 " &sEmplId,&nEmplRcd); &rsDataSource.CopyTo(&rsGrid);The following code can be used to Select grid value based on FieldChange(any condition) event.

&LVL1 = GetLevel0().GetRow(1).GetRowset(Scroll.PER_CHECKLIST);

&LVL2 = &LVL1(CurrentRowNumber()).GetRowset(Scroll.PER_CHKLST_ITM);

If &LVL2.ActiveRowCount = 1 And &LVL2(1).IsNew And Not &LVL2(1).IsChanged Then

Else For &i = &LVL2.ActiveRowCount To 1 Step – 1 LVL2.DeleteRow(&i); End-For;End-If;

If All(PER_CHECKLIST.CHECKLIST_CD) Then

&LVL2.SelectNew(Record.CHECKLIST_ITEM, "WHERE CHECKLIST_CD = :1 and EFFDT = (SELECT MAX(A.EFFDT) FROM

Page 32: IQ 2011 BY GVR

Page | 32

Peoplesoft Interview Questions

PS_CHECKLIST_ITEM A WHERE A.CHECKLIST_CD = PS_CHECKLIST_ITEM.CHECKLIST_CD AND A.EFFDT <= %DateIn(:2))",

PER_CHECKLIST.CHECKLIST_CD, PER_CHECKLIST.CHECKLIST_DT); End-If;

The below function is to be used on a grid with multiple check boxes. Place the code behind a FieldChange event and users will have the option to Select or Deselect grid rows all at once.Function selectAllRows(&rs As Rowset)  Local number &i;   Local Row &row;    For &i = 1 To &rs.ActiveRowCount      &row = &rs.GetRow(&i);      /* Make sure we only select visible rows. */    If &row.Visible = True Then &row.Selected = True; End-If; End-For; end-function;

/*main line*/ Local Rowset &rs; &rs = GetLevel0()(1).GetRowset(Scroll.scroll_table);/*Call Function*/ selectAllRows(&rs);

The same code would work for multiple check boxes "Deselect All", just change the name of the function and line

&row.Selected = True; to &row.Selected = False;

Make sure the Multiple Row (Check Box) is checked on the grid properties.

We always find it confusing to write code for Scrolls. Following is generic peoplecode which you can use for pages having parent

child relationships (scrolls). Just replace the record and field for respective level.

&rs_level0 = GetLevel0();

&level0fieldvalue = &rs_level0.(1).Level0_Record.Level0_field.Value ;

&row_level0 = &rs_level0.GetRow(1);&rs_level1 = &row_level0.GetRowset(Scroll.Level1_Record);For &J = 1 To &rs_level1.RowCount

   &level1fieldvalue = &rs_level1.GetRow(&J).Level1_Record.Level1_field.Value      &row_level1 = &rs_level1.GetRow(&J);   &rs_level2 = &row_level1.GetRowset(Scroll.Level2_Record);       For &L = 1 To &rs_level2.RowCount    &level2fieldvalue = &rs_level2.GetRow(&L).Level2_Record.Level2_field.Value    End-For;    End-For;

Here is a piece of code to prevent duplicate data on a specific field on a page grid. You can of course modify it to

check for multiple fields or even the whole row.

   /* Check for data duplicates on a grid. */  Local Row &row1, &row2;  Local number &r, &r1;   &rs = GetLevel0().GetRow(1).GetRowset(Scroll.grid_table);   For &r = 1 To &rs.ActiveRowCount   /*Get grid row*/      &row1 = &rs.GetRow(&r);      /*once we have a row, we are going to loop through the grid rows and make sure a specific field value is unique*/ For &r1 = 1 To &rs.ActiveRowCount         &row2 = &rs.GetRow(&r1); /* if this is a different row, and the field_name value matches then throw an error*/         If &r1 <> &r And           

Page 33: IQ 2011 BY GVR

Page | 33

Peoplesoft Interview Questions

&row1.grid_table.field_name.Value = &row2.grid_table.field_name.Value Then   MessageBox(0, "", 0, 0, "Error.  Duplicate values are not allowed.");         End-If;      End-For;   End-For;

Grid Row Selection IndicatorPeopleSoft grids have the option of using a single or multi-row selection indicator. A single row selection indicator is a radio button (one option) while a multi-row selection indicator is a check box. You can use this functionality to get the user to select the row(s) they are interested in.These settings are in the page field properties of the grid (under the Use tab):

This all works really well, but what is the event triggered by user when they use these selection indicators? Well, there isn't one — well not in the sense of a field change anyway. However, there is a Set Component Changed option in the grid properties, which, when set, will trigger a save event when the user sets or changes the selection indicator(s).

So, if a user selects a row in the grid (single selection radio button), when they press save, PeopleSoft will recognise this event and fire off any code in SaveEdit, SavePreChange, or SavePostChange

Here is a snippet of PeopleCode you could use to process the row(s) selected by the user and perform an action: Local Rowset &rs_YOUR_RECORD; Local integer &i; &rs_YOUR_RECORD = GetLevel0()(1).GetRowset(Scroll.YOUR_RECORD); For &i = 1 to &rs_YOUR_RECORD.ActiveRowCount If &rs_YOUR_RECORD(&i).Selected = True Then /* This is a row selected by the user, do something here */End-If; End-For;

Delete All Grid RowsA very simple yet very useful code to give users the option to delete all grid rows on a page at once. I've implemented such a requirement by placing a "Delete all" button above a grid to give PeopleSoft users the option to delete all rows at once instead of clicking the "-" grid button. If the gird has, lets say, 20 rows, then a user will have to click the "-" delete grid button 20 times to delete all rows, compared to one click on the "Delete all" button. Place the code below behind a field change event.   &RECCNT = ActiveRowCount(Record.record_name_behind_grid);   For &I = &RECCNT To 1 Step - 1      DeleteRow(Record.record_name_behind_grid, &I)    End-For;

It is important to point out that users will still have to save the page for the deletion to take place at the database level.This code should be helpful if you are trying to hide a grid column using PeopleCodeStop or Prevent Inserting Grid Rows Via PeopleCodeThe PeoleCode below will prevent users from inserting more than 2 rows on a grid. The "+" button will disappear the moment a 2nd row is added by a user. I have place this code on a record field under rowinit event.If GetRowset().ActiveRowCount = 1 ThenGetRowset().InsertEnabled = True; Else GetRowset().InsertEnabled = False; End-If;

To hide a column in a grid (using the Grid and GridColumn objects). You no longer must loop through every row in the grid and hide that field. Now you can use the GridColumn property Visible. The Visible property will also hide grid columns that are displayed as tabs in the PS Internet Architecture.Local Grid &GRID; Local GridColumn &COLUMN;If COMPLETE_FLAG = "Y" Then &GRID = GetGrid(PAGE.RESOURCE, "GRID1"); &COLUMN = &GRID.GetColumn("COL5");&COLUMN.Visible = False; End-If;Grids are used all the time in PeopleSoft, and to populate them with dynamic data could be quite challenging. Use the "Select" function to read data from the database tables or views into either a row or rowset object.The following example first flushes the hidden work scroll, then selects into it based on a field on the page, or any criteria that you add to the “where clause”.&RS = GetLevel0()(1).GetRowset(Scroll.CHECKLIST_ITEM); &RS.Flush();&RS.Select(RECORD.CHECKLIST_ITEM, "where Checklist_CD = :1 andEffDt = (Select Max(EffDt) from PS_CHECKLIST_ITEM Where CheckList_CD = :2)", CHECKLIST_CD, CHECKLIST_CD);

Page 34: IQ 2011 BY GVR

Page | 34

Peoplesoft Interview Questions

In order to reference the value of a field within a looping statement, the FetchValue and UpdateValue build-in functions can be used.

FetchValue(SCROLL.record_name, target_row, [recordname.]fieldname)

UpdateValue(SCROLL.record_name, target_row, [recordname.]fieldname), value)

Example:For &I = 1 To ActiveRowCount(Scroll.PSU_STU_ENROLL)&status = FetchValue(Scroll.PSU_STU_ENROLL, &I, PSU_STU_ENROLL.ENROLL_STATUS);If &status = "ENR" ThenUpdateValue((Scroll.PSU_STU_ENROLL, &I, PSU_STU_ENROLL.ENROLL_STATUS, "CMP"); End-If; End-For;

Query Security :  PeopleSoft Query uses query access group trees to control the access of the tables in the PeopleSoft database.You create and update query access group trees using Query Access Manager.You should create query access group trees based on your organization’s needs and on any customizations you’ve made. Relationship between row-level security and Query security record definitions: PeopleSoft applications implement row-level security by using a SQL view that joins the data table with an authorization table. To apply row level security:Open the record on which you want to apply row-level security. Click the Properties button, and select the Use tab from the Record Properties dialog box.----Select the security record definition (usually a view) in the Query Security Record list box. Row-Level (Data Permission) Security Views:

1. Using PeopleSoft row-level security views enables you to restrict users from seeing certain rows of data.

Page 35: IQ 2011 BY GVR

Page | 35

Peoplesoft Interview Questions

2. You can restrict data by:

1. User, by using the OPRID field.2. Primary permission list, by using the OPRCLASS field.3. Row security permission list, by using the ROWSECCLASS field

3. To implement row-level security through a security view:

2. In Application Designer, insert one of the three row-level security fields(OPRID, OPRCLASS, ROWSECCLASS) into the record definition.

3. Configure the field as a Key, but not a List Box Item.

4. Save the record and build the view.

5. Use the record as the search record or query security record.

Steps for creating query security record:

          1. Create a view depending on your security need. Example: create a view which has oprid, rowsecclass and the parent key field and in sql editor write the following sql:  SELECT DISTINCT opr.oprid, opr.rowsecclass, dtl.t_cust_id FROM psoprdefn opr,ps_t_sjt_class cls, ps_t_sjt_class_dtl dtl WHERE  cls.rowsecclass = dtl.rowsecclass AND cls.t_cust_id = dtl.t_cust_id        AND opr.rowsecclass = cls.rowsecclass 

 2. Attach the above view to the record in record properties (query security record). 

3. Grant security to that record to which the query security view is attached.4. In PIA, traverse to query access manager (Oracle PS Tools ->people tools –> Query  Security -. Query Access Manager). Then CLICK ON CREATE NEW TREE.

 

 5. If access group is already present, then search for that access group in the prompt.

Page 36: IQ 2011 BY GVR

Page | 36

Peoplesoft Interview Questions

6. 6. If you want create a new access group then enter the access group name and PRESS ENTER, it will be redirected to the below page where you can create your own access group.       

7. Then insert the child records to the access group.

 step 7.1

Step 7.2   

Step 7.3

 8. 8. Go to permission list and traverse to query. (People Tools -> Security -> Permission & Roles -> Permission list (Select the permission list)).

 

Page 37: IQ 2011 BY GVR

Page | 37

Peoplesoft Interview Questions

9. 9. In access group permissions, assign the tree name and access group.

 

 

10. 10. In query manager, add the record to which the query security view is attached.

 NOTE: You should consider adding record definitions to the query trees in a hierarchy that matches the parent/child relationship of records in your database.

People Code:-What are the think-time functions? The functions which will suspend processing either until the user have taken some action. For example clicking a button in a message box

Standalone Rowsets are like regular Rowsets except they aren't associated with a component or page. SetCursorPos(): Places the focus in a specific field anywhere in the current component.

FieldEdit Event Used to validate the contents of the field. Without rectification, the transaction cannot be saved.FieldChange Event Used to recalculate page field values, change the appearance of page controls. Fired only when the data value in the field changes. What is the different between RowInit & RowInsert?

The RowInit event fires the first time the Component Processor encounters a row of data. It is used for setting the initial state of component controls. This occurs during component build processing and row insert processing. It also occurs after a Select or SelectAll Rowset method, or a Scroll Select or related function is executed.

When the end-user adds a row of data, the Component Processor generates a RowInsert event. You should use RowInsert PeopleCode for processing specific to the insertion of new rows. Do not put Peoplecode in RowInsert that already exists in RowInit, because a RowInit event always fires after the RowInsert event, which will cause your code to be run twice.

SaveEdit and FieldEdit? Field Edit peoplecode is fired when you try to change the value of a field on the page and Save Edit peoplecode is fired when you try to save the page. Both validates data but Field Edit peoplecode is used to validate the data for only that particular field which is changed and Save Edit peoplecode is used to validate all the data changes made to the fields on the page. Difference between SavePreChanges and SavePostChan...

Page 38: IQ 2011 BY GVR

Page | 38

Peoplesoft Interview Questions

saveedit validates data and gives messages or warnings. When no error/warnings exist then saveprechange fires. it helps by doing one last check before the save process. save post change updates/inserts data into the records that have not been brought into to component buffer. it is recomended not to give error or warning messages in prechange and postchange events. SaveEdit Event -Triggered when the user attempts to save the component. --Used to validate the consistency of the data.

• Use SaveEdit when a validation involves more than one component field. -Not field specific.SavePreChange Event

• Initiated after SaveEdit completes without errors. Final opportunity to manipulate or validate data. Not Field Specific.• Workflow Event is generated, and the component processor issues appropriate Insert, Update or Delete SQL statements.

SavePostChange Event--Triggered after the component processor updates the database.• Used to update tables ( not in the same component) using the SQLExec built-in Funtions.• Avoid Errors and Warnings( causes runtime errors).• Never issue a SQL commit or rollback statement manually from within a SQL function, as the system itself

issues a SQL commit statement. What is scroll select, etc? or How do you retrieve a value from scroll.. Scroll select?ScrollSelect function selects records from a table and loads them into the scroll buffer area of a page. In parent/Child relationships, scrollSelect chooses all corresponding child rows and inserts them under the next higher level row. The function requires the specification of the target scroll area, a source record from which to select rows and an optional SQL string. The parameters passed to ScrollSelect vary based on the scroll level at which the function is targeted. Level 1 ScrollSelect (1, RECORD.target_recname, RECORD.sel_recname); Level 2 ScrollSelect (2, RECORD.level1_recname, RECORD.target_recname, RECORD.sel_recname); L 3 ScrollSelect (3, RECORD.level1_recname, RECORD.level2_recname, RECORD.target_recname, RECORD.sel_recname);

SearchInit Event: Purpose: To assign the default values and change the behavior of the search dialog box.Firing: Search init PeopleCode fires before the search record dialog box displays. To control processing before the user enters values in the search key and alternate search key fields.To change the properties of the S.K and A.S.K fields programmatically.

Description: Search init is valid only on search key fields and Alt search key fields, not valid for non search key fields. If we write any code on non search key fields, it will not execute through out the life time of the application.Record Level events takes precedence over the Component Record level events.For Example: We have some code at both Record Level and Component Record level. In this case, first Record level code is executed first and then Component record level code is executed.

SearchInit Event For example:Emplid (Field) SearchInit Emplid=’100’ SetSeachDialogBehavior (0);Emplid (Field) SearchInit Emplid=’%UserId’ SetSeachDialogBehavior(0);Emplid (Field) SearchInit Emplid=%EmployeeId; Gray (EmplId); AllowEmplIdChg(true);

SearchSave Event: Firing: After entering all the required values into the dialog box when we click the search button, search save event will Fires.Purpose: To restrict the user to access the data from the database to Component unless knowing the S.K or A.S.K values. It forces the user to enter the values into the dialog box.

Description: Search save is nothing but a save edit. Search save also Valid only on search key fields and alt search key fields, Not valid for non search key fields. If we write any code on Non search key fields, it will not execute through out the Life time of the application. Search save does not fire when Values are selected from the search list.If none (Emplid, Name) then Error (‘you can’t enter without knowing the key values’); End-if;

Page 39: IQ 2011 BY GVR

Page | 39

Peoplesoft Interview Questions

IF Not Record Changed (psu_Student_tbl.Student_id) And %Mode <> ‘A’ Then Error (“you must enter at least one search value.”); End-if;

RowSelect EventRecommendation is don’t use this event for writing the code. For this PS gave some Built-in functions like scroll select family. Firing: The Row Select event fires at the beginning of the Component Build process in any of the Update action modes (Update, Update/Display All, Correction). This event also occurs after a Scroll Select or related function is executed.Purpose: To filter the data while reading rows from database to component buffer. For example if we enter any value in search key dialog box it(Application Processor) will goes to the database and search for the required value if found it displays the data. Application Processor: Application processor searches in database for the search record, if found it displays.Application processor brings the records from the database and place at buffer then buffer to the component.Scroll select is the Built-in function useful to retrieve the data form the buffer to the scroll.Example: If %Page=Component.BEN_PROG_PARTCIPN then

If COBRA_EVENT_ID>0 Then DiscardRow(); End-If; End-If;

PreBuild Event Firing The PreBuild event fires before the rest of the component build events.Purpose: To change the properties of the component and component fields according to the user requirements.To define the component variables. To hide or unhide pages.Description: This event is only associated with components.The PreBuild event is also used to validate data entered in the search dialog, after a prompt list is displayed. Example : Component array of array of string &CommentArray; Local array of string &Min; /*********************************************/ /* Load the array */ /***************************************************/ &Min = CreateArray(“1”,”100”,”200”,”300”);

FieldDefault Event: Purpose: To assign the default values to the field programmatically.Description: We can assign default values in 2 ways. One is in Application Designer and other is by using PeopleCode Field Default event.If the default value is assigned in the Record field properties then the system won’t execute the PeopleCode default value.Means The Record field properties will override the PeopleCode. Example: Userid (Field) Field default (Event) -------------------------------------------------------------------------------Evaluate %userid When ‘ABC’ Employee Name= ‘srinivas’; Break; When ‘XYZ’ Employee name= ‘nani’; Break;When-other Employee Name= ‘NO name’;Break;End-Evaluate; Example2: Maritial Status (Field) Field default (Event) If Age>25 then MS=’Y’ Else MS=’N’ End-if;

FieldFormula Event: Firing: Field Formula fires after Field default completes successfully, regardless of whether a field has a value.Purpose: For writing the user defined functions in the functional libraries.Description: PS recommendation is don’t use the event for writing the PeopleCode. Draw back is it will execute for each and every user actions (except save) for each and every row in the component buffer, so it increase the network traffic and affects the performance of the Application program.

RowInit Event: Firing The RowInit event fires the first time the Component Processor encounters a row of data.It also occurs when an operator inserts a row (F7),but just on the new row of data.Purpose: RowInit event controls the intial appearance of the fields. Description: Do not use Error or Warning statements in RowInit PeopleCode as it leads to the cancellation of the component.Example: IF %Component=Component.ABSENCE_HISTORY Then IF REG_REGION_COUNTRY=“NLD” Then

ABSENCE_HIST.RETURN_DT.Label=MsgGetText(6524,124,”Return Date &Time); End-If; End-If;PostBuild Event: Firing: The PostBuild event fires after all the other component build events have fired. Purpose: To change the properties of the component and component fields according to the user requirements.To define the component variables. To hide or unhide pages.Description: This event is only associated with components.The PreBuild event is also used to validate data entered in the search dialog, after a prompt list is displayed.Example: Component Rowset &Ab_Hist_Rs;&Ab_Hist_Rs=CreateRowset(Record.ABSENCE_HIST);&Ab_Hist_Rs.Fill(“Where Emplid=:1 “,PERSONAL_DATA.EMPLID);Activate Event: Firing: Activate PeopleCode event fires every time the page is activated.

Page 40: IQ 2011 BY GVR

Page | 40

Peoplesoft Interview Questions

Purpose: To change the Properties of the page and page fields. Description: This is only the one event for writing PeopleCode for Page object.

FieldEdit Event Firing The FieldEdit event fires on the specific field and row when it changed and the new value of the field satisfies the standard system edits.Purpose: In addition to the system edits we can put some more edits to validate the field values. For example: Suppose that salary is one field and is a numeric value, so we can’t enter character values to this field, this will take care by the system nothing but system edit. Now we want add some more edits in addition to the system edit like the salary should be >50,000, for this we have to write this code in the Field Edit event. Salary (Field) Field EditIf Salary<50000 then Error (“Minimum salary should be > 50000”); End-if;/* once we get the error message, unless we rectify the error the cursor won’t move to the next. */FieldChange EventFiring: This event occurs when a field is changed, the standard system edits have been passed, and the FieldEdit event is completed successfully.Purpose: To assign the calculated values to the field by programmatically. To change the properties of the other field based on this field.Description: Unless the Field edit executes the Field change will not execute. It is not used for validation.Example: Maritial Status (Field) Field Change (Event) ------------------------------------------------------------If Maritial Staus=’N’ then Hide (Wife Name); Hide (Dependent Name); End-if;RowInsert Event Firing Row Insert event fires when a new row is inserted into Scroll bar.Purpose: To restrict some users to insert new rows into scrolls.For example: suppose that 15 users are having the permission to access the component. But I don’t want to allow all the users to insert the rows. I want to allow some users whose permission list is All Panels; it is possible by writing code under Row insert event. Description: It is valid only if the component is having scrolls (means child records). The program never executes unless there is scrolls, not valid for 0 level records. Example : IF RecordNew(EMPLID) Then

IF None(BUSINESS_UNIT) Then&Bus_Unit=Fetchvalue(OPR_DEF_HR_TBL.BUSINESS_UNIT,1);

BUSINESS_UNIT=&Bus_Unit; End-IF; END-IF;RowDelete Event : Firing Row Delete event fires when a user deletes a row of data.Purpose: To restrict some users to delete rows from the scrolls. To recalculating the field values.Description: It is valid only if the component is having scrolls (means child records). The program never executes unless there is scrolls, not valid for 0 level records.SaveEdit Event: Firing: When we click the save button the Save Edit Event will fire.Purpose: It works same as Field Edit. Useful to validate the data which is available in the Component fields.Description: Use the Field Edit event when we want to validate one field. But use the Save Edit event when we want to validate more than one filed. So that we can increase the performance of the program. Example: If Not ALL(EMPLID,NAME) Then Error “Emplid & Name should not be left blank”; End-IF;SavePrechange Event Firing: After SaveEdit completes successfully, the application processor applies the SavePrechange event.Purpose: It provides one last chance to manipulate the data before the database is updated.Description: Based on the validated values entered into the component, you may need to calculate the fields or change the display characteristics. Example: If PER_STATUS=“E” Then Assign_Employee_ID(EMPLID); End-If;Workflow Event: Firing: Workflow PeopleCode fires immediately after SavePreChange and before the database update that precedes SavePostChange.Purpose: To write the PeopleCode for workflow purpose (Office automation purpose).Description: Under this event we can write the PeopleCode that is only related to workflow.Workflow PeopleCode is not field-specific; it is an application specific means it executes for all fields and on all rows of data available in the component buffer. Example: We are going to use the below function in the Workflow event : TriggerBusinessUnit()

SavePostChange Event: Firing: This is the last event before the database is committed.Purpose: To update the data not in the component buffer , we use this event.SQLEXEC function is used to update the database fields.Description: The system issues an SQL COMMIT when the SavePostChange event completes successfully. If errors or warnings are received before SavePostChange completes, all updates made to the database are rolled back.Example:If &Count=0 Then SQLEXEC(“Update PS_PAYROLL_DATA set company=:1 where EMPLID=:2”,COMPANY,EMPLID); End-If; SQL Functions: SQLExec, CreateSQL, GetSQL , DeleteSQL SQLExec: SQLExec({sqlcmd | SQL.sqlname}, bindexprs, outputvars)

Page 41: IQ 2011 BY GVR

Page | 41

Peoplesoft Interview Questions

where bindexprs is a list of expressions, one for each :n reference within sqlcmd or the text found in the SQL definition sqlname, in the form: inexpr_1 [, inexpr_2]. . . and outputvars is a list of variables, record fields, or record object references, one for each column selected by the SQL command, in the form: out_1 [, out_2]. . .

• Use the SQLExec function to execute a SQL command from within a PeopleCode program by passing a SQL command string.• The PS record name specified in the SQL SELECT statement must be in uppercase• SQLExec commands go directly to the database server, not to the Component Processor

Bind Variables in SQLExec: – Bind variables are references within the sqlcmd string to record fields listed in bindvars. Within the string,

the bind variables are integers preceded by colons like :1, :2,. . .– The integers need not be in numerical order.– Bind variables can be used to refer to long character (longchar) fields. Long character fields are represented in

PeopleCode as strings– You should use %TextIn() Meta-SQL to ensure these fields are represented correctly on all database

platforms.– Bind variables can be passed as parameters to meta-SQL functions

Example: SQLExec(". . .%datein(:1). . .", START_DT, &RESULT)SQLExec("Select sum(posted_total_amt) from PS_LEDGER where deptid between :1 and :2", DEPTID_FROM, DEPTID_TO, &SUM);Limitations of SQLExec:– SQLExec can only Select a single row of data. If your SQL statement (or your SQL.sqlname statement) retrieves more than

one row of data, SQLExec sends only the first row to its output variables. Any subsequent rows are discarded. – If you need to SELECT multiple rows of data, use the CreateSQL or GetSQL functions and the Fetch SQL class method.– SQLExec statements that result in a database update (specifically, UPDATE, INSERT, and DELETE) can only be issued in the

following events: SavePreChange WorkFlow SavePostChange FieldChange

1. To make some fields Invisible in a particular page to particular user, if there are more than one user.If IsUserInRole ("TEST ROLE1") Then GR_STUDENT_DWR.TOTAL.Visible = False; GR_STUDENT_DWR.AVERAGE.Visible = False; GR_STUDENT_DWR.GRADE.Visible = False; End-If;

2. To make some fields Display only (read only) in a particular page to particular user, if there are more than one user.If IsUserInRole ("GDHAR") Then GR_STUDENT_REC.STUDENT_NAME.DisplayOnly = True; GR_STUDENT_REC.TELUGU.DisplayOnly = True;GR_STUDENT_REC.ENGLISH.DisplayOnly = True; GR_STUDENT_REC.HINIDI.DisplayOnly = True;GR_STUDENT_REC.MATHS.DisplayOnly = True; GR_STUDENT_REC.SCIENCE.DisplayOnly = True;GR_STUDENT_REC.SOCIAL.DisplayOnly = True;End-If;

3. Call AE: &REC = CreateRecord (RECORD.INIT_VALUES); &REC.FIELD1.Value = "XYZ"; /* set the initial value for INIT_VALUES.FIELD1 */ --CallAppEngine ("MYAPPID", &REC);SearchInit Event ---This event is fired just before a search, add, or data-entry dialog box is displayed.

• It triggers code in the search key fields of the search record.• We can set default values for search. EMPLID=%employeeId; Gray(EMPLID); AllowEmplIdChg(true);

SearchSave Event --Its Executed on all Search Key Fields after the user clicks on search.• It enables us to control processing after search key values are entered, but before the search based on

these keys are executed.-- Also used to force a user to enter a value in atleast one field.Component Build Events

RowSelect Event• It is initiated at the beginning of the component build process in any of the update action modes.• This event is used to filter out rows of data as they are being loaded into the component buffer.• Also occurs after scroll select.----Rarely used.• Inefficient to filter out rows of data after they have been selected.• Instead, use search record views and effective dated tables.

PreBuild Event --Initiated before rest of the component build events.--Used to hide/unhide pages.• Used to set component variables.---Used to validate data entered on the search dialog.

FieldDefault Event• Enables to set default values to fields.--Sets default values when in ADD mode or a new row is inserted in the scroll area.

Page 42: IQ 2011 BY GVR

Page | 42

Peoplesoft Interview Questions

• Must attach it to the field to be populated.---You cannot use Errors or Warnings as they cause runtime error.FieldFormula Event--Not used for programming purpose.--Use RowInit and FieldChange events instead.

• DONOT place any record.field with code in FieldFormulae on a page.--• Now used as FUNCLIB( function library) to store shared functions.

RowInit Event--Generally used to set the initial state of component controls.--Not field specific.PostBuild Event---Initiated after all other Component Build Events have been initiated.

• Used to hide or unhide pages.---Used to set component variables.Activate Event---Initiated when page is opened/activated.---Every page has its own Activate Event.

• Aids in Page Display and Page Processing.---Only associated with pages.--Not supported for sub-pages.FieldEdit Event--Used to validate the contents of the field.--Without rectification, the transaction cannot be saved.FieldChange Event---Used to recalculate page field values, change the appearance of page controls

• Fired only when the data value in the field changes.RowInsert Event (Do not use a Warning or Error in RowInsert)

• Triggered when the user adds a new row of data.--Don't write peoplecode in RowInsert that already exists in RowInit.RowDelete Event

• Triggered when the user attempts to delete a row of data from a page’s scroll area. --Used to prevent deletion of row.

SaveEdit Event• Triggered when the user attempts to save the component. ---Used to validate the consistency of the data.

• Use SaveEdit when a validation involves more than one component field. ---Not field specific.SavePreChange Event

• Initiated after SaveEdit completes without errors. ---Final opportunity to manipulate or validate data.• Workflow Event is generated, and the component processor issues appropriate Insert, Update or Delete SQL statements.• Not Field Specific.

Workflow Event---Immediately after SavePreChange event and before the database updates.• Used when E-mail/Event notification need to be sent to different parties for the transaction being saved.

SavePostChange Event• Triggered after the component processor updates the database.-- Avoid Errors and Warnings( causes runtime errors).• Used to update tables( not in the same component) using the SQLExec built-in Funtions.• Never issue a SQL commit or rollback statement manually from within a SQL function, as the system itself

issues a SQL commit statement. ItemSelected Event--Initiated whenever a user selects a menu item from a popup menu.--Does not initiate if run from a CI.PrePopup Event ---Initiated before the display of the popup menu. --Used to control the appearance of the popup menu.Prebuid can be used to validate your search data, discarding rows. Postbuild can be used to play with the pages (hide, unhide).. filling up scrolls.. Saveprechange is the last event where you can validate and correct ur data before updating the database. Once it is done, database will get updated. Savepostchange will be used to play with tables which are not present in ur component buffer.

Key areas:

Classes - formal definition of an object and acts as a template from which an instance of an object is created at runtime. Objects - represents a unique instance of a data structure defined by the template provided by its class. Object instantiation - class is the blueprint for something, an object is the actual thing that's built using that class (or blueprint.)

Local field &MyField &MyField = GetField ({ n | FIELD. fieldname }); Get functions, which include functions such as GetField, GetRecord, and so on, generally provide access to data that already exists, whether in the data buffers or from an existing definition.

&REC2 = CreateRecord (RECORD. recordname ); The above example creates a standalone record. However, there is no data in &REC2. The specified record definition must be created previously, but the record does not have to exist in either the component or data buffer:

Create functions, which include functions such as CreateObject, CreateArray, CreateRecord, generally create defined objects that do not yet exist in the data buffer. Create functions create only a buffer structure. They do not populate it with data

To set or get characteristics of an object, or to determine the state of an object, you must access its properties through dot notation syntax. Object.Property = Value ; The following example hides the field &MYFIELD: &MYFIELD.Visible = False

Page 43: IQ 2011 BY GVR

Page | 43

Peoplesoft Interview Questions

You can return information about an object by returning the value of one of its properties. In the following example, &X is a variable that is assigned the value found in the field &MYFIELD: &X = &MYFIELD.Value

In the following example, a property is used as the test for a condition: If &ROWSET.ActiveRowCount <> &I Then

The format is generally - Object.method(); We can string methods and property values together into one statement -

If &REC_BASE.GetField(&R).Name = &REC_RELLANG.GetField(&J).Name Then

Other methods return a reference to an object. The GetCurrEffRow method returns a row object:&MYROW = &MYROWSET.GetCurrEffRow();

The following lines of code are equivalent: &FIELD = &RECORD.GetField(FIELD.EMPLID); &FIELD = &RECORD.EMPLID;

_______

The two specified lines of code are equivalent: They both get the fifth row of the rowset:

&ROWSET = GetRowSet(); /*the next two lines of code are equivalent */ &ROW = &ROWSET.GetRow(5); &ROW = &ROWSET(5); The following example illustrates the long way of enabling the Name field on a second-level scroll area (the code is executing on the first-level scroll area):

GetRowset(SCROLL.EMPLOYEE_CHECKLIST).GetRow(1). GetRecord (EMPL_CHKLST_ITM).GetField(FIELD.NAME).Enabled = True;

Using default methods enables you to shorten the previous code to the following: GetRowset(SCROLL.EMPLOYEE_CHECKLIST)(1).EMPL_CHKLST_ITM.NAME. Enabled = True;

______

Expressions of the form class.name.property or class.name.method(..) are converted to a corresponding object. For example, the code &temp = RECORD.JOB.IsChanged; is evaluated as if it were &temp = GetRecord(RECORD.JOB).IsChanged;.

Furthermore, the code JOB.EMPLID.Visible = False; is evaluated as if it were GetField(JOB.EMPLID).Visible = False;.

Local Array of Number &A1, &A2; &A1 = CreateArray(2, 4, 6, 8, 10); &A2 = &A1;

If the next statement is &A2[5] = 12; then &A1[5] also equals 12, as shown in the following diagram:

The following example is not considered an object assignment:

Local number &NUM; Local Array of Number &A1; &A1 = CreateArray(2, 4, 6, 8, 10); &NUM = &A1[3]; &NUM is of data type Number, which is not an object type. If you later change the value of &NUM in the program, you won't change the element in the array. ----------

Page 44: IQ 2011 BY GVR

Page | 44

Peoplesoft Interview Questions

Local Rowset &RS; Local Record &REC; Function Process_RowSet(& ROWSET as Rowset); For &I = 1 To &ROWSET.Rowcount For &J = 1 To &ROWSET.Recordcount &REC = &ROWSET.GetRow(&I).GetRecord(& J); &REC.Update(); End-For; End-For; End-Function; &RS = GetLevel0(); Process_RowSet(& RS);

If a function is passed an object, the function works on the actual object, not on a copy of the object. Component buffers get loaded while opening a component. Four Data Buffer Classes: Rowset à Row à Record àField.

• Component buffer is the area in memory that stores data for the currently active component.

• The component buffer 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.

• Whenever changes are made to the data on the component page the data on the component buffer also changes but the database is not affected, only on pressing save button the database is updated.

• The component buffer is structured and the contents of the data buffer are loaded using “Depth-first” algorithm.• The buffer starts at level 0 and drills down to lower levels row by row in a parent to child manner.

They are divided into the following types:• Message Catalog Functions, Component Buffer Functions, Logical Functions• Date and Time Functions, String Functions, Number Functions---Security Functions, Internet Functions

Message Catalog: One central place to store all messages. Also allows the messages to be reused.MsgGet Function: Syntax: MsgGet(message_set, message_num, default_msg_txt[, paramlist])

Page 45: IQ 2011 BY GVR

Page | 45

Peoplesoft Interview Questions

MessageBox: Syntax: MessageBox(style, title, message_set, message_num, default_txt [, paramlist])

MsgGetText: MsgGetText(message_set, message_num, default_txt [, paramlist])

Component Buffer Functions:Getlevel0(), GetRowset(Rowset_name), ActiveRowCount , GetRecord(Recname), GetField(Fieldname)Logical Functions: All(fieldlist), None, OnlyOne , AllOrNone , OnlyOneOrNone String Functions: Substring: Substring( source_str, start_pos, length) Eg – Substring( “PeopleSoft”, 3,4);Rtrim: Rtrim(source_str[, trim_str]) Eg – Rtrim ( “Peoplesoft”[, “soft”])Ltrim: Ltrim(source_str[, trim_str]) Eg – Ltrim (“PeopleSoft”, [, “People”])Find: Find(string, within_string [, number]) Eg – Find (“e”,“PeopleSoft”,) Eg – Find (“e”, “PeopleSoft”,3)Len: Len(string) Eg – Len (“PeopleSoft”) will set length to 10.The difference between the variable declarations concerns their life spans:

• Global: The variable is valid for the entire session. • Component: The variable is valid while any page in the component in which the variable is defined stays active. • Local: The variable is valid for the duration of the PeopleCode program or function in which the variable is defined.

• Blue Rectangles Represent actions taken by the system.

• Dark rohmboids represent branches (decision points) in the logic.

• Dark ellipses represent peoplecode events.

• Light ellipses are subprocesses.

The Component Processor’s flow of execution begins when a user selects a component from a PeopleSoft menu.The Component Processor then:Performs search processing. Retrieves the data reqd to build the component from the database.Performs additional processing.Displays the component and waits for user action. Row Insert Processing,Row Delete Processing,Field Modification,Prompts,Pop-up Menu Display,Item Selected Processing,Push Button,Save Processing.

Page 46: IQ 2011 BY GVR

Page | 46

Peoplesoft Interview Questions

Page 47: IQ 2011 BY GVR

Page | 47

Peoplesoft Interview Questions

Learning PeopleCode Language

Events & Execution Flow PeopleCode Concepts: Data types. Statements. Functions. Expressions. Operators. Built-in Functions Classes Exception Handling Debugging

Page 48: IQ 2011 BY GVR

Page | 48

Peoplesoft Interview Questions

Data Types 1. Conventional data types. 2. Object data types.Conventional Data Types There are many data types available and the most commonly used data types are :

• Any : Undeclared local variables are Any by default. • Boolean, Date, DateTime, Float, Integer, Number, Object, String, Time.

Object based data types are : Field, Record, Row, Rowset, Grid, Page, Array, File, SQL

PeopleCode Comments: /* ……Statement ….*/

– You can surround comments with /* at the beginning and */ at the end.Ex: /* ----- Logic for Compensation Change ----- */

/* Recalculate compensation change for next row. Next row is based on prior value of EFFDT. */

Rem or Remark– You can also use a REM (remark) statement for commenting. Put a semicolon at the end of a REM comment. – Note: If you do not, everything up to the end of the next statement is treated as part of the comment.

Ex: REM This is an example of commenting PeopleCode; Operators: mathematical -> +,-,*,/,**,| comparison -> =,!=,<>,>=,<=,<,>

logical -> NOT,AND,OR Note:- PeopleCode applied NOT operator first ,then ANDs ,and the ORs. You can use parenthesis to explicitly define the order of precedence.

Branching Statements: Branching statements control program flow based on evaluation of conditional expressions.

– If, Then, and Else– Evaluate– For

• if Statement: syntax: if <condition>stmt1;

else stmt2;

end-if;• break statement: syntax: break;

• Evaluate Statement

Evaluate <field or variable>when = <value1> stmt1; break;when = <value2> stmt2; break;when-other stmt3;break;End-Evaluate;Looping Statementsloop type syntax

• while while <condition> stmt1; stmt2; end-while;• repeat-until repeat stmt1; stmt2; until <condition>;• for for <&variable> = <start-value> to <end-value> [Step stepvalue>]

stmt1; stmt2; end-for; Error Statements Syntax : Error(“<message>”); Warning Statements Syntax: warning(“<message>”);peoplecode variables:Types NUMBER,STRING,DATE,TIME,DATETIME,ANYScope Local Variables Global Variables Component VariablesOther Variables System Variables Derived/Work FieldsNaming Rules must begin with & and max length 18 characters including &Declarations always on top . Can have only comments above it.

Page 49: IQ 2011 BY GVR

Page | 49

Peoplesoft Interview Questions

Syntax: <scope> <type> &<variable_name>Scope of VariablesLocal Variables: existence limited to current PC program runtime assignment. Also called chameleon variables as they can be assigned values of any date type within the program.Global Variables: exist for the complete session and are used to transfer values between panel groups.Component Variables: exist for the duration of the current PS component. Used to transfer values between programs on the same component.System Variables -internally maintained and can be referred by the peoplecode any time. -Begin with %. Ex: %Date,%Time,%Panel,%Menu etc.Derived/Work Fields -used when we need to pass values from one program to another without the field values being stored in the database. -Existence limited to the current component. -They are usually display only fields on a page or have them as invisible fields on the page.

Functions: User defined functions,Built-in FunctionsUser defined functions

Internal PC: PeopleCode functions contained within the same program where they are used. External PC: PeopleCode functions contained in a different program from where they are used.Stored as Function Libraries( derived/work records) named with prefix “FUNCLIB_” convention and defined in the

FieldFormula Event. External-Non-PC: These are routines or functions written in other language like C and loaded from a DLL (Dynamic

Link Librabies). Defined by the statement Declare....... Library .

Syntax for defining or writing a function • Function should be defined in the beginning of the code in FieldFormula event.• We can have only comments lines preceding the function definition.

Function <function_name> (<param1,<param2>....) stmt1; stmt2; return <expression>; End-Function;Syntax for Declaring a Function

• This should be the first statement in the event where an external function is used.Declare Function <function_name> PeopleCode <Record_name.FieldName>.FieldFormula

• Component Buffer Functions:Used to manipulate scroll bar records rather than the entire component’s data.Example: ScrollSelect(), ActiveRowCount() , TotalRowcount()..etc.,

Logical Functions:Used to check if values exist for a field.Example: None(), All() , OnlyOne(), AllorNone() , OnlyoneorNone()• Date & Time Functions:Used to calculate and manipulate dates. AddToDate(date,num_years,num_months,num_days) String Functions :Used to manipulate character Strings, Substring(Source str,start_pos,length)• Math Functions:Used to perform mathematical calculations- Sine(),abs(),Max(),Min()• Security Functions: Used for security purpose.-- Hide(),Unhide(),Gray(),Ungray()

Message Catalog and Message Display: Error MessageBox MsgGet MsgGetText MsgGetExplainText Warning WinMessage Message Catalog and Message Display

Error Syntax: Error st – Use the Error function in FieldEdit or SaveEdit PeopleCode to stop processing and display an error message. It is distinct from Warning,

which displays a warning message, but does not stop processing. --Error is also used in RowDelete and RowSelect PeopleCode events. – Errors in Other Events : Do not use the Error function in any of the remaining events, which include:

– FieldDefault - RowInit - FieldChange -Prepopup - RowInsert – SavePreChange - SavePostChange

Message Catalog and Message Display Warning Syntax: Warning str

– The primary use of Warning is in Field Edit and SaveEdit PeopleCode. In FieldEdit, Warning displays a message and highlights the relevant field.

– In SaveEdit, Warning displays a message, but does not highlight any field. You can move the cursor to a specific field using the SetCursorPos function.

– Warnings in Other Events: Do not use the Warning function in any of the remaining events, which include: – FieldDefault - RowInit -FieldChange - RowInsert --SavePreChange - SavePostChange

Warning Example

If All(RETURN_DT, BEGIN_DT) and 8 * (RETURN_DT - BEGIN_DT) < (DURATION_DAYS * 8 + DURATION_HOURS) then Warning ( "Duration of absence exceeds standard hours for number of days absent."); End-if;

Page 50: IQ 2011 BY GVR

Page | 50

Peoplesoft Interview Questions

Message Catalog and Message Display WinMessage Syntax: WinMessage(message [, style] [, title]) – The WinMessage function is supported for compatibility with previous releases of PeopleTools. New applications should

use MessageBox instead. – Use the WinMessage function to display a message in a message box. – Winmessage cannot be used in the following PeopleCode events: - SavePreChange. RowSelect. - SavePostChange.

Example &RESULT = WinMessage(MsgGetText(30000, 1, "Message not found."), 4, "Test Application");

MsgGet Syntax: MsgGet(message_set, message_num, default_msg_txt [, paramlist])where paramlist is an arbitrary-length list of parameters of undetermined (Any) data type to be substituted in the

resulting text string, in the form: param1 [, param2] – Use the MsgGet function to retrieve a message from the PeopleCode Message Catalog and substitutes in

the values of the parameters into the text message. – Message sets 1 through 19,999 are reserved for use by PeopleSoft applications. Message sets 20,000

through 32,767 can be used by PeopleSoft usersExample &MsgText = MsgGet(30000, 2, "Message not found");

Logical All, AllOrNone, None, OnlyOne , OnlyOneOrNone All : All(fieldlist) Where fieldlist is an arbitrary-length list of field names in the form: [recordname.]fieldname1 [, [recordname.]fieldname2] ... Returns: Returns a Boolean value based on the values in fieldlist. The All function returns True if all of the specified fields have a value; it returns False if any one of the fields does not contain a value. Example: The All function is commonly used in SaveEdit PeopleCode to ensure that a group of related fields are all entered. example: If All(RETURN_DT, BEGIN_DT) and 8 * (RETURN_DT - BEGIN_DT) (DURATION_DAYS * 8 + DURATION_HOURS) Then Warning MsgGet(1000, 1, "Duration of absence exceeds standard hours for number of days absent."); End-if;AllOrNone: AllOrNone(fieldlist) Where fieldlist is an arbitrary-length list of field references in the form: [recordname.]fieldname1 [, [recordname.]fieldname2] ...

• The AllOrNone function takes a list of fields and returns True if either of these conditions is true:All of the fields have values OR None of the fields has a value. For example, if field1 = 5, field2 = "Mary", and field3 = null, AllOrNone returns False.

• Returns a Boolean value: True if all of the fields in fieldlist or none of the fields in fieldlist has a value, False otherwise. Example :You could use AllOrNone as follows:

If Not AllOrNone(STREET1, CITY, STATE) Then WinMessage("Address should consist of at least Street (Line 1), City, State, and Country."); End-if;None : None(fieldlist) Description: None returns True if none of the specified fields contain a value. It returns False if any one of the fields contains a value. A blank character field, or a zero (0) numeric value in a required numeric field is considered a null value.Example: The following example uses None to check whether REFERRAL_SOURCE has a value:If None(REFERRAL_SOURCE) or REFERRAL_SOURCE = "EE" Then Gray(EMP_REFERRAL_ID); End-if;The following example uses None with a variable:&ONETIME = FetchValue(POSN_INCUMB_WS.EMPLID, 1); --If None(&ONETIME) Then /* do processing */ End-if;OnlyOne : OnlyOne(fieldlist) Description: Use the OnlyOne function to check a list of fields and return True if one and only one of the fields has a value. If all of the fields are empty, or if more than one of the fields has a value, OnlyOne returns False. This function is used to validate that only one of a set of mutually exclusive fields has been given a value. A blank character field, or a zero numeric value in a required numeric field is considered a Null value.Example: You typically use OnlyOne as follows: If OnlyOne(param_one, param_two) Then value_a = "y"; End-if;OnlyOneOrNone Syntax: OnlyOneOrNone (fieldlist) Where fieldlist is an arbitrary-length list of field names in the form: [recordname.]fieldname1 [, [recordname.]fieldname2] ... – Use the OnlyOneOrNone function to check a list of fields and return True if either of these conditions is true:Only one of the fields has a value (OR) None of the fields has a valueExecutable Files Functions: Exec, WinExec , Mailing Functions: Sendmail Executable Files Functions: Exec Syntax: Exec(command_str [, parameter]) ….. where parameter has one of the following formats: --Boolean constant --Exec_Constant + Path_Constant

– Exec is a cross-platform function that executes an external program on either UNIX or Windows

Page 51: IQ 2011 BY GVR

Page | 51

Peoplesoft Interview Questions

– When Exec is used to execute a program synchronously (that is, if its synch_exec parameter is set to True) it behaves as a think-time function, which means that it can’t be used in any of the following PeopleCode events: SavePreChange. SavePostChange. Workflow. RowSelect.

SQL Functions: SQLExec, CreateSQL, GetSQL , DeleteSQL SQLExec: SQLExec({sqlcmd | SQL.sqlname}, bindexprs, outputvars) where bindexprs is a list of expressions, one for each :n reference within sqlcmd or the text found in the SQL definition sqlname, in the form: inexpr_1 [, inexpr_2]. . . and outputvars is a list of variables, record fields, or record object references, one for each column selected by the SQL command, in the form: out_1 [, out_2]. . .

• Use the SQLExec function to execute a SQL command from within a PeopleCode program by passing a SQL command string.• The PeopleSoft record name specified in the SQL SELECT statement must be in uppercase• SQLExec commands go directly to the database server, not to the Component Processor

Bind Variables in SQLExec: – Bind variables are references within the sqlcmd string to record fields listed in bindvars. Within the string, the bind variables are integers

preceded by colons like :1, :2,. . . ---The integers need not be in numerical order.– Bind variables can be used to refer to long character (longchar) fields. Long character fields are represented in PeopleCode as strings– You should use %TextIn() Meta-SQL to ensure these fields are represented correctly on all database platforms.– Bind variables can be passed as parameters to meta-SQL functions

Example: SQLExec(". . .%datein(:1). . .", START_DT, &RESULT)SQLExec("Select sum(posted_total_amt) from PS_LEDGER where deptid between :1 and :2", DEPTID_FROM, DEPTID_TO, &SUM);Limitations of SQLExec

– SQLExec can only Select a single row of data. If your SQL statement (or your SQL.sqlname statement) retrieves more than one row of data, SQLExec sends only the first row to its output variables.Any subsequent rows are discarded.

– If you need to SELECT multiple rows of data, use the CreateSQL or GetSQL functions and the Fetch SQL class method.– SQLExec statements that result in a database update (specifically, UPDATE, INSERT, and DELETE) can only be issued in the following

events: SavePreChange,WorkFlow ,SavePostChange ,FieldChange

PeopleCode Classes & Objects: Declarations, Scope of the Variable , Built-In functions, Methods , Properties

OO Data Types: There are many Object based data types but the most used are the following: • Field, Record, Row , RowSet , File, Chart , Object , Grid , GridColumn , SQL

Variable Declaration: Declaration : Syn : Local / Global / Component datatype &InstanceEx : Local record &rec; Classes:Array Class, Field Class, Record Class, Row Class, RowSet Class, Page Class, Grid Class, Chart Class, SQL Class, File ClassArray Class: This chapter provides an overview of arrays and discusses how to: Create arrays., Populate an array. Remove items from an array. Create empty arrays. Create and populate multi-dimensional arrays. Declare array objects. Understand the scope of an array object. Use array class built-in functions. Use array class methods. Use array class propertiesDeclaration: Local Array of Number &MYARRAY; Local Array &ARRAYANY;Two Dimensional Array Local Array of Array of Number &MYARRAY; Built-In Functions : 1. Createarray( &temp) 2. Createarrayrept(&temp , size) 3. Split(string , seperator) 4. CreateArrayAny from 8.4 onwardsMethods : 1. Push ( ) : Use the Push method to add items to the end of the array. Ex : Local Array of Number &MYARRAY; Local Number &MYNUM; &MYARRAY = CreateArrayRept(&MYNUM,0);

/* this creates an empty array of number */&MYARRAY.Push(100);&MYARRAY.Push(200);&MYARRAY.Push(300);

2. Unshift ( ) : Use the Unshift method to add items to the beginning of the array: Local Array of Number &MYARRAY; Local Number &MYNUM; &MYARRAY = CreateArrayRept(&MYNUM, 0);

/* this creates an empty array of number */&MYARRAY.Unshift(300); &MYARRAY.Unshift(200); &MYARRAY.Unshift(100);

3. POP ( ) : Use the POP method to select and remove an element from the end of an arrayLocal Array of Number &MYARRAY; &MYARRAY = CreateArray(); &MYARRAY[1] = 100; &MYARRAY[2] = 200; &MYARRAY[3] = 300; &ANSWER = &MYARRAY.Pop(); &ANSWER will equal 300.4. SHIFT method to select and remove an element from the beginning of an arrayLocal Array of Number &MYARRAY; &MYARRAY = CreateArray(); &MYARRAY[1] = 100; &MYARRAY[2] = 200;

Page 52: IQ 2011 BY GVR

Page | 52

Peoplesoft Interview Questions

&MYARRAY[3] = 300; &ANSWER = &MYARRAY.Shift(); &ANSWER equals 100.

Field Class: Declaration : Local field &Myfield; Built-In function : Getfield Syntax : GetField ([recname.fieldname])Example: Local Field &Myfield; &Myfield = GetField(dept_tbl.deptid);Methods1. GetLongLabel Syntax : GetLongLabel(LabelID) 2. GetRelated Syntax : GetRelated(recname.fieldname) 3. GetShortLabel Syntax : GetShortLabel(LabelID) 4. SetCursorPos Syntax : SetCursorPos(PAGE.pagename | %Page)5. SetDefault Syntax : SetDefault( ) Properties : 6. DisplayFormat : Ex : If %Component = PAGE.INTERNATIONAL

&CHAR.DisplayFormat = "STANDARD"; Else &CHAR.DisplayFormat = "UNFORMATTED"; End-If;7. DisplayOnly 8. Enabled : This property is read-write. Example :&CHARACTER.Enabled = True; &CHARACTER.Enabled = False;9. FieldLength : This property returns the length of the field as a number. 10. IsChanged : This property returns True if the value for the field has been changed. This property is read-only.Example : If &CHARACTER.IsChanged Then Warning ("The character field has been changed"); End-If;11. IsInBuf : Ex : For &I = 1 to &REC.FieldCount

&FIELD = &REC.GetField(&I); If &FIELD.IsInBuf Then &VALUE = &FIELD.Value; End-If; End-For;

12. Value : This property contains the current value of the field, converted to an appropriate PeopleCode data type.

Record Class Declaration : Local Record &rec; Built-In Functions : 1. Getrecord ( ) 2. CreateRecord( ) CreateRecord ( ) Syntax : CreateRecord(RECORD.recname)Description : CreateRecord creates a free standing 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. However, if you are calling this function from PeopleCode associated with a page, the record does not have to be included on the current page.GetRecord Syntax : GetRecord([RECORD.recname])Description : GetRecord creates a reference to a record object for the current context, that is, from the row containing the currently executing program. The following code: &REC = GetRecord(); is equivalent to:

&REC = GetRow().GetRecord(Record.recname); or &REC = GetRow().recname;Ex : &FLAGS = CreateRecord(RECORD.DR_LINE_FLG_SBR);

&REC.CopyFieldsTo(&FLAGS); &INFO = GetRecord(@("RECORD." | &NAME));If All(&INFO) Then &FLAGS.CopyFieldsTo(&INFO); End-If;

Methods :1. CompareFields Syntax : CompareFields(recordobject) Returns A Boolean value; True if all like-named fields have the same value.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; 2. Delete( ) : Ex : Local record &REC;

&REC = CreateRecord(RECORD.MYRECORD);&REC.KEYF1 = "A"; &REC.KEYF2 = "X"; &REC.Delete();

3. Update ( ) : Local record &REC;&REC = CreateRecord(RECORD.MYRECORD);&REC.KEYF1.Value = "A";&REC.KEYF2.Value = "B";&REC.MYRF3.Value = "X";&REC.MYRF4.Value = ”Y";&REC.Update();

4. Insert( ): Local record &REC;&REC = CreateRecord(RECORD.MYRECORD);&REC.KEYF1.Value = "A";&REC.KEYF2.Value = "B";&REC.MYRF3.Value = "X";&REC.MYRF4.Value = "Y";&REC.Insert();

5. SelectByKey( ): Local record &REC;&REC = CreateRecord(RECORD.MYRECORD);&REC.KEYF1.Value = "A";&REC.KEYF2.Value = "X";&REC.SelectByKey();

6. SetDefault() Description : SetDefault sets the value of every field in the record to a null value, Ex : &Rec.SetDefault();Record Properties :1. FieldCount : This property returns the total number of fields contained in the record. This value is a number.2. IsChanged : This property returns True if any field value on the primary database record of the row has been changed. Ex : If &REC.IsChanged Then Warning("This Record has been changed"); End-if;

Page 53: IQ 2011 BY GVR

Page | 53

Peoplesoft Interview Questions

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 zero rowset. Declaration : Local Rowset &rs;Built-In Functions : 1. GetRowset ( ) 2. CreateRowset( ) 3. Getlevel0( ) CreateRowset ( ) Syntax : CreateRowset(RECORD.recname) Description : CreateRowset creates a non-populated standalone rowset .

A standalone rowset is a rowset that has the specified structure, but is not tied to any data (that is, to the component buffer or to a message.) In addition, a standalone rowset isn’t tied to the Component Processor. If a rowset object is instantiated using the CreateRowset function, the rowset object that’s 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. GetRowset() Syntax : GetRowset([RECORD. recname ]) Description : GetRowset creates a reference to a rowset object for the current context, that is, from the rowset containing the currently executing program. The following code : 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); If a rowset object is instantiated using GetRowset (either the function or one of the methods) the rowset object that is instantiated is populated with data according to the context in which it was instantiated

Row Class Declaration : local Row &Myrow; Built-In Function : GetRow ( )Use the GetRow function to obtain a row object for the current context, that is the row containing the currently executing program. GetRow() function is equivalent to: &ROW = GetRowset().GetRow(CurrentRowNumber());/*Object oriented code */ Local Rowset &l0, &L1, &L2; Local Field &f; Local number &i, &K, &J;&l0 = GetLevel0(); /* Zero Level */ For &J = 1 To &l0.ActiveRowCount /* For all Zero Level rows */ &L1 = &l0.GetRow(&J).GetRowset(Scroll.K_PROJ_TASK_TBL); /*create rowset for first level */ /* Indicates first level record field */ &f = &L1.GetRow(&J).GetRecord(Record.K_PROJ_TASK_TBL).GetField (Field.K_H_TASK_STATUS); For &K = 1 To &L1.ActiveRowCount /* For First Level Rowset Rows *//* Create the Row set for second level */ &L2 = &L1.GetRow(&K).GetRowset(Scroll.PROJTASK_RESTBL); If &f.Value = "C" Then &L2.HideAllRows(); /* Hide the second level scroll */ Else &L2.ShowAllRows(); /* Unhide the Second Level Scroll */ End-If; End-For; End-For;/*Procedure oriented code */&J = CurrentRowNumber(1); /* Current Row number at level 1 */If K_PROJ_TASK_TBL.K_H_TASK_STATUS = "C" Then HideScroll(Record.K_PROJ_TASK_TBL, &J, Record.PROJTASK_RESTBL); /* Hide the Second Level Scroll */Else UnhideScroll(Scroll.K_PROJ_TASK_TBL, &J, Record.PROJTASK_RESTBL); /* Unhide the Second Level Scroll */ End-If; */Function DISPLAY_RECONCILE_DATA(&emplid As string, &penddt As date, &bugl As string, &flg As string)/* Create the Row Set for Level 1 (Grid) */ &rsSummary = GetLevel0()(1).GetRowset(Scroll.K_SUBCN_RECON); &rsSummary.Flush(); /* Flush The Grid *//* To select the rows and populates these rows in Grid */&rows = &rsSummary.Select(Record.K_SUBCN_RECON, "where emplid like :1 and business_unit_gl like :2 and k_recon_status like :3 and period_end_dt = :4", &emplid, &bugl, &flg, &penddt); End-function;File Class File Class : topics:

File object declaration , Scope of a file object File layout , File security considerations

File access interruption recovery,Plain text files,Automatic PeopleCode generation,File layout error processing,File class built-in functions,File class methods,File class properties,File layout examples,Multiple file layoutsData Type of a File Object : Local File &MYFILE; Scope :Local File &F1, &F2; &F1 = GetFile("somefile.txt", "R"); &F2 = &F1;

&F2.Close(); /* Now &F1 is also closed. */Built-in Function : Syntax : GetFile(filename, mode [, charset] [, pathtype]) --

pathtype : %FilePath_Relative (default) , %FilePath_Absoulte ; If you don't specify pathtype the default is %FilePath_Relative. PeopleTools supports reading and writing to plain text files, and to files that have a format based on a File Layout that has been created in PS Application Designer.

If the file is a plain text file, data is read or written using text strings. If the file is based on a File Layout, you can use text strings, rowset, or record objects.

This simplifies reading, writing, and manipulating hierarchical transaction data with PeopleCode.

Page 54: IQ 2011 BY GVR

Page | 54

Peoplesoft Interview Questions

Plain Text Files:To read and write from plain text files involves reading and writing strings of data. These text strings can be manipulated with built-in string functions, like RTrim, Find, Replace, and so on.Note. If your data is hierarchical in nature, or based on existing PeopleSoft records or pages, use a File Layout definition for reading and writing your data, rather than doing it line by line (or field by field.) The following example creates an array of array of string, then reads in two files, one into each "column" of the array. The Names file contains names; the Numbers file contains employee numbers. The ReadLine method reads each successive line in a file, until it reaches the end of the file. Notice that the first file is opened using GetFile. The second file is not opened using GetFile, but rather with Open. After the data is read into the array, you can do processing on the data. The end of the program writes the changes back to the files, using the WriteLine method, which includes a system end of line character at the end of every line. Local array of array of string &BOTH; Local File &MYFILE; Local string &HOLDER;/* Create empty &BOTH array */ &BOTH = CreateArrayRept(CreateArrayRept("", 0), 0);/* Read first file into first column */ &MYFILE = GetFile("names.txt", "R");While &MYFILE.ReadLine(&HOLDER); &BOTH.Push(&HOLDER); End-While;/* read second file into second column */&MYFILE.Open("numbers.txt", "R"); &LINENO = 1;While &MYFILE.ReadLine(&HOLDER); If &LINENO > &BOTH.Len Then/* more number lines than names, use a null name */&BOTH.Push(CreateArray("", &HOLDER)); Else &BOTH[&LINENO].Push(&HOLDER); End-If;&LINENO = &LINENO + 1; End-While;/* if more names than numbers, add null numbers */For &LINENO = &LINENO to &BOTH.Len &BOTH[&LINENO].Push(""); End-For; &MYFILE.Close();/* do processing with array */ /* write data back to files */ &MYFILE1 = GetFile("names.txt", "A"); &MYFILE2 = GetFile("numbers.txt", "A");/* loop through array and write to files */For &I = 1 To &BOTH.Len &STRING1 = &BOTH[&I][1]; &MYFILE1.writeline(&STRING1); &STRING2 = &BOTH[&I][2];&MYFILE2.writeline(&STRING2); End-For; &MYFILE1.Close(); &MYFILE2.Close(); Built-in Functions: FileExists GetFile FindFiles FileExists Syntax: FileExists(filename [, pathtype])Ex: The following example opens a file for appending if it exists on the system:

If FileExists("c:\work\item.txt", %FilePath_Absolute) Then &MYFILE = GetFile("c:\work\item.txt", "A");/* Process the file */ &MYFILE.Close(); End-If;

FindFiles Syntax: FindFiles(filespec_pattern [, pathtype]) Ex : Local array of string &FNAMES; Local file &MYFILE; &FNAMES = FindFiles("\*.txt");

while &FNAMES.Len > 0 &MYFILE = GetFile(&FNAMES.Shift(), "R"); /* Open each file *//* Process the file contents */ &MYFILE.Close(); end-while;

GetFile: Syntax: GetFile(filename, mode [, charset] [, pathtype])File Class Methods 1. Close Syntax : Close() Ex : &MYFILE.Open("somefile.txt", "W", %FilePath_Relative); &MYFILE.WriteLine("Some text."); &MYFILE.Close();2. Open Syntax Open(filespec, mode [, charset] [, pathtype])Description : The Open method associates the file object with an external file for input or output. EX : MYFILE.Open("C:\temp\item*.txt", "N", %FilePath_Absolute); If &MYFILE.IsOpen Then &MYFILE.WriteLine("Some text."); &MYFILE.Close(); End-If;3. Readline : Syntax : ReadLine(string)Description : The ReadLine method reads one line of text from the external file. Example : The following example reads a file called &MYFILE and puts each line as a separate element in an array.Local File &MYFILE; Local array of string &MYARRAY; Local string &TEXT;&MYFILE = GetFile("names.txt", "R"); &MYARRAY = CreateArrayRept("", 0); While &MYFILE.ReadLine(&TEXT);&MYARRAY.Push(&TEXT); End-While; &MYFILE.Close(); 4. WriteLine : Syntax : WriteLine(string);Description : The WriteLine method writes one string of text, string, to the output file Ex : &MYFILE.Open("somefile.txt", "A"); &MYFILE.WriteLine("This is the last line in the file."); &MYFILE.Close();5. WriteRecord Syntax : WriteRecord(record)Description: The WriteRecord method is a file layout method. It writes the contents of the record object record, to the output file. Example: The following example appends all the data in a record to an existing file:

Local File &MYFILE; &MYFILE = GetFile("record.txt", "A");If &MYFILE.IsOpen Then If &MYFILE.SetFileLayout(FILELAYOUT.VOL_TEST) Then

&LN = CreateRecord(RECORD.VOLNTER_ORG_TBL); &SQL2 = CreateSQL("%Selectall(:1)", &LN);While &SQL2.Fetch(&LN) &MYFILE.WriteRecord(&LN); End-While;

Else /* do error processing — filelayout not correct */ End-If;

Page 55: IQ 2011 BY GVR

Page | 55

Peoplesoft Interview Questions

Else /* do error processing — file not open */ End-If; &MYFILE.Close();

7. ReadRecord : Ex :"8001","VAC","09/12/1981","09/26/1981","14","0","","P","Y","" "8001","VAC","03/02/1983","03/07/1983","5","0","","P","Y","" "8001","VAC","08/26/1983","09/10/1983","13","0","","P","Y","" "8105","CNF","02/02/1995","??/??/","0","0","","U","N","" To read in the previous CSV file we use the following PeopleCode. It reads the file into a temporary record. First each line of the file is read into a string. The string is split into an array, with the value of each field in the array becoming an element in the array. The value of each field in the record is assigned a value from the array. After additional processing (for example, converting strings into dates or numbers, verifying data, and so on) the record can be inserted into the database. To insert the final data into the database, this code must be associated with a PeopleCode event that allows database updates, that is, SavePreChange, WorkFlow, SavePostChange, and so on. This code could also be used as part of an Application Engine program.

Local File &MYFILE; Local Record &REC; Local array of string &ARRAY;&MYFILE = GetFile("c:\temp\vendor.txt", "R", %FilePath_Absolute);&REC = CreateRecord(RECORD.ABS_HIST_TEST); &ARRAY = CreateArrayRept("", 0);If &MYFILE.IsOpen Then

If &MYFILE.SetFileLayout(FILELAYOUT.ABS_HIST) ThenWhile &MYFILE.ReadLine(&STRING); &ARRAY = Split(&STRING, ","); For &I = 1 To &REC.FieldCount &REC.GetField(&I).Value = &ARRAY[&I]; End-For;

/* do additional processing here for converting values */ &REC.Insert(); End-While;Else /* do error processing — filelayout not correct */ End-If;

Else /* do error processing — file not open */ End-If; &MYFILE.Close();

SQL Class : This chapter provides an overview of the SQL class and discusses the following topics: Declaring a SQL object Scope of a SQL object SQL class built-in functions SQL class methods SQL class properties

Declaration : SQL objects are declared as type SQL. For example: Local SQL &MYSQL; Scope : An SQL object can be instantiated only from PeopleCode. SQL Class Built-In Functions : 1. CreateSql 2. DeleteSql 3. GetSql 4. FetchSql 5. StoreSql 1. CreateSql : CreateSQL([sqlstring [, paramlist]]) Where paramlist is an arbitrary-length list of values in the form: inval1 [, inval2] …

The CreateSQL function instantiates a SQL object from the SQL class and opens it on the given sqlstring and input values. sqlstring is a PeopleCode string value giving the SQL statement.Ex : This SQL object should be used in a series of Fetch method calls: Local SQL &SQL;

&SQL = CreateSQL("%SelectAll(:1) where EMPLID = :2", RECORD.ABSENCE_HIST, &EMPLID);This SQL object has been opened, bound, and is already closed again:&SQL = CreateSQL("Delete from %Table(:1) where EMPLID = :2", RECORD.ABSENCE_HIST, &EMPLID);This SQL object should be used in a series of Execute method calls:&SQL = CreateSQL("Delete from %Table(:1) where EMPLID =:2"); 2. DeleteSQL : Syntax DeleteSQL([SQL.]sqlname[, dbtype[, effdt]])Description : The DeleteSQL function enables you to programmatically delete a SQL definition. Ex : The following code deletes the ABCD_XY SQL definition for the current DBType and as of date:&RSLT = DeleteSQL(SQL.ABC_XY);If NOT(&RSLT) Then /* SQL not found — do error processing */ End-if;The following code deletes the ABCD_XY SQL Definition for the current DBType and November 3, 1998:&RSLT = DeleteSQL(SQL.ABCD_XY, "",Date(19981103));3. FetchSQL Syntax : FetchSQL([SQL.]sqlname[, dbtype[, effdt]] )Description : The FetchSQL function returns the SQL definition with the given sqlname as SQL.sqlname or a string value, matching the dbtype and effdt. If sqlname is a literal name, it must be in quotes.Returns The SQL statement associated with sqlname as a string.Example: The following code gets the text associated with the ABCD_XY SQL Definition for the current DBType and as of date:&SQLSTR = FetchSQL(SQL.ABC_XY);The following code gets the text associated with the ABCD_XY SQL Definition for the current DBType and November 3, 1998:&SQLSTR = FetchSQL(SQL.ABCD_XY, "", Date(19981103));

Page 56: IQ 2011 BY GVR

Page | 56

Peoplesoft Interview Questions

4. GetSQL : Syntax : GetSQL(SQL.sqlname [, paramlist])Where paramlist is an arbitrary-length list of values in the form: inval1 [, inval2] ...Description : The GetSQL function instantiates a SQL object and associates it with the SQL definition specified by sqlname. The SQL definition must already exist, either created using PeopleSoft Application Designer or the StoreSQL function.Processing of the SQL definition is the same as for a SQL statement created by the CreateSQL function.For example, suppose you had a SQL definition INSERT_TEST, that had PeopleCode that dynamically (that is, at runtime) generated the following SQL statement:"INSERT INTO PS_TESTREC (TESTF1, TESTF2, TESTF3, TESTF4, . . .TESTN) VALUES (:1, :2, %DateTimeIn(:3), %TextIn(:4). . .N)"; Suppose you have placed the values to be inserted into an Array of Any, say &AAny:&AAny = CreateArrayAny("a", 1, %DateTime, "abcdefg", . . .N);You can execute the insert by: GetSQL(SQL.INSERT_TEST, &AAny);5. StoreSQL : StoreSQL(sqlstring, [SQL.]sqlname[, dbtype[, effdt]])Description : The StoreSQL function writes the given sqlstring value to a SQL definition, storing it under the name sqlname, with the database type dbtype and the effective date effdt. If sqlname is a literal name, it must be in the form SQL.sqlname or in quotes ("sqlname"). Returns : None.Example : The following code stores the select statement as a SQL definition under the name SELECT_BY_EMPLID, for the current database type and effective as of the current as of date: StoreSQL("%Select(:1) where EMPLID = :2", SQL.SELECT_BY_EMPLID);SQL Class Methods:1. Close : Syntax : Close() Description : The Close method closes the SQL object. Example : &SQL = CreateSQL("%Delete(:1)");

While /* Still something to do */ /* Set key field values of &ABS_HIST */&ABSSQL.Execute(&ABS_HIST); End-While; &SQL.Close();

2. Execute : Execute(paramlist), Where paramlist is an arbitrary-length list of values in the form: inval1 [, inval2] ...Description : The Execute method executes the SQL statement of the SQL object. Ex : &SQL1 = CreateSQL("%Select(:1) where EMPLID = :2", &ABS_HIST, &EMPLID);&SQL_UP = CreateSQL("%Update(:1)");

While &SQL1.Fetch(&ABS_HIST); /* Set some field values of &ABS_HIST. */&SQL_UP.Execute(&ABS_HIST); End-While; &SQL_UP.Close();

3. Fetch : Fetch(paramlist) , Where paramlist is an arbitrary-length list of values in the form: outvar1 [, outvar2] ...Description : The Fetch method retrieves the next row of data from the SELECT that is open on the SQL object. Any errors result in termination of the PeopleCode program with an error message. Note. If you want to fetch only a single row, the SQLExec function can perform better, as it fetches only a single row from the server. Local SQL &SQL; Local Record &REC; Local Array of Record &RECS;

/* Get the SQL object open and ready for fetches. */&SQL = CreateSQL("%SelectAll(:1) where EMPLID = :2", RECORD.ABSENCE_HIST, &EMPLID); /* Create the first record. */ &REC = CreateRecord(RECORD.ABSENCE_HIST); /* Create an empty array of records. */ &RECS = CreateArrayRept(&REC, 0);

While &SQL.Fetch(&REC)/* We got a record, add it to the array and create another.*/ &RECS.Push(&REC);&REC = CreateRecord(RECORD.ABSENCE_HIST); End-While;

4. Open : Open(sql [, paramlist]) Example : Generally, you use the Open method only after you've already gotten a reference to another SQL object. SELECT and SEL_ABS_HIST are the names of the SQL definitions created in PeopleSoft Application Designer.

Local SQL &SQL; &SQL = GetSQL(SQL.SELECT);/* do other processing */ /* get next SQL statement for additional processing */

/* The open automatically closes the previous SQL statement */&SQL.Open(SQL.SEL_ABS_HIST, &NAME1, "Smith");While &SQL.Fetch(&ABS_HIST) /* Process ABS_HIST record. */ End-While;

While building an Inbound/Outbound interface, most of the time we may be in dilemma whether to use Application Engine (AE) or SQR. Here are the tips to build an efficient interface using either AE or SQR.

Page 57: IQ 2011 BY GVR

Page | 57

Peoplesoft Interview Questions

This line code tranfers the manager to the search pageTransfer( False, MenuName.ROLE_MANAGER, BarName.USE, ItemName.OPRROWS_SEARCH, Page.OPRROWS_SEARCH, "U");

Hide Grid (All Rows) Local Rowset &GridRs;&GridRs = GetLevel0()(1).GetRowset(Scroll.BENEF_ASOF);--- &GridRs.HideAllRows();Populate The Secondary page using peoplecode( fieldchange)If %Menu <> "STP_HR_SELFSERV_ISSC" Then SQLExec("SELECT HINT_QUESTION, HINT_RESPONSE FROM PSUSERATTR WHERE OPRID = :1", DERIVED_HINT.OPRID, &HINT, &RESPONSE); DERIVED_HINT.HINT_QUESTION = &HINT;-- DERIVED_HINT.DESCR = &RESPONSE;-- DoModal(Panel.EMAIL_PSWD2, "", - 1, - 1); End-If;Populate data into scroll area with conditionEvaluate %ComponentWhen = Component.HR_EE_PERS_INFO ScrollFlush(Scroll.PERSONAL_PHONE); ScrollSelect(1, Scroll.PERSONAL_PHONE, Record.PERSONAL_PHONE, "WHERE EMPLID = :1 AND PHONE_TYPE <> 'MAIN'", PERSON_PHONE.EMPLID); ScrollFlush(Scroll.EMAIL_ADDRESSES); ScrollSelect(1, Scroll.EMAIL_ADDRESSES, Record.EMAIL_ADDRESSES, "WHERE EMPLID = :1 AND E_ADDR_TYPE <> 'LAN'", PERSON_NPC_VW.EMPLID); End-Evaluate;To hide the grid in the page at level 1 /* Hide the sections Personalizations,Alternate User, Workflow Attributes, Email in the page*/If %Menu = "STP_HR_SELFSERV_ALL" Or %Menu = "STP_HR_SELFSERV_ISSC" Or %Menu = "STP_HR_SELFSERV_ASSOC" Or %Menu = " STP_HR_SELFSERV_HRADMIN_BEL" Or %Menu = "STP_HR_SELFSERV_HRADMIN" And %Component = Component.USERMAINT_SELF Then Local Rowset &gridRS; PSUSRPRFL_WRK.LABEL_TEXT_LBL.Visible = False;-- &gridRS = GetLevel0()(1).GetRowset(Scroll.PSUSEREMAIL); &gridRS.HideAllRows();--- SECOTHERWORK.DESCR100.Visible = False;--- End-If;To hide the Group Box in the page--- GoàGroup box Properties-àUseà Enable the check Box(hide all fields when group box hidden) To make field as a required one /*Make the NEXT REVIEW Field as the required field*/

If %Component = Component.JOB_DATA_EMP And %Page = Page.STP_MSS_HIRE2 Then If None (PER_ORG_ASGN.C_NEXT_REVIEW_DT.Value) Then Error MsgGet (0, 0, "NEXT REVIEW Date is a required field"); End-If; End-If; /* End Staples Customization*/

To update the value in job table with Maximum EFFDTSQLExec ("UPDATE PS_JOB J SET J.JOB_ENTRY_DT = %DATEIN(:1) WHERE J.EMPLID=:2 AND J.EMPL_RCD=:3 AND J.EFFDT = (select max(B.EFFDT) From PS_JOB B where B.EMPLID = J.EMPLID AND B.EMPL_RCD = J.EMPL_RCD) AND J.EFFSEQ= (select max(A.EFFSEQ) From PS_JOB A where A.EMPLID = J.EMPLID AND A.EMPL_RCD = J.EMPL_RCD AND A.EFFDT = J.EFFDT)", STP_JOBCHNG_DAT.JOB_ENTRY_DT, STP_JOBCHNG_DAT.EMPLID, STP_JOBCHNG_DAT.EMPL_RCD);

Adding required field cue to field C_WOTCIf %Component = Component.JOB_DATA Then-- &REG_REGION = FetchValue(JOB.REG_REGION, &MostCurrent); &FLSA_STATUS = FetchValue(JOB.FLSA_STATUS, &MostCurrent);-- If &REG_REGION = "USA" And &FLSA_STATUS = "N" Then PER_ORG_ASGN.C_WOTC.ShowRequiredFieldCue = True; End-If; End-If; Make thstBirthDate field is Readonly DERIVED_STP.YEAR.DisplayOnly = TrueSet the grid column label. This needs to be done because when you set the values for the hyperlink, the grid column heading also gets changed &GRID = GetGrid(Panel.HR_EMERGENCY_CNTCT, "EMERGENCY_CNTCT");-- &GRIDCOLUMN = &GRID.GetColumn("CONTACT");&GRIDCOLUMN.Label = MsgGetText(18032, 13, "Message Not Found"); --&GRIDCOLUMN2 = &GRID.GetColumn("RELATIONSHIP");&GRIDCOLUMN2.Label = MsgGetText(18032, 14, "Message Not Found");-- &GRIDCOLUMN = &GRID.GetColumn("EDIT");&GRIDCOLUMN.Label = " ";-- &GRIDCOLUMN = &GRID.GetColumn("DELETE");--- &GRIDCOLUMN.Label = " ";

Populate action reason dropdown &SalRange(&I).DERIVED_HR.ACTION_REASON_SS.ClearDropDownList(); &Xlat = CreateRowset(Record.STP_CONFIG_DTL); &Xlat.Fill("WHERE CONFIG_ID = 'STPMSS_PAY_ACTREASON' AND CONFIG_VALUE = 'USA'"); For &J = 1 To &Xlat.ActiveRowCount; &CodeIn = &Xlat.GetRow(&J).GetRecord(1).OPTION_VALUE_1.Value; SQLExec("SELECT A.DESCR FROM PS_ACTN_REASON_TBL A WHERE A.ACTION = 'PAY' AND A.ACTION_REASON = :1 AND A.EFFDT = (SELECT MAX(EFFDT) FROM PS_ACTN_REASON_TBL WHERE ACTION = A.ACTION AND ACTION_REASON = A.ACTION_REASON)", &CodeIn, &DescIn); &SalRange(&I).DERIVED_HR.ACTION_REASON_SS.AddDropDownItem(&CodeIn, &DescIn);-- End-For;/* Coded for transfer the Page to the confirmation page*/-à Component SavePostChangeDeclare Function RunWFSavePostChange PeopleCode FUNCLIB_WF.WF_RUN_SAVE_OPTION FieldFormula;

Page 58: IQ 2011 BY GVR

Page | 58

Peoplesoft Interview Questions

Component string &ReturnPanel;&ReturnPanel = "PAGE.BAS_ON_DEM_EM";-- RunWFSavePostChange("BAS_ON_DEM_EM_PG");Coded to call the secondary page from one component to another componentDoModalPanelGroup(MenuName.ADMINISTER_AUTOMATED_BENEFITS, BarName.USE, ItemName.EVENT_STATUS_UPDATE, Panel.EVENT_STATUS_UPDATE, "U", Record.BAS_PAR_STS_KEY);

Coded for to allow only the particular” roles “ for the given condition&isrole = IsUserRole(%OperatorId, "MANAGERMSS");If &isrole = "Y" ThenCoded for GetField(PER_ORG_ASGN.C_NEXT_REVIEW_DT).SetDefault();/*Set the grid column label. This needs to be done because when you set the values for the hyperlink, the grid column heading also gets changed*/ &GRID = GetGrid(Panel.HR_EMERG_CNTCT_DET, "EMERGENCY_PHONE"); &GRIDCOLUMN = &GRID.GetColumn("DELETE");--- &GRIDCOLUMN.Label = " ";/* SR, Added following code to remind the user if age is less than 14 years and more than 65 years */If %Menu = "ROLE_MANAGER" Then &ISCANMSS = IsUserRole(%OperatorId, "RETMGRCANSS"); If &ISCANMSS <> "Y" Then &ISCANMSS = IsUserRole(%OperatorId, "HRADMINCANSS"); End-If; If &ISCANMSS = "Y" Then If (AddToDate(PERSON.BIRTHDATE, 14, 0, 0) > %Date) Then Warning MsgGet(25200, 9, "Employee should be at least 14 years old.")-- End-If; If (AddToDate(PERSON.BIRTHDATE, 65, 0, 0) <= %Date) Then Warning MsgGet(25200, 10, "Employee should not be greater than 65 years old.")-- End-If; Else If (AddToDate(PERSON.BIRTHDATE, 16, 0, 0) > %Date) And (%Menu <> MenuName."ADMINISTER_WORKFORCE_(GER)") Then Warning MsgGet(25200, 5, "Employee should be at least 16 years old.") End-If; End-If; End-If;

In level 1 to get data in fields? ROWSET_LEVEL0 = GetLevel0 (); &ROWSET_LEVEL1 = &ROWSET_LEVEL0.GetRow (1).GetRowset (SCROLL.LEVEL1_REC); &ROWSET_LEVEL2 = &ROWSET_LEVEL1.GetRow (5).GetRowset (SCROLL.LEVEL2_REC); (Or) GetLevel0: Syntax: GetLevel0 ()Description: GetLevel0 creates a rowset object that corresponds to level 0 of the component buffer. If used from PeopleCode that isn’t associated with a page, it returns the base rowset from the current context.How you can retrieve data from different ScrollAreas, if I want to retrieve level2 Scroll data which commands you have used?

Scrollselect, fetchvalue, rowselect

Page 59: IQ 2011 BY GVR

Page | 59

Peoplesoft Interview Questions

In level one to GET data in fields? ROWSET_LEVEL0 = GetLevel0 (); &ROWSET_LEVEL1 = &ROWSET_LEVEL0.GetRow (1).GetRowset (SCROLL.LEVEL1_REC); &ROWSET_LEVEL2 = &ROWSET_LEVEL1.GetRow (5).GetRowset (SCROLL.LEVEL2_REC); (Or)GetLevel0: Syntax: GetLevel0 ()Description: GetLevel0 creates a Rowset object that corresponds to level 0 of the component buffer. If used from PeopleCode that isn’t associated with a page, it returns the base Rowset from the current context.How you can retrieve data from different ScrollAreas, if I want to retrieve level2 Scroll data which commands you have used? Scrollselect, fetchvalue, rowselect

Standalone Rowset: In addition to being able to create records on the fly, you can create a standalone rowset. You can use

this type of object to get rid of hidden work scrolls on a page.Standalone rowsets are   not  tied to the database . This means if you make changes to data in a standalone rowset, it will not be automatically saved to the database. In addition, a standalone rowset isn't tied to the component processor. When you fill it with data, no PeopleCode programs or events run (like RowInit, FieldDefault, and so on.) Use the CreateRowset function to create a standalone rowset. The parameters for this function determine if the structure of the rowset you're creating is based on an already instantiated rowset, on a record definition, or both.

For example, to create a rowset based on an existing rowset, pass in the name of the existing rowset.&Level0 = GetLevel0(); &MyRowset = CreateRowset(&Level0);

You can create rowsets based on record definitions. The following code creates a rowset structure composed of four

records in an hierarchical structure:

QA_INVEST_HDR QA_INVEST_LN QA_INVEST_TRANS QA_INVEST_DTL

Local Rowset &RS, &RS2, &RS_FINAL;&RS2 = CreateRowset(RECORD.QA_INVEST_DTL); &RS = CreateRowset(RECORD.QA_INVEST_TRANS,&RS2);&RS2 = CreateRowset(RECORD.QA_INVEST_LN,&RS); &RS_FINAL = CreateRowset(RECORD.QA_INVEST_HDR,&RS2)

Using SQL Definitions with SQLExecThere are times when SQLExec is the appropriate function to use. If you only need a single row,use SQLExec, which can only

SELECT a single row of data. If your SQL statement retrieves more than one row of data, SQLExec outputs only the first row to its

output variables and discards subsequent rows. This can improve single-operation performance.

However, you don't have to hardcode your SQL statement. SQLExec is enhanced to accept the SQL definitions, and the new meta-SQL, so you can reuse your SQL statements. For example, consider the following statement:SQLExec("Update %Table(:1) set %UpdatePairs(:1) where %KeyEqual(:2)", &REC,&FIELD);If you have created a SQL definition with this SQL statement and named it MYUPDATE, youcan use it with SQLExec as follows:  SQLExec(SQL.MYUPDATE, &REC, &FIELD);SQL Definitions and the SQL Class Example Can you spot any best practices in the piece of code below? 

We can use the SQL class to create temporary SQL statements for manipulating data. The following example creates a temporary SQL statement, then writes all the rows of data from a record to a file:Local Record &LN; Local File &MYFILE; Local SQL &SQL2;&MYFILE = GetFile("record.txt", "A");If &MYFILE.IsOpen ThenIf &MYFILE.SetFileLayout(FILELAYOUT.ABS_HIST) Then----&LN = CreateRecord(RECORD.ABSENCE_HIST);&SQL2 = CreateSQL("%Selectall(:1)", &LN);While&SQL2.Fetch(&LN) &MYFILE.WriteRecord(&LN); End-While; End-If; End-If; &MYFILE.Close();Using the Record ClassWhat if we can avoid the use of SQLEXEC in coding?  Improved efficiency of the system.With the Record class you can build and execute a SQL statement by using the following methods: (Avoiding the use of SQLExec) Delete nsert  SelectByKey  UpdateExample 1

Page 60: IQ 2011 BY GVR

Page | 60

Peoplesoft Interview Questions

In the following example, the existing code selects all fields into one record then copies that information to another record. The existing code used SQLExec. The rewritten code uses a record object method SelectByKey.

Existing Code&MYKEY = "001";SQLExec("select %dateout(msdate1), %dateout(msdate2), %timeout(mstime1),%timeout(mstime2), %timeout(mstime3), %datetimeout(msdttm1),%datetimeout(msdttm2), %datetimeout(msdttm3) from ps_xmstbl1 where mskey1 = :1",&MYKEY, &MYDATE1, &MYDATE2, &MYTIME1, &MYTIME2, &MYTIME3, &MYDTTM1, &MYDTTM2,&MYDTTM3);SQLExec("delete from ps_xms_out1 where mskey1 = :1", &MYKEY);SQLExec("insert into ps_xms_out1(mskey1,msdateout1,msdateout2,mstimeout1,mstimeout2,mstimeout3,msdttmout1,msdttmout2,msdttmout3)values(:1,%datein(:2),%datein(:3),%timein(:4),%timein(:5),%timein(:6),%datetimein(:7),%datetimein(:8),%datetimein(:9))", &MYKEY, &MYDATE1,&MYDATE2, &MYTIME1, &MYTIME2, &MYTIME3, &MYDTTM1, &MYDTTM2, &MYDTTM3);

Re-Written CodeSelectByKey works by using the keys you've already assigned values for. It returns successfully if you assign enough key values to return a unique record. In this example, the record has a single key, so only that key value is set before executing SelectByKey. If your record has several keys, you must set enough of those key values to return a unique record. Local record &REC, REC2; &REC = CreateRecord(RECORD.XMSTBL1);&REC.MSKEY1 = "001"; &REC.SelectByKey(); &REC2 = CreateRecord(RECORD.XMS_OUT1);&REC.CopyFieldsTo(&REC2); &REC2.Delete(); &REC2.Insert();Example 2 Existing CodeIf None(&EXISTS) ThenSQLExec("insert into ps_rt_rate_tbl (rt_rate_index, term, from_cur, to_cur,rt_type, effdt, rate_mult, rate_div) values (:1, :2, :3, :4, :5, %DateIn(:6),:7, :8)", RT_RATE_INDEX, TERM, TO_CUR, FROM_CUR, RT_TYPE, EFFDT, RATE_DIV,RATE_MULT);SQLExec("select 'x' from ps_rt_rate_def_tbl where rt_rate_index = :1 andterm = :2 and from_cur = :3 and to_cur = :4", RT_RATE_INDEX, TERM, TO_CUR,FROM_CUR, &DEFEXISTS);If None(&DEFEXISTS) ThenSQLExec("insert into ps_rt_rate_def_tbl (rt_rate_index, term, from_cur,to_cur, max_variance, error_type, int_basis) values (:1, :2, :3, :4, :5, :6,:7)", RT_RATE_INDEX, TERM, TO_CUR, FROM_CUR, RT_RATE_DEF_TBL.MAX_VARIANCE,RT_RATE_DEF_TBL.ERROR_TYPE, RT_RATE_DEF_TBL.INT_BASIS); End-If;ElseSQLExec("update ps_rt_rate_tbl set rate_mult = :7, rate_div = :8 wherert_rate_index = :1 and term = :2 and from_cur = :3 and to_cur = :4 and rt_type = :5 and effdt = %DateIn(:6)", RT_RATE_INDEX, TERM, TO_CUR, FROM_CUR, RT_TYPE,EFFDT, RATE_DIV, RATE_MULT); End-If;Re-Written CodeLocal record &RT_RATE_TBL, &RT_RATE_DEF_TBL;...If None(&EXISTS) Then&RT_RATE_TBL = CreateRecord(RT_RATE_TBL); --- &RT_RATE_DEF_TBL = CreateRecord(RT_RATE_DEF_TBL);&RT_RATE_TBL.Insert(); ---- &RT_RATE_DEF_TBL.SelectByKey();If None(&DEFEXISTS) Then &RT_RATE_DEF_TBL.Insert(); End-If;Else &RT_RATE_TBL.Update(); End-If;What is SQLExec function ? And what are the limitations of this command?The SQLExec function executes a SQL command from within a PeopleCode program by passing an SQL command string. The SQL command bypasses the Application Processor and interacts with the database server directly.Limitation of SQLExec SELECT statement:Only a single row of data. If you write a SQL statement that retrieves more than one row of data, SQLExec outputs only the first row to its output variables.

Page 61: IQ 2011 BY GVR

Page | 61

Peoplesoft Interview Questions

If you want to select multiple rows of data, you can use ScrollSelect to read rows into a work scroll. Limitations of SQLExec UPDATE, DELETE, and INSERT statements:

These statements can only be issued in SavePreChange, Workflow and SavePostChange events.

Run an SQR From a PeopleSoft Application EngineHere is a good sample of how to launch an SQR from within PeopleCode. You can use the peoplecode function called “ScheduleProcess”. Here is the example:&PROCESS_NAME = "SQRNAME";&PROCESS_TYPE = "SQR Report"; (or "SQR Process")&RUN_CNTL_ID = "YOUR_RUN_ID";&RUN_CONTROL = ScheduleProcess(&PROCESS_TYPE, &PROCESS_NAME, "2", &RUN_CNTL_ID, &PRCS_INST);

If &RC != 0 /*"1" = client "2" = server*/Winmessage("Error: Error Scheduling SQR Process, RC = " | &RUN_CONTROL);End-If;

Differences between STATE and TEMPORARY records? 1. State record at any point of time has only single line information, as it's driven by the PROCESS_INSTANCE as key field. While temp table can have multiple rows. 2. State record had only single instance, while the temp table can have maximum of 99 instances. 3. State record is used for restart logic. 4. State record can be used for dynamically calling AE section, by adding AE_SECTION, AE_APPLID as fields. Temp table can not be used.If you create a sql table as State Record - data will be stored in the database. If at any point of time, App Engine programs stops, you can continue from that point on provided Restart is enabled. This is called the restart logic. With restart enabled, you don't have to run app. engine program all over again. For this to be true, state record cannot be a derived record. It has to be a sql table. Temp. table is primarily used for set processing. If there are several users running the program at the same time, copies of tables are created in order to process in parallel. Temp. table lives only until the program runs and is dissolved immediately after

Difference between grid and scrollThe scroll area, like a grid, is a way of grouping multiple fields of data.The fields in your scroll area can be placed randomly, one on top of the other as well as side by side.Unlike a grid, you are not limited to the type of controls you can place in your scroll area. You can even place a grid inside a scroll area.And according to PeopleBooks, here is why scroll area is better than a scroll bar:Overall, a scroll area provides you with a wider range of functionality than a scroll bar. There are several options you can choose for a scroll area that you cannot use for a scroll bar. Also, some of the scroll areas enhanced features make designing pages easier for you and the runtime product more intuitive for the user.* The navigation tools you select for a scroll area are automatically positioned on the navigation bar or footer bar. With scroll bars, you have to place these buttons and links manually on the page.* Scroll areas give you the option of showing or hiding a border around your data.* Scroll areas provide the option of a View All button and a Find feature.* Scroll areas allow you to determine the text or image that displays for the action items in the navigation bars.* Scroll areas provide a row separator when you select multiple occurrences of data. What is the AE event in peoplecode? OnExecute What are the difference between AE and SQR? AE are maintained with in PS, with in Application Designer SQRs are a 3rd party software and not maintained with in PS, therefore need a separate upgrade process. 1. AE is very systematic as it is structured as Section, step and Action. While SQR is not systematic. 2. AE flow is easy to read and understand, while SQR is not that easy. 3. AE is easy to debug as you can do line by line debugging. With SQR, it’s not easily possible. 4. By using SQR, you can create and maintain different reports, which are not possible with AE's. 5. AE has a restart ability, which is SQR does not have restart ability

If we use Application Engine, below points are to be taken into accountIf the interface is INBOUND, its better to go for Application EngineIf the program fails, we can make use of Restart Control to restart the program from the position where it abendsPeopleSoft – Business Process related Validation will be taken care automatically when we go for AE/CI.

Page 62: IQ 2011 BY GVR

Page | 62

Peoplesoft Interview Questions

Parallel Processing can be easily achieved using AE. This can be done by using Temporary Tables and State Records.Reusability of SQLs is very much easy when we go for AE.Bulk Insertion of data and Set Processing of data can be easily done in an AECOMMIT levels can be maintained either at SECTION or STEP levelsGeneration of Reports using File Layout, Workflow related batch interface can be easily developed using an AEXML related processing is quiet easy when we go for AEWhen we go for Upgrade of the Current PS System, Retrofitting of AE is done by easily identifying the impacted objects.If we are going to use SQR, below points can be taken into account to build an interfaceFormatting of Reports is very much easy in SQR using Begin-Header, Begin-Footer and Begin-Setup commands.If we are going to consider the Performance of the Interface Program, its better to go for SQR.Better Performance can be achieved by using Load-Lookup Arrays and Dynamic SQLReusability of SQLs can be achieved by creating either generic Procedures or SQCs

Load Lookup Arrays in SQR: How to improve the performance of the SQR using Load Lookup Arrays?For Simple database related validation, we will fire a SQL to check the sanity of data. If this data validation is to be fired for each and every row of data, then it is better to go for Load-Lookup Arrays. This is like Prompt table validation in the case of Online Pages.In this way, we can reduce the database hits and thereby increasing the Performance of the SQR Program.For Eg: If we want to validate the Earnings Codes present in the file, we can use these arrays to validate the Earning Code data. Generally we will use the below SQL to validate the ERNCD dataSELECT PET.ERNCD, PET.EFFECT_ON_FLSA, PET.ADD_GROSS-- FROM PS_EARNINGS_TBL PETWHERE PET.EFFDT= (SELECT MAX (EFFDT) FROM PS_EARNINGS_TBL WHERE PET.ERNCD = ERNCD AND EFFDT <=(SYSDATE)AND PET.EFF_STATUS =”A” AND PET.ERNCD = $ErncdIn order to avoid these database hits for each and every row of data, we can write the below code to load all the valid Earning Codes at once from the Database to Load Lookup Array Name EARN and then use the array to validate the input ERNCD data. ! Lookup array for EARNINGS CODESLet $where = ‘PET.EFFDT = (SELECT MAX (EFFDT) ‘||‘FROM PS_EARNINGS_TBL ‘||‘WHERE PET.ERNCD = ERNCD ‘||‘AND EFFDT  <=SYSDATE) ‘|| ‘AND EFF_STATUS =”A”’ LOAD-LOOKUP NAME = EARN TABLE  = ‘PS_EARNINGS_TBL PET’ KEY  = ERNCD RETURN_VALUE  = ERNCD||’-'||EFFECT_ON_FLSA||’-'||ADD_GROSS WHERE = $where QUIET

In this case, KEY (This is nothing but Input Data value) is ERNCD and RETURN_VALUE (Output data value) is Combination of ERNCD, EFFECT_ON_FLSA and ADD_GROSS database field’s value. ! Checking Load lookup array for data validationLookup EARN $input_data $output_data Note: It is good to initialize these Load Lookup Arrays in the SETUP Section related procedures.

Page 63: IQ 2011 BY GVR

Page | 63

Peoplesoft Interview Questions

Benefit Setup Tabels :

1.Ben_Defn_Pgm : Benefit Program Definition Tbl. (This Is A Parent Table For The Setup Tables)Record Definition: Ben_Defn_Pgm Is A Record That Contains Information On All Benefit Programs Offered By A Company.This Table Is Used As A Prompt Table For Many Panels And Accessed Often By The Batch Processing Of The Benefits Administration Product.Key Fields : Benefit_Program, Effdt. Related Language Record: Benef_Pgm_Lang.Prompt Table: Fsa_Run_Tbl,Currency_Cd_Tbl,Fmla_Plan_Tbl,Psurldefn,Ben_Contact_Tbl.2.Ben_Defn_Plan : Benefit Plan-Type Definition.Record Definition: Ben_Defn_Plan Is A Record That Defines The Plan Types For Each Benefit Program And Is Used For Processing In Payroll And Benefit Adminstation.For Benefit Administration , It Contains Information On Each Plan Type Such As The Display Plan Sequence,Event Rules Id ,Etc.Parent Record : Ben_Defn_PgmKey Fields: Benefit_Program, Effdt, Plan_Type.Prompt Table:Ben_Defn_Pgm,Bn_Plan_Type_Vw,Bas_Event_Rules,Psurldefn.3.Ben_Defn_Cost. Record Definition: Benefit Opt Cost Definition.Record Definition: Ben_Defn_Cost Is A Record That Defines The Costs Associated With Each Benefit Option And Is Used For Processing In Payroll And Benefit Adminstration.The Cost Are Defined As The Rate Type , Rate Table Id,Earning Code (For Credit) And Calculation Rules.Parent Record: Ben_Defn_Optn. Key Fields: Benefit_Program, Effdt, Plan_Type, Option_Id, Cost_IdPrompt Table: Ben_Defn_Pgm,Earnings_Tbl,Recname_Edit,Calc_Rules_Tbl.4.Ben_Defn_Optn: Record Definition:Benefit Option DefinitionRecord Definition : Ben_Defn_Optn Is A Record That Defines The Benefit Options For Each Plan Type And Is Used For Fro Processing In Payroll And Benefit Adminstrarion.Abenefit Option Is A Combination Of Benefit Plan And Coverage Code.For Benefit Adminstration , It Contains Information On Each Option Such As The Option Code,Option Level,Eligility Rule Id Etc.Parent Record:Ben_Defn_PlanKey Fields: Benefit_Program, Effdt, Plan_Type, Option_Id.Prompt Tables : Ben_Defn_Pgm,Benef_Plan_Tbl,Covrg_Cd_Tbl,Deduction_Tbl,Bas_Elig_Rules,Geog_Locn_Tbl,Ben_Plan_Typ_Vw,Ben_Pln_Eff_Vw.5.Covrg_Cd_Tbl: Description :Coverage Code Definition Table.Record Definition : Covrg_Cd_Tbl Is A Record That Defines The Coverage Codes Used To Define The Coverage Level Of A Health Benefit . Each Code Is Defined By The Minimum And Maximum Dependents Allowed And Whether Spousal Coverage Is Allowed.Not Allowed Or Required.Related Language Record : Covrg_Cd_Lang.Keyfield: Covrg_Cd, Effdt.Application Tables. This Parent And Following 10 Tables Are Benefit Module Tables. Table : Benefit_Partic This Table Is Parent Table Of The Below Tables.Description:Ben Plantype Enrollmnt ControlRecord Description: Benefits_Partic Is A Record That Contains Information On Employee Enrollments In A Benefit Plan Type. The Record Is Used By The Benefit Enrollment Panels. They Are Either Entered Online By The Base Benefits System, Or By The Batch Processes Basoelod And Basemlod During Benefits Administration Processing. The Records Can Be Rebuilt Using The Partic Sql Script.Keys: All Key Are Key Fields. Emplid, Empl_Rcd, Cobra_Event_Id, Plan_Type,Benefit_NbrPrompt Tables: Person, Memployment,

Page 64: IQ 2011 BY GVR

Page | 64

Peoplesoft Interview Questions

Chaild Tables. (BENFITS)1. Table :Vacation_Ben Description: Ee Vacation Plan EnrollmentsRecord Description: Vacation_Ben Is A Record Which Defines The Vacation Benefits For Which An Emploeee Is Enrolled. It Is Populated In The Base Benefits System Using The Savings_Plan Panel Within The Benefits Window Or By The Basemlod/Basoelod Load Processes Of The Benefits Administration Product.Keys : Emplid, Empl_Rcd,Plan_Type, Benefit_Nbr, Effdt.Prompt Tables: Person,Memployment,Ben_Prog_Benpln2.Savings_Plan Description: Ee Savings Plan EnrollmentsRecord Description: Savings_Plan Is A Record Which Defines The Savings Plan For Which An Employee Is Enrolled. It Is Populated In The Base Benefits System Using The Savings_Plan Panel Within The Benefits Window Or By The Basemlod/Basoelod Load Processes Of The Benefits Administation Product.Keys : Emplid, Empl_Rcd,Plan_Type, Benefit_Nbr, Effdt. Prompt Tables: Person,Memployment,Ben_Prog_Benpln,Plan_Type_Rb_Vw,Ben_Pln_Rb_Vw,Dedcd_Rb_Vw.3.Disability_Ben Description: Ee Disability Ben EnrollmentsRecord Description: Disability_Ben Is A Record That Identifies All Disability-Related Benefit Elections For An Employee. These Benefits Are Related To The Plan Types In The '3x' Series Such As '30'-Std Ans '31'-Ltd. This Record Is Populated By Online Panels When Using The Base Benefits Product Or By The Batch Processes Basemlod/Basoelog When Using The Benefits Administration Product.Keys: Emplid, Empl_Rcd,Plan_Type, Benefit_Nbr, Effdt.Prompt Tables: Person, Memployment, Ben_Prog_Benpln4.Fsa_Benefit Description: Ee Fsa Benefit EnrollmentsRecord Description: Fsa_Benefit Is A Record Used To Enroll Participants In Flexible Spending Accounts Such As Health Or Dependent Care. It Is Populated In The Base Benefits System Using The Enrollment Panel, Or By The Automated Benefits Administration Product. The Fsa Claims Administration Product Looks At This Record To Verify Enrollment.Keys: Emplid, Empl_Rcd,Cobra_Event_Id,Plan_Type,Benefit_Nbr,EffdtPrompt Tables: Person,Memployment,Ben_Prog_Benpln5.Health_Benefit Description: Ee Health Benefit ElectionsRecord Description: Health_Benefit Is A Record That Identifies All Health-Related Benefit Elections For An Employee. These Benefits Are Related To The Plan Types In The '1x' Series Such As '10'-Medical, '11'-Dental, '14'-Vision/Hearing. Health_Benefit Is Populated By Online Panels When Using The Base Benefits Product Or By The Batch Processes Basemlod/Basoelog When Using The Benefits Administration Product.Keys: Emplid, Empl_Rcd,Cobra_Event_Id, Plan_Type,Benefit_Nbr,EffdtPrompt Tables: Person,Memployment,Ben_Prog_Bencvc.6.Leave_Accrual. Description: Ee Leave AccrualsRecord Description This Record Is Used To Store Employee Leave Accrual Balances Including Hours Carried Over, Taken, Earned, Bought, Sold And Unprocessed.Keys: Emplid,Empl_Rcd,Plan_Type,Company,Accrual_Proc_Dt.Prompt Tables: Person,Employment,Company_Tbl7.Leave_Plan Description: Ee Leave Benefit EnrollmentsRecord Description This Record Is Used To Store Information Regarding The Employee's Choice Of Leave Plan(S).Keys: Emplid, Empl_Rcd, Plan_Type, Benefit_Nbr, Effdt.Prompt Tables: Person,Employment,Ben_Prog_Benpln.8.Life_Add_Ben Description: Ee Life Ad/D Benefit EnrollmntRecord Description Life_Add_Ben Is A Record That Identifies All Life- And Accidental Death-Related Benefit Elections For An Employee. These Benefits Are Related To The Plan Types In The '2x' Series Such As '20'-Life, '22'-Add, '25'-Dependent Life, Etc. This Record Is Populated By Online Panels When Using

Page 65: IQ 2011 BY GVR

Page | 65

Peoplesoft Interview Questions

The Base Benefits Product Or By The Batch Processes Basemlod/Basoelog When Using The Benefits Administration Product. Keys: Emplid, Empl_Rcd, Plan_Type, Benefit_Nbr, Effdt.Prompt Tables: Person,Employment,Ben_Prog_Benpln.9.Pension_Plan Description: Ee Pension Benefit EnrollmentsRecord Description: Pension_Plan Is A Record That Identifies All Pension-Related Benefit Elections For A Canadian Employee. These Benefits Are Related To The Plan Types In The '80' Series. This Record Is Populated By Online Panels When Using The Base Benefits Product Or By The Batch Processes Basemlod/Basoelod When Using The Benefits Administration Product.Keys:Emplid, Empl_Rcd,Plan_Type,Benefit_Nbr,Effdt.Prompt Tables: Person,Employment,Ben_Prog_Benpln.10.Rtrmnt_Plan Description: Ee Retirement Benefit EnrlmentRecord Description: Rtrmnt_Plan Is A Record That Identifies All Retirement-Related Benefit Elections For A Us Employee. These Benefits Are Related To The Plan Types In The '70' Series, Such As '70'-Pers. This Record Is Populated By Online Panels When Using The Base Benefits Product Or By The Batch Processes Basemlod/Basoelod When Using The Benefits Administration Product.Keys:Emplid, Empl_Rcd,Plan_Type, Benefit_Nbr, Effdt.Prompt Tables: Person,Employment,Ben_Prog_Benpln.These Two Are The Benefit Tables. A)Ben_Per_Data This Is The Parent Table Of Ben_Plan_Data. Description: Ee/Dep Profile Data (Obsolete)Record Description Obsolete! This Table Is Obsolete As Of Release 8.8. The Carrier Interface Process (Ben100.Sqr) Is No Longer Maintained By Peoplesoft And Will Be Dropped During A Subsequent Release. Please Use The New Enrollment Reporting Snapshot Instead.--------------------------------------------------Ben_Per_Data Is A Record That Is A Snapshot Of Personal, Employee And Dependent Data. It Is Used By The Benefits_Data View.

Keys:Emplid,Cobra_Event_Id,Dependent_BenefB)Ben_Plan_Data This Is The Child Table Of Ben_Per_DataDescription: Ee/Dep Benefit Data (Obsolete)Record Description: Obsolete! This Table Is Obsolete As Of Release 8.8. The Carrier Interface Process (Ben100.Sqr) Is No Longer Maintained By Peoplesoft And Will Be Dropped During A Subsequent Release. Please Use The New Enrollment Reporting Snapshot Instead.--------------------------------------------------Ben_Plan_Data Is A Record That Is A Snapshot Of Employee And Dependent Data. It Is Used By The Benefits_Data View. Prompt Tables:Covrg_Cd_Tbl.Keys:Emplid, Empl_Rcd, Plan_Type, Cobra_Event_Id, Dependent_Benef

Page 66: IQ 2011 BY GVR

Page | 66

Peoplesoft Interview Questions

These Are The HR Tables. 1)Sal_Grade_Tbl Description: Salary Grade TableRecord Description: Sal_Grade_Tbl Is The Reference Table For Salary Ranges. The Mimimum, Midpoint, And Maximum Salary Are Used To Calculate Compa Ratio And Percent Of Range. Several Edits Are Done In The System To Warn That An Employee Is Over The Maximum Or Under The Mimimum For Their Salary Grade.Keys:Setid, Sal_Admin_Plan, Grade, Effdt Setcontrol Field : Business_Unit.Prompt Tables:Sal_Plan_Tbl,Sal_Matrix_Tbl,Currency_Cd_Tbl,Empl_Ctg,Empl_Ctg_L1 To L3.Child Tables AreA)Sal_Step_Tbl. Description: Salary Step TableRecord Description: Sal_Step_Tbl Is Used To Store The Salary For Each Step When Multi-Step Grade Is Used. The Control Flag For Multi-Step Grade Is Found On The Installation Record. When It Is Set To 'Yes', Employees Salaries Are Automatically Set To The One Stored On This Table For Their Salary Administration Plan, Grade, And Step.Keys:Setid, Sal_Admin_Plan, Grade, Effdt, Step. Setcontrol Field : Business_Unit.B)Sal_Step_Pub Description: Salary Step TableRecord Description: Sal_Step_Tbl Is Used To Store The Salary For Each Step When Multi-Step Grade Is Used. The Control Flag For Multi-Step Grade Is Found On The Installation Record. When It Is Set To 'Yes', Employees Salaries Are Automatically Set To The One Stored On This Table For Their Salary Administration Plan, Grade, And Step. Keys: Setid, Sal_Admin_Plan, Grade, Effdt, Step Setcontrol Field : Business_Unit.SAL_RATECD_TBL Description: Salary Grade TableRecord Description: Sal_Grade_Tbl Is The Reference Table For Salary Ranges. The Mimimum, Midpoint, And Maximum Salary Are Used To Calculate Compa Ratio And Percent Of Range. Several Edits Are Done In The System To Warn That An Employee Is Over The Maximum Or Under The Mimimum For Their Salary Grade.Keys: Setid, Sal_Admin_Plan, Grade, Effdt Setcontrol Field : Business_Unit.

HR Setup Tables.1 Dept_Tbl Description: DepartmentsThe Hrms Dept_Tbl Definition Has Been Synchronized With The Erp Definition. Any Changes Made To The Hrms Definition Must Be Made To Erp Definition.Use Dept_Tbl To Record Information About The Organizational Entities In Your Company. Data Also Includes Description, Company Code, Location, And Budget Fields. Assign A Deptid To Each Department, Division, Region, Etc. Which Is Used In Your Organizational Hierarchy. The Tree Editor Is Used To Build A Hierarchy Of These Codes, And To Identify And Group Them Into The Appropriate Organizational Levels. Department Id Is Used As The Primary Organizational Identifier On Payroll Earnings Records. It Is Also Used As The Basis For Implementing Organizational Security For Employee Data.You Can Create Multiple Dept_Tbl Records For A Department, Each With A Unique Effective Date. Keys: Setid, Deptid, Effdt Alt: Descr, Company, Setid_Location, Manager_Id,Manager_PosnPrompt Tables Person_Name,Position_Data,Company_Tbl,Accdt_Ins_Tbl,Dept_Tbl2 Installation Description: Site-Specific Install OptionsRecord Description: Use The Installation Record To Set Parameters For Running Your Peoplesoft System At Your Specific Site.For Example, If You Are Running Peoplesoft On A Db2 Machine, You Enter Certain Parameters Here. If You Use Auto-Numbering In Peoplesoft, Such As Auto-Assignment Of Employee Ids, You Enter The Beginning Sequence Number Here. If You Run Peoplesoft Payroll, You Specify The Number Of Payroll

Page 67: IQ 2011 BY GVR

Page | 67

Peoplesoft Interview Questions

Records To Be Run Before A 'Commit' Is Executed. If You Are Running Position Management, You Specify Whether You Are Running Partial Or Full Position Management. Prompt Tables:Company_Tbl,Country_Tbl,Curency_Cd_Tbl,Rt_Type_Tbl3) Location_Tbl Description: Company Site LocationsRecord Description: --This Table Has Been Synchronized With The Erp Table Definition. Any Changes Will Need To Be Applied To The Location_Tbl Definition In The Erp Database.Location_Tbl Is An Edit Table. Use It To Record Information About Your Company's Work Sites. Setcontrol Field : Business_Unit. Keys: Setid, Location, Effdt Alt: DescrPrompt Tables: Holiday_Tbl,Reg_Region_Tbl,Estab_Tbl4)Country_Tbl Description: Id For Group Of Countries;Record Description: This Record Is Used To Give An Id For A Group Of Countries

Keys: Group_Name, Effdt Alt: Descr5)Setid_Tbl Description: Tableset Ids Keys:Setid

Application Tables. (HR)1 Person This Is Parent Table Description: Person RecordRecord Description: Person One Of The Core Records In The Database. It Contains One Row For Every Person (Emplid) In The System. It Is The Parent Record Or Pers_Data_Effdt, Employment Etc.You Can Create Only One Personal_Data Record Per Person.Keys: Emplid. Prompt Tables:Country_Tbl2.Employees. Description: Non Terminated EmployeesRecord Description: Employees Is A Table Populated By Per099 Appengine Process.It Is A Snapshot Of Emploees' Personal/Demographic Data, Employment Data, And Job/Salary Data As Of The Date Indicated When The Program Is Run.This Table Is Primarily For Reporting. Only Employees With Empl_Status (A,P,L,S,W) Are Included With All Their Empl_Rcds And The Most Current Job Row As Of The Asofdate. Keys: Emplid, Empl_Rcd3.Job (This Parent Record Is Employment Description: Ee Job HistoryRecord Description: Job Is One Of The Core Records In The Database. Use It To Record An Employee's Job History Data Such As Actions Taken, Department, Job Code, Location, And Salary History.You Can Create Multiple Job Records For An Employee. Keys: Emplid, Empl_Rcd, Effdt, Effseq Prompt Table: Person, Dept_Tbl,Jobcode_Tbl, Location_Tbl, Company_Tbl, Paygroup_Tbl, Bas_Group_Tbl.4.Pers_Data_Effdt (This Is The Parent Table Of Person) Description: Effective Dated Personal DataRecord Description: Pers_Data_Effdt Is One Of The Core Records In The Database. Use It To Record Effective Dated Personal Data About An Employee Or Applicant Including Name And Address. Keys: Emplid, Effdt5.Person_Phone (This Is The Parent Table Of Person) Description: Personal Data - Phone NumbersRecord Description: Personal Data - Phone Numbers; Keys: Emplid, Phone_Type Prompt Table:Person6.Address (This Is The Parent Table Of Person) Description: Address TypeRecord Description: Addresses Contains Effective Dated History For Personal Addresses.Keys: Emplid,Effdt,Address_Type Prompt Table:Address_Typ_Tbl7.Person_Name (This Is The Parent Table Of Person) Description: Current Primary Name ViewRecord Description: This View Retrieves The Currently Effective Names Record For All The Primary Name. Only One Row Per Emplid Is Returned. The Effdt Is Included Only For Reference Back To Names.If A Person Only Exists In The Future, Then That Person's Most Future Dated Row Will Be Returned.No Query Security Record Is Specified Because In Query This Would Be One Of The Joined In Records. The Main Record Should Contain The Query Security. Keys: Emplid Prompt Table:Person,Name_Type_Tbl8.Disability (This Is The Parent Table Of Person) Description: DisabilityRecord Description: Information On Employee's Disability Keys: Emplid Prompt Table: Person_Name9.Pers_Nid This Is The Parent Table Of Person) Description: Pers_Nid Record

Page 68: IQ 2011 BY GVR

Page | 68

Peoplesoft Interview Questions

Record Description: Pers_Nid Is The Child Record Of Person And Hold The Nid_Sbr Which Contains Information About National Id. Keys: Emplid10.Diversity Description: Diversity Data Record Description: Diversity Data Keys: Emplid.

Setup Tables in Payroll1.Pay_Calndar (Parent) Description: Pay CalendarRecord Description: The Pay Calendar Record Contains Cycles For Oayroll Processing Created For Pay Groups.Keys : Company,Paygroup,Pay_End_Dt Alt : Run_IdPrompt Tables Company_Tbl,Paygroup_Tb,Pay_Run_Vwded_Taken_Bn_VwComponent: Pay_Calendar_Table . Pages : Pay_Calendar_Table, : Pay_Calendar_Tbl2 Pay_Calendar>>>>> Pay_Page >>>Pay_Line>>>>>Pay_Check

2.Pay_Page Parent Record Is Pay_Calendar. Description: Payroll PageRecord Description: This Record Contains Payroll Page Information.Keys : Company,Paygroup,Pay_End_Dt,Off_Cycle,Page_Num.Prompt Tables Company_Tbl,Paygroup_Tbl,Pay_Calendar.Child : G_Pay_Line, Pay_Acct_Wcan , Pay_Acct_Work ,Pay_Line, Zz_Pay_Acct_Can , Zz_Pay_Line ,Zz_Pay_Line_Can . Pages: Pay_Ol_Sheet_S1 (Page), Pay_Sheet_Add_D (Page), Pay_Sheet_Add_G ,Pay_Sheet_Add_O (Page) , Pay_Sheet_Add_P (Page), Pay_Sheet_Add_Page (Page) ,Pay_Sheet_Add_S (Page), Pay_Sheet_Line_G (Page) , Pay_Sheet_Mult_P (Page) ,Pay_Sheet_Mult_S (Page) 3.Pay_Line: Parent Record Is Pay_Page. Description: Payroll LineRecord Description: This Record Contains The Employee Summary Payroll Information. It Will Contain One Or More Subordinate Pay Earning Records.Keys : Company,Paygroup,Pay_End_Dt,Off_Cycle,Page_Num,Line_Num.Prompt Tables Company_Tbl,Paygroup_Tbl,Pay_Calendar,Person_Name,Employment.

Child : Encumb_Msg , G_Pay_Check , Hprtbgchk_Tao , Hp_Pay_Chk_Susp,Pay_Check Pay_Check_View, Pay_Check_Vcan Pay_Earnings, Pay_Message ,Pa_Hst_Pay_Chk , Pa_Hst_Pay_Earn , Retroded_Msg , Zz_Pchk_S_Vcan .Pages: Pay_Messages (Page), Pay_Ol_Sheet_S1 (Page). Pay_Sheet_Add_D (Page),Pay_Sheet_Add_G (Page), Pay_Sheet_Add_O (Page) , Pay_Sheet_Add_S (Page) ,Pay_Sheet_Line_D (Page) , Pay_Sheet_Line_G (Page), Pay_Sheet_Line_O (Page) ,Pay_Sheet_Line_S (Page), Pay_Sheet_Ln_D , Pay_Sheet_Ln_G , Pay_Sheet_Ln_O, Pay_Sheet_Ln_S, Pay_Sheet_Mult_S , Retropay_Messages (Page)

4.Pay_Check: Parent Record Is Pay_Line Description: Pay CheckRecord Description: This Is The Summary Record That Contains The Result Of The Payroll Confirmation Process.

Keys : Company,Paygroup,Pay_End_Dt,Off_Cycle,Page_Num,Line_Num,SepchkPrompt Tables Company_Tbl,Paygroup_Tbl,Pay_Calendar,Pay_Page.Pay_Line.

Child: Gpay_Distribution,Hp_Paychkctx_Sp,Hp_Paychkern_Sp,Hp_Paychktax_Sp,Pay_Tax,Pay_Tax_1042,Pay_Tax__Liab_Ap,Tax_Class,Tax_Class_Lang.1.Pay_run_tbl Description: Payroll Run IDRecord Description: This table is used to store information on pay run ID's.Related language Record is PAY_RUN_LANG Key : run_id. Componet : pay_run_tbblePages : RUN_FGPY001 , RUN_FGPY002, RUN_FGPY003 , RUN_FGPY014. RUNCTL_PSHUP .2.PAYGROUP_TBL Description: PaygroupsRecord Description: Use PAYGROUP_TBL to group employees by how they are paid. For example, if your company has both salaried and hourly employees, you might set up a monthly paygroup for the salaried employees paid once a month, and another paygroup for hourly employees paid weekly.Use a subordinate record, PAYGRP_EMPLTYPE, to identify the valid employee types for each paygroup.Related language Record is paygroup_lang. Key :company,paygroup,Effdt.Prompt table:ben_defn_pgmern_prgram_def,person_name,country_tbl Pages : TERM_RQST , UNION_TABLE3 , ST_PROCESS_GRP , ST_ESPP_DISPOSN ,

Page 69: IQ 2011 BY GVR

Page | 69

Peoplesoft Interview Questions

3.pay_distributn:(parent record is pay_check) Description: Payroll Deposit DistributionRecord Description: This record contains the details of an emplooyees direct deposit advices.Keys : Company,Paygroup,Pay_End_Dt,Off_Cycle,Page_Num,Line_Num,Sepchk,priority.Prompt table pay_page,pay_check,pay_line,paygroup_tbl,company_tbl,pay_clandar.