Академический Документы
Профессиональный Документы
Культура Документы
A user-defined collection of related object definitions created for the purpose of developing, customizing, or upgrading a PS application
Define New Fields Create the Panel Definition 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.
Page | 1
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 dont 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.
Build
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. 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 and there by improves the performance. Search View also gives additional search criteria.
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. Page | 2 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 cant modify the existing rows. (Doesnt have any effect with EFFDT)
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 effectivedated 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
Page | 3
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 Architecture
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 wont 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.
1. Web browser 2. Web server 3. Application server 4. Batch server 5. Database server
What 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 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 sessions 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 in
PeopleTools 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
Control 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.
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.
Page | 4
Display Control Field / Related Field: Create a view with OPRID (key) and NAME as fields in it.
Page | 5
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 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 What is the difference between a Grid and a scroll? then we will give occurs count to 5. 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
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.
display the details of one row of data.
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.
3. In browser
4. In browser
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 maintain
Peoplesoft Interview Questions CI: 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 keys FindKeyInfoCollection: Returns a set of items that describes the find keys PropertyInfoCollection: 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 methods
Standard 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 | 6
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 Keys 4. 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 Definition
An 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.
Page | 7
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. 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.
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.
Page | 8
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.
y
Contains only those rows which are affected by business rule. Used for storing the transient data for the current run or iteration of program. 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
y
o
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.
(Select PeopleTools, Utilities, Administration, PeopleTools Options to access the PeopleTools Options page)
y
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
Page | 9
PARALLEL PROCESSING: 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.
Note:
1. 2.
(Build all the temporary table records in Application Designer (SQL Build).)
PS recommends that you insert the PROCESS_INSTANCE field as a key into the temporary tables you intend to use with AE. 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 RDBMS In 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 == OK update 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)Page | 10
The various methods in which a Set Processing could be achieved are: (Using Temporary tables) . nd Two pass approach run in two pass; that is first a set update updates all records, and the 2 pass corrects the
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
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. 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.
2.
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.
Retrieves a field value from a state record in any Do or SQL action. %Bind 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.
The syntax for %SELECT is: %SELECT(statefield1[, statefield2]...[, statefieldN]) Consider the following sample example
%SELECT(BUSINESS_UNIT,CUST_ID) SELECT BUSINESS_UNIT, CUST_ID FROM PS_CUST_DATA
%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.
Page | 12
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 %Clear Cursor, %Execute, %ExecuteEdits and others
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
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
Page | 13
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. 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 program You 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.
Page | 14
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 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. --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.
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.
Page | 15
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: 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. (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.
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 Restart
From 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.
Page | 16
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.
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. 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.)
Commit Considerations
How ?
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).
Page | 17
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: 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.
--By defining the AE Process Definition--asynchronous execution Select PeopleTools, Process Scheduler, Processes to access the Processes Definition page.
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
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.
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)
(B)reak Set or remove a break point 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 (C)ommit Commit work (valid between steps) (L)ook Examine state record fields (M)odify
Step (O)ut of
(G)o
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 Page | 18 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 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.
Not available from PeopleCode, Specify TRACE option in command line.
----Only for AEs in Batch Mode
Set parameters in server configuration files. y To enable in the configuration files for both the AS and the PS Process,
y y
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.
Page | 19
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
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
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.
SQC 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.
Procedures are : STDAPI-INIT
Page | 20
Write about STDAPI.SQC? STDAPI.SQC includes 2 procedures and 4 sqcs. 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 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 :
"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
!Global Date Defines
#define FILESUFFIX
#end-if
#ifdef MVS #define FILEPREFIX #define FILESUFFIX !Return Status #define GOOD-OS-STATUS 0
#define DEFMDY 'MDY' #define DEFDATE 'DATE' #define DEFDMY 'DMY' #define DEFCMP 'CMP'
#define EBCDIC
#define DEFYMD 'YMD' #define DEFROM 'ROM'
#end-if
! 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 PTTRUNCATE TRUNCATE TABLE ! Meta SQL (For Use in SQL Statements Only)
#define PTSubStr
substring
#define PTConCat
||
#define PTSubStr
substr
STDAPI :
"do STDAPI-INIT"
DESCRIPTION: It can be used in other SQRs by performing a #Include 'stdvar.sqc' !Updates process scheduler status begin-procedure Define-Standard-Vars let $Payroll_NID_Type = 'PR' end-procedure
Page | 21
There are 3 main paragraphs in SQR are as follows: Begin-SQL, Begin-document, Begin-select How 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 follows Declare-layout layout1 Left-margin=0.5 End-declare End-setup Begin-setup In 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
Now, for heading and footing part also we must specify the heading and footing for different reports in single SQR program. Print Emplid (1,1) End-heading Begin-heading 4 for-reports=(Report1)
And 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 report repository? Once the process scheduler finishes processing it will post the out put files to Report repository.
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.
Page | 22
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.
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)
Page | 23
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. 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?
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 1 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)
st
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 }]
Page | 24
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. 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 CreateArray command just allocates and initializes memory for an array. For reinitializing the array we can use ClearArray. 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 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? 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.
Page | 25
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.
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;
Peoplesoft Interview Questions 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.
Page | 26
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.
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 PROGs .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.
Peoplesoft Interview Questions 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.
Page | 27
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.
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 createdone 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 create-array name=order_qty2 size={max_categories} field=category:char field=month_qty:number:3 END-SETUP Name : purchage array size = 100 Field1: price:num Field2: qty :num size={max_categories} field=category:char field=month_qty:number:3<<<<<<<< create-array name=order_qty
Peoplesoft Interview Questions 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 Types Sign-on and Time-out Security (Sign-on : Monday to Friday 9am to 5:45pm,Time-out: 20mins. Idle time) Page | 28 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 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_DATA User 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: Passwords Descriptive: Email Address Preference: 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.
Page | 29
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 section of the PSADMIN utility, and for Windows Clients you specify the Connect ID in the Startup tab of the Configuration Manager.
Access IDs
When 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 :
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 functions
1) 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. Its 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. Its a way of organizing your data in the system.
Page | 30
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
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 Views 1. 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.
&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
Page | 31
Else
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 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;
/*Call Function*/
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).
&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 &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;
Page | 32
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;
&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 PeopleCode
Stop or Prevent Inserting Grid Rows Via PeopleCode
The 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 Then GetRowset().InsertEnabled = True; Else GetRowset().InsertEnabled = False; End-If;
Page | 33
y y
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" Then UpdateValue((Scroll.PSU_STU_ENROLL, &I, PSU_STU_ENROLL.ENROLL_STATUS, "CMP"); End-If; End-For;
Page | 34
Row-Level (Data Permission) Security Views: 1. Using PeopleSoft row-level security views enables you to restrict users from seeing certain rows
of data.
2. 3. 4. y
Configure the field as a Key, but not a List Box Item. Save the record and build the view. 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.
In PIA, traverse to query access manager (Oracle PS Tools ->people tools > Query Security -. Query Access Manager). Then CLICK ON CREATE NEW TREE.
4.
Page | 35
5.
If access group is already present, then search for that access group in the prompt.
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. step 7.1
Step 7.2
Step 7.3
Page | 36
8.
8. Go to permission list and traverse to query. (People Tools -> Security -> Permission & Roles -> Permission list (Select the permission list)).
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 y Standalone Rowsets are like regular Rowsets except they aren't associated with a component or page. y 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 What is the different between RowInit & RowInsert? in the field changes.
Page | 37
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 Difference between SavePreChanges and SavePostChan... to the fields on the page.
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.
Use SaveEdit when a validation involves more than one component field.
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.
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
Level 2
L3
ScrollSelect (1, RECORD.target_recname, RECORD.sel_recname); ScrollSelect (2, RECORD.level1_recname, RECORD.target_recname, RECORD.sel_recname); ScrollSelect (3, RECORD.level1_recname, RECORD.level2_recname, RECORD.target_recname, RECORD.sel_recname);
Peoplesoft Interview Questions 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.
Page | 38
SearchInit Event
Emplid (Field) Emplid (Field) Emplid (Field) SearchInit SearchInit SearchInit
For example:
Emplid= 100 SetSeachDialogBehavior (0); Emplid= %UserId SetSeachDialogBehavior(0); 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.
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.
Purpose:
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 );
And %Mode <> A Then End-if;
End-if;
IF Not Record Changed (psu_Student_tbl.Student_id) Error ( you must enter at least one search value. );
RowSelect Event
Recommendation 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;
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 );
PreBuild Event
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 ; When-other Employee Name= NO name ; Break; End-Evaluate; Break;
Example2:
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. 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 Edit If 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. */
Page | 39
FieldChange Event
Firing: 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;
Page | 40
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) 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
Peoplesoft Interview Questions 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.
Page | 41
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. 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.
Triggered when the user attempts to delete a row of data from a page s scroll area. --Used to prevent deletion of row. Triggered when the user attempts to save the component. ---Used to validate the consistency of the data.
RowDelete Event SaveEdit Event 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. Used when E-mail/Event notification need to be sent to different parties for the transaction being saved.
Triggered after the component processor updates the database.-- Avoid Errors and Warnings( causes runtime errors).
Workflow Event---Immediately after SavePreChange event and before the database updates. SavePostChange Event
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.
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.) &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 | 42
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();
&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;.
If the next statement is &A2[5] = 12; then &A1[5] also equals 12, as shown in the following diagram:
Page | 43
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. ---------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.
Page | 44
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]) MessageBox: MsgGetText: Syntax: MessageBox(style, title, message_set, message_num, default_txt [, paramlist]) MsgGetText(message_set, message_num, default_txt [, paramlist])
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.
The Component Processor s flow of execution begins when a user selects a component from a PeopleSoft menu.
Page | 45
Page | 46
Page | 47
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: else
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 Statements loop 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: peoplecode variables: Types NUMBER,STRING,DATE,TIME,DATETIME,ANY Scope Local Variables Global Variables Component Variables Other Variables System Variables Derived/Work Fields Naming Rules must begin with & and max length 18 characters including & Declarations always on top . Can have only comments above it. Syntax: <scope> <type> &<variable_name>
warning( <message> );
Page | 48
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 | 49
Only one of the fields has a value (OR) None of the fields has a value Exec, WinExec , Mailing Functions: Sendmail Executable Files Functions: 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 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.
Page | 50
Example:
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
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 &Instance Ex : Local record &rec; Classes:Array Class, Field Class, Record Class, Row Class, RowSet Class, Page Class, Grid Class, Chart Class, SQL Class, File Class Array 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 properties
Declaration: 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
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 array Local 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 array Local Array of Number &MYARRAY; &MYARRAY = CreateArray(); &MYARRAY[1] = 100; &MYARRAY[2] = 200; &MYARRAY[3] = 300; &ANSWER = &MYARRAY.Shift(); &ANSWER equals 100. Field Class: Declaration : Local field &Myfield; Built-In function : Getfield Syntax : GetField ([recname.fieldname])
Page | 51
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;
Page | 52
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: y File object declaration , Scope of a file object y 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 layouts Data 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. y If the file is a plain text file, data is read or written using text strings. y 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. 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.)
Page | 53
While &SQL2.Fetch(&LN) &MYFILE.WriteRecord(&LN); End-While; Else /* do error processing filelayout not correct */ End-If; 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",""
Page | 54
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 y Declaration : SQL objects are declared as type SQL. For example: Local SQL &MYSQL; y Scope : An SQL object can be instantiated only from PeopleCode. y SQL Class Built-In Functions : 1. CreateSql 2. DeleteSql 3. GetSql 4. FetchSql 5. StoreSql y 1. CreateSql : CreateSQL([sqlstring [, paramlist]]) y 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));
4. GetSQL : Syntax : GetSQL(SQL.sqlname [, paramlist]) Where paramlist is an arbitrary-length list of values in the form: inval1 [, inval2] ...
Page | 55
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);
Populate data into scroll area with condition Evaluate %Component When = 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;
Page | 56
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 End-If; End-If; /* End Staples Customization*/ Error MsgGet (0, 0, "NEXT REVIEW Date is a required field");
To update the value in job table with Maximum EFFDT SQLExec ("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);
DERIVED_STP.YEAR.DisplayOnly = True
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_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 = " ";
&SalRange(&I).DERIVED_HR.ACTION_REASON_SS.AddDropDownItem(&CodeIn, &DescIn);--
End-For;
/* Coded for transfer the Page to the confirmation page*/- Component SavePostChange
Declare Function RunWFSavePostChange PeopleCode FUNCLIB_WF.WF_RUN_SAVE_OPTION FieldFormula;
RunWFSavePostChange("BAS_ON_DEM_EM_PG");
Coded to call the secondary page from one component to another component
&isrole = IsUserRole(%OperatorId, "MANAGERMSS"); If &isrole = "Y" Then Coded 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;
Page | 57
If &ISCANMSS = "Y" Then End-If; If (AddToDate(PERSON.BIRTHDATE, 65, 0, 0) <= %Date) Then Warning MsgGet(25200, 10, "Employee should not be greater than 65 years old.")-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;
If (AddToDate(PERSON.BIRTHDATE, 14, 0, 0) > %Date) Then Warning MsgGet(25200, 9, "Employee should be at least 14 years old.")--
End-If;
End-If; End-If;
(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?
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:
Page | 58
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
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, you can use it with SQLExec as follows: SQLExec(SQL.MYUPDATE, &REC, &FIELD);
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 Then If &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();
SQLExec("delete from ps_xms_out1 where mskey1 = :1", &MYKEY); SQLExec("insert into ps_xms_out1 (mskey1,msdateout1,msdateout2,mstimeout1,mstimeout2,mstimeout3,msdttmout1,msdttm out2,msdttmout3)values(:1,%datein(:2),%datein(:3),%timein(:4),%timein(:5),%timei n(:6),%datetimein(:7),%datetimein(:8),%datetimein(:9))", &MYKEY, &MYDATE1, &MYDATE2, &MYTIME1, &MYTIME2, &MYTIME3, &MYDTTM1, &MYDTTM2, &MYDTTM3); Re-Written Code SelectByKey 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 Code
If None(&EXISTS) Then SQLExec("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);
Page | 59
If None(&DEFEXISTS) Then SQLExec("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; Else SQLExec("update ps_rt_rate_tbl set rate_mult = :7, rate_div = :8 where rt_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 Code Local 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. 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.
y y
Page | 60
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 account If the interface is INBOUND, its better to go for Application Engine If the program fails, we can make use of Restart Control to restart the program from the position where it abends PeopleSoft Business Process related Validation will be taken care automatically when we go for AE/CI. 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 AE COMMIT levels can be maintained either at SECTION or STEP levels Generation of Reports using File Layout, Workflow related batch interface can be easily developed using an AE XML related processing is quiet easy when we go for AE When we go for Upgrade of the Current PS System, Retrofitting of AE is done by easily identifying the impacted objects.
Formatting 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 SQL Reusability 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.
Page | 61
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 data SELECT PET.ERNCD, PET.EFFECT_ON_FLSA, PET.ADD_GROSS-- FROM PS_EARNINGS_TBL PET WHERE PET.EFFDT= (SELECT MAX (EFFDT) FROM PS_EARNINGS_TBL WHERE PET.ERNCD = ERNCD AND EFFDT <=(SYSDATE) AND PET.EFF_STATUS = A AND PET.ERNCD = $Erncd
In 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 CODES Let $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 validation Lookup EARN $input_data $output_data Note: It is good to initialize these Load Lookup Arrays in the SETUP Section related procedures.
1.Ben_Defn_Pgm : Benefit Program Definition Tbl. (This Is A Parent Table For The Setup Tables)
Peoplesoft Interview Questions 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_Pgm Key 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_Id Prompt Table: Ben_Defn_Pgm,Earnings_Tbl,Recname_Edit,Calc_Rules_Tbl.
Page | 62
4.Ben_Defn_Optn: Record Definition:Benefit Option Definition Record 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_Plan Key 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 Control Record 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_Nbr Prompt Tables: Person, Memployment,
Keys : Emplid, Empl_Rcd,Plan_Type, Benefit_Nbr, Effdt. Prompt Tables: Person,Memployment,Ben_Prog_Benpln 2.Savings_Plan Description: Ee Savings Plan Enrollments Record 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 Enrollments Record 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_Benpln 4.Fsa_Benefit Description: Ee Fsa Benefit Enrollments
Record 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.
Page | 63
Keys: Emplid, Empl_Rcd,Cobra_Event_Id,Plan_Type,Benefit_Nbr,Effdt Prompt Tables: Person,Memployment,Ben_Prog_Benpln 5.Health_Benefit Description: Ee Health Benefit Elections
Record 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,Effdt Prompt Tables: Person,Memployment,Ben_Prog_Bencvc. 6.Leave_Accrual. Description: Ee Leave Accruals Record 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_Tbl 7.Leave_Plan Description: Ee Leave Benefit Enrollments
Record 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 Enrollmnt Record 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 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 Enrollments
Peoplesoft Interview Questions Record 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. Page | 64 10.Rtrmnt_Plan Description: Ee Retirement Benefit Enrlment Record 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_Benef B)Ben_Plan_Data This Is The Child Table Of Ben_Per_Data Description: 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
Peoplesoft Interview Questions 1)Sal_Grade_Tbl Description: Salary Grade Table Record 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. Page | 65 Prompt Tables:Sal_Plan_Tbl,Sal_Matrix_Tbl,Currency_Cd_Tbl,Empl_Ctg,Empl_Ctg_L1 To L3. Child Tables Are A)Sal_Step_Tbl. Description: Salary Step Table Record 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 Table Record 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 Table Record 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: Departments The 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_Posn Prompt Tables Person_Name,Position_Data,Company_Tbl,Accdt_Ins_Tbl,Dept_Tbl 2 Installation Description: Site-Specific Install Options
Record 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 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_Tbl 3) Location_Tbl Description: Company Site Locations
Peoplesoft Interview Questions Record 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: Descr Prompt Tables: Holiday_Tbl,Reg_Region_Tbl,Estab_Tbl 4)Country_Tbl Description: Id For Group Of Countries;Record Description: This Record Is Used To Give An Id For A Group Of Page | 66
Countries
Keys: Group_Name, Effdt Alt: Descr 5)Setid_Tbl Description: Tableset Ids Keys:Setid Application Tables. (HR) 1 Person This Is Parent Table Description: Person Record Record 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_Tbl 2.Employees. Description: Non Terminated Employees Record 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_Rcd 3.Job (This Parent Record Is Employment Description: Ee Job History Record 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 Data
Record 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, Effdt
5.Person_Phone (This Is The Parent Table Of Person) Description: Personal Data - Phone Numbers Record Description: Personal Data - Phone Numbers; Keys: Emplid, Phone_Type Prompt Table:Person 6.Address (This Is The Parent Table Of Person) Description: Address Type Record Description: Addresses Contains Effective Dated History For Personal Addresses. Keys: Emplid,Effdt,Address_Type Prompt Table:Address_Typ_Tbl 7.Person_Name (This Is The Parent Table Of Person) Description: Current Primary Name View Record 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_Tbl 8.Disability (This Is The Parent Table Of Person) Description: Disability Record Description: Information On Employee's Disability Keys: Emplid Prompt Table: Person_Name 9.Pers_Nid This Is The Parent Table Of Person) Description: Pers_Nid Record Record Description: Pers_Nid Is The Child Record Of Person And Hold The Nid_Sbr Which Contains Information About National Id. Keys: Emplid 10.Diversity Description: Diversity Data Record Description: Diversity Data Keys: Emplid. Setup Tables in Payroll
Keys : Company,Paygroup,Pay_End_Dt Alt : Run_Id Prompt Tables Company_Tbl,Paygroup_Tb,Pay_Run_Vwded_Taken_Bn_Vw Component: 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 Page Record 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)
Page | 67
3.Pay_Line: Parent Record Is Pay_Page. Description: Payroll Line Record 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 Check
Record 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,Sepchk Prompt 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_T ax__Liab_Ap,Tax_Class,Tax_Class_Lang. 1.Pay_run_tbl Description: Payroll Run ID Record 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_tbble Pages : RUN_FGPY001 , RUN_FGPY002, RUN_FGPY003 , RUN_FGPY014. RUNCTL_PSHUP . 2.PAYGROUP_TBL Description: Paygroups Record 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 , 3.pay_distributn:(parent record is pay_check) Description: Payroll Deposit Distribution Record 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.