PeopleCode Debug

17 04 2009

Sometime, we will need to investigate in PeopleCode for debug. Here is a short introduction for doing so.

1. Use Getfile to debug PeopleCode

We simply use a file to log the data and variables.  Here is a similar article about this (http://peoplesoftexperts.blogspot.com/2005/12/debug-peoplecode-using-getfile.html ), I am also writing the PeopleCode as the following:

/* Debug Part*/

SQLExec(“select sysdate from dual”, &ddate);

&DFILE = GetFile(“\\machine_name\Output\dfile.txt“, “A”, %FilePath_Absolute);

If &DFILE.IsOpen Then

&DFILE.WriteLine(&ddate | “Your Data”);

&DFILE.Close();

End-If;

/* Debug Part End*/

What we do is to put the code in the place,  we are going to debug.

2. Debug Mode in Application Desinger

It would be better to have an IDE to debug the application and code, which is provided by Application Designer. We can use its debug mode to do the job. Here is way to enable the debug mode for 3-tier (PIA). There is a detail How-to in PeopleBook System and Server Administration, Chapter 12, Chapter 12 Configuring Trace and Debug Settings: http://download.oracle.com/docs/cd/E05317_01/psft/acrobat/pt849svt-b0307.pdf

While the following is a brief:

1. Enable PC Debugger in PSADMIN

2. Set the PSDBGSRV Listener Port in PSADMIN and Enable the log.  Normally, it is 9500, for example in .cfg file:

  • Values for config section – PeopleCode Debugger
    PSDBGSRV Listener Port=9500
    DebuggerMsgLogEnable=1

3. Set Multiple PSAPPSRV Server Processes and Timeout to 0.  For example:

  • Values for config section – PSAPPSRV
    Min Instances=2
    Max Instances=2
    Service Timeout=0
    Recycle Count=0
    Allowed Consec Service Failures=0
    Max Fetch Size=5000
    Auto Select Prompts=1
    Tuxedo Queue Size=65535

4. Open the Configuration Manager to ensure the PSDBGSRV Listener Port is 9500 on the same machine of Application Server

5. Login to Browser (PIA) and Application designer in three tier (App Server) with same and unique UserId.

6. In application designer, start debugger. Enable “break at Start” or set “break points” and access Page / Component to be debug in browser.





PeopleSoft Record Notes I

17 04 2009

PeopleSoft is a database oriented application, which puts almost everything in the database.  We develop and update the metadata in database for the development. The following is the data structure as far as I know:

  • Field->Record->Page->Component->Menu

Let’s Start:

1. Field:

Fields are the lowest-level definition in PeopleSoft, in general we can think of them as the column definiation in a database. Namely, we can find the definition in a table called PSDBFIELD in PeopleSoft Database. And we have a PSRECFILED, which keeps the relationship information of Records and Fields.

Related Tables: PSDBFIELD, PSRECFILED

2. Record:

A collection of fields is a record, while the core in peoplesoft definitions is “Record”. Their definitions are stored in the table named PSRECDEFN. And we now have the following record types:

  • SQL Table
  • SQL View
  • A Derived Work Record (To store totals or buttons, messages or temp fields, only available during the session. No real table)
  • Sub Record (For SubPages and the one-to-many relationship)
  • Dynamic View
  • Query View
  • Temp Table

In order to create a standard record, such as SQL table, we will have to have the following operations:

  1. In PIA, PeopleTools->Utilities->Administration->Tablespace Utilities to define the tablespace
  2. Check PSTBLSPCCAT table for the new tablespace
  3. Define the tablespace in Database
  4. Create the record metadate in PSRECDEFN with Application Desinger
  5. Build record with SQL generated by Application Desinger







Follow

Get every new post delivered to your Inbox.