To debug a peoplecode (See complete document), we can use File write very effectively.
Declare a file variable
Local File &MYFILE;
Add the following Code. replace ketan with your username to uniquely identify your name.
&MYFILE = GetFile("debugketan.txt", "W");
If &MYFILE.IsOpen Then
This file will be created in unix under respective appserver
For e.g. if peoplecode is running on hrdev appserver the file will be created on