PeopleCode Online Tracing


In this article, we will discuss the options we have for tracing Online PeopleCode in PS FSCM9.2 with PeopleTools 8.53. We will see a real life problem that will cause a page giving “No Matching Buffer Found” error and we will use Peoplecode tracing to narrow down to the record causing the error and fix that.


We have two options for tracing Online PeopleCode in PS FSCM9.2 with PeopleTools 8.53.

Option 1 – Switching Trace Online after Login
Select PeopleTools, Utilities, Debug, Trace PeopleCode to access the Trace PeopleCode page. You use this page to change the PeopleCode tracing options while online. This page does not affect trace options that are set in PeopleSoft Configuration Manager.

Check each option required for PeopleCode, and login. The settings will remain active until reset again manually. Once tracing is done, you must reset Trace and logout of PIA.

Option 2 – Switching on trace at PS Login.
At login page, in URL type &trace=y at the end, and press Enter key. You will be presented with the following page.


For our example we will use the option 2.
The benefit of using this page to control PeopleCode tracing is that you can turn it on and off without having to restart PeopleTools, and without resetting the Configuration Manager settings. Keep in mind, though, your selections are not enabled until you save the page.
The check boxes on this page correspond to the options on the Trace tab in Configuration Manager. However, the selections that appear on this page do not necessarily reflect those that are made in Configuration Manager. While the Configuration Manager settings are stored in the Windows registry and used at each signon, the settings in the Utilities page apply only to the current online session, and, once set, they override the Configuration Manager's settings.


Let us navigate to the following page and retrieve a voucher with the search keys business_unit = 'FED01' and voucher_id ='00000002'.
Hit Search button.
The above error message is displayed. Let us logout of Peoplesoft Web session. We will set the trace on for the new session using option 2 mentioned above. At login page, in URL type &trace=y at the end, and press Enter key. As shown below.


You will be presented a page to specify online tracing options for the next session.

Check the options as shown below and sign in.

Let us navigate to the same voucher page and retrieve the same voucher with the search keys business_unit = 'FED01' and voucher_id ='00000002'. When the error occurs, close the PeopleSoft web session.

The trace file is created and saved on the app server.


You can take a look at How to Generate and Read traces for PeopleSoft Applications? [ID 643394.1] on the oracle website.  A portion of it says “ …. A log file will be created on the application server, logs directory (<PSHOME>\appserv\<domain>\LOGS). The name of the file usually has the user name used to log in to the application session followed by the machine name or IPAddress with an extension of tracesql or trc…..”

On my system the trace file was created at /home/psadm2/psft/pt/8.53/appserv/APPCOM/LOGS with the file name VP1_192.168.56.1.tracesql as shown below.

Copy the file from Guest OS Linux to Windows Host machine using SFTP from Host to VirtualBox.
Open the file using a test editor which can display the lines properly. I have opened the file using NotePad++. Search for ROLLBACK.

Look for the SQL executed just before ROLLBACK.
In our case it is the select from PS_DISTRIB_LINE table.
SELECT BUSINESS_UNIT, VOUCHER_ID, VOUCHER_LINE_NUM, DISTRIB_LINE_NUM, ……………………...

  FROM PS_DISTRIB_LINE WHERE BUSINESS_UNIT=:1 AND VOUCHER_ID=:2
 ORDER BY BUSINESS_UNIT, VOUCHER_ID DESC, VOUCHER_LINE_NUM, DISTRIB_LINE_NUM


Let us examine PS_DISTRIB_LINE table in relation to its parent i.e. PS_VOUCHER_LINE for our business_unit = 'FED01' and voucher_id ='00000002'.

We will execute the following SQLs.
select * from ps_voucher_line where business_unit = 'FED01' and voucher_id ='00000002';

select * from ps_distrib_line where business_unit = 'FED01' and voucher_id ='00000002';
Let us review the data in table ps_distrib_line and its parent records ps_voucher_line and its parent record ps_voucher for business_unit = 'FED01' and voucher_id ='00000002'.
 

Notice that ps_voucher_line has VOUCHER_LINE_NUM as 1 and 2.
While ps_distrib_line has VOUCHER_LINE_NUM as 1 and 3. For each VOUCHER_LINE_NUM in ps_distrib_line there should be one matching VOUCHER_LINE_NUM in ps_voucher_line. The VOUCHER_LINE_NUM 3 in ps_distrib_line does not have matching VOUCHER_LINE_NUM in ps_voucher_line. That is causing the error.

To fix this VOUCHER_LINE_NUM 3 in ps_distrib_line we can do one of the two things.
First, we delete this row. That will leave VOUCHER_LINE_NUM 2 in ps_voucher_line with no distribution row in ps_distrib_line.
Second, we can match VOUCHER_LINE_NUM 3 in ps_distrib_line to a VOUCHER_LINE_NUM in ps_voucher_line, if possible. If we compare other fields like MERCHANDISE_AMT, we realize that if the VOUCHER_LINE_NUM 3 in ps_distrib_line is changed to 2, the relationship should be good.

Let us change the VOUCHER_LINE_NUM 3 in ps_distrib_line table using the following SQL.
update ps_distrib_line set voucher_line_num = 2 where business_unit = 'FED01' and voucher_id ='00000002' and voucher_line_num = 3;
Let us try to open the voucher now without turning on the trace.

The voucher opens correctly as shown below.


So we saw how Peoplesoft Peoplecode tracing helped us reach to record causing data issues. We were able to analyze the issue, fix it and verify that the issue is really fixed.

That is it in this article. Play around with Peoplesoft Peoplecode tracing and resolve Peoplesoft issues in your organization one issue at a time.



Comments