Thursday, April 2, 2009

Maintenance: Config to connect Crystal Report

Make sure you which tools your are using.
Go to Start\Programs\Administration Tools\Data Sources(ODBC)
Drivers Tab: Name=Peoplesoft, Version should be same as the tools you using.

If not same, uninstall the tools from Start\Programs\PeopleSoft x.xx

Install your current Tools workstation, make sure Profile Path is pointing to correct path.

\setup\CrystalBin
copy all ^.dll file to local drive
C:\Program Files\Crystal Decisions\Crystal Reports 9

Maintenance: Start Database Services

1. Start\Programs\Administration Tools\Services

2. Start a service 'ptxxxxx-PIA'-->xxxxx is tools version
-If you do not know which one to start, check PS_HOME\\webserv\

3. Start a service 'OracleService'

Maintenance: PeopleBook Physical Location

\webserv\pt84808\applications\peoplesoft\PSOL\hrms90

Note:
PeopleBook access from this path do not contains search function

Maintenance: Turn on Peoplecode Trace

psadmin, application server, configure this domain
turn on WSL port, PCDebugger, and Customize Configuration(turn on PeopleCode Debugger)

To setup Application Server in psconfig, but dont know what is the port, please go to
eg: \appserv\\psappsrv.cfg

look for "[Workstation Listener]", the port is under this portion.

Note: to start trace, turn on Start Debugger and the login id on web and application designer must be the same. eg: PS

Configuration: Set PS Date Default Format, eg:DDMMYY

1. Navigate to PeopleTools>Personalization>Locale Defaults
- Option Category Level = Tools
- User Option = Date Format
- Locale Code = en-us
- Override Value = D (by default is M which mean start in MMDDYY)

Maintenance: Clear Process Scheduler Cache

1. PSADMIN, down Process Scheduler.

2. Navigate to PS_HOME\appserv\prcs\\CACHE, detele all.

3. PSADMIN, startup Process Scheduler.

Maintenance: Clear App Server Cache

1. PSADMIN, down Application Server.

2. Navigate to \appserv\\CACHE, detele all.

3. PSADMIN, startup Application Server.

Maintenance: Clear Web Server Cache

1. Down Web Server, Control Panel>Administrative Tools>Services, look for pt-xxxxx-PIA, right click, stop.

2. Navigate to \webserv\pt\applications\peoplesoft\PORTAL\\cache, delete all.

3. Start up pt-xxxxx-PIA, right click, start.

PeopleCode: Get Report Path

Description
In order to retrieve report in Process Monitor, click Details>View Log/Trace File, physically, the report is storing in a server location, the code below is to retrieve the exact location that the report generated in.
------------------------------------------------------------------------------
SQLEXEC("select SEQUENCENO from PS_PRCSSEQUENCE where PRCSSEQKEY = 0",&seq_no);

SQLEXEC("select PRCSOUTPUTDIR from PSPRCSPARMS where PRCSINSTANCE = :1",&seq_no,&output_dir);

&File = GetFile(&output_dir | "\MyDocument.PDF", "W", %FilePath_Absolute);

PeopleCode: ASCII code

char(39) = '
char(34) = "
char(44) = TAB
char(10) = NewLine

How to code?
&quote1 = Char(39);
&quote2 = Char(34);
&TAB = Char(44);
&newline = Char(10);

Error("Test single code("|&quote1|").";

Result
Test single code(').

To set number as string in csv, apply this: ="01234"


PeopleCode: Control drop down list value

&fld = GetRecord(Record.ABC_TBL).GetField(Field.ABC_FIELD); /* Assume that ABC_FIELD have some translate value */
&fld.ClearDropDownList(); /* Clear the drop down list before adding new value */

/* Add in new drop down list values */
&fld.AddDropDownItem("A", "Approved");
&fld.AddDropDownItem("S", "Submitted");
&fld.AddDropDownItem("P", "Denied");

PeopleCode: GetRowset

Local Rowset &rs1, &rs2;

&rs1 = GetLevel0()(1).GetRowset(Scroll.LEVEL_1_VW); /* Level 1 Rowset */
&rs1.Flush(); /* Flush Level 1 Rowset */

&count = &rs1.Select(Record.
LEVEL_1_VW, "WHERE EMPLID = :1 ", DERIVED_TBL.EMPLID); /* Insert data into Level 1 Rowset */

For &i = 1 To &rs1.ActiveRowCount; /* Loop Level 1 Rowset */
&r1 = &rs1(&i);


&rs2 = &r1.GetRowset(Scroll.
LEVEL_2_VW); /* Level 2 rowset */
&rs2.Flush();

&cnt = &rs2.Select(Record.
LEVEL_2_VW, "WHERE EMPLID = :1 AND YEAR=:2", DERIVED_TBL.EMPLID, &r1.LEVEL_1_VW.YEAR.VALUE);

For &j = 1 To &rs2.ActiveRowCount;

&r2 = &rs2(&j);
&amount = &r2.
LEVEL_2_VW.AMOUNT;
End-For;


End-For;


Data Mover Script

Export
set output c:\temp\temp.dat;
set log c:\temp\temp.log;
export table_name where key_field = '123'; /* without PS_ */

Import
set input c:\temp\temp.dat;
set log c:\temp\tmp.log;

delete from ps_table_name where key_field = '123';
import *;

OR

import table_name;