Thursday, December 22, 2005

Debug PeopleCode using GetFile

To debug a peoplecode (See complete document), we can use File write very effectively.

Step 1

Declare a file variable
Local File &MYFILE;

Step 2
Add the following Code. replace ketan with your username to uniquely identify your name.

&MYFILE = GetFile("debugketan.txt", "W");
If &MYFILE.IsOpen Then
&MYFILE.WriteLine("your text");
&MYFILE.WriteLine("ketan");
&MYFILE.Close();
End-If;

Step 3:

This file will be created in unix under respective appserver

PS_HOME\APPSERV\\files

For e.g. if peoplecode is running on hrdev appserver the file will be created on

/disk01/psoft/hr84x/appserv/hrdev/files directory.

1 comment:

Anonymous said...

You can use Java object as well to do file processing. I saw good tips at www.itwisesolutions.com/PsftTips.html website. Here is the snippet, how we can use Java

Local JavaObject &javaFile;&javaFile = CreateJavaObject("java.io.File", "c:\temp\mytextfile.txt");
&javaFile.delete();

-larry