We are  upgrading one of our customer from 7.3 to latest 10.x version with PU 30. While doing testing we found that  vendor aging report was not working. If you run the report sometimes report get generated but with no data and sometimes it’s just  spinning for several minutes.

Vendor aging report has gone under  lot of changes  in recent version updates and one of them is changes on the insertVendAgingReportTmp.

In 7.3, it’s just record_insert statement which inserts data in VendAgingReportTmp table.


This method is changed in some version , I don’t which one exactly and now all the insert logic is handled through class VendAgingReportTmpFromVendTmpAccountSum which uses Query::insert_recordset to insert data from source to target.

Because we had customization’s in this report  , I thought of debugging this report and see  what’s the root cause of the issue when I found query is not generated  properly in standard code.

InitQery method of the class VendAgingReportTmpFromVendTmpAccountSum was generating query on the wrong fields as shown below

{Query  object 13e78720: SELECT  FROM VendTmpAccountSum(VendTmpAccountSum_1) JOIN SortOrder FROM CustVendTransAging(CustVendTransAging_1) ON VendTmpAccountSum.Balance01 = CustVendTransAging.SortOrder}

The actual query should be like below

{Query  object 13e78720: SELECT  FROM VendTmpAccountSum(VendTmpAccountSum_1) JOIN  FROM CustVendTransAging(CustVendTransAging_1) ON VendTmpAccountSum.AccountNum = CustVendTransAging.AccountNum}

I did not bother to search for an issue in the LCS  and thought of testing it in another environment where I have  PU 31.  I debugged the  the standard  report in  a environment with PU 31 without any customization’s  and  found the above query is generated  properly. I upgraded my environment to PU 31 and the  report was generated properly with results matching to what customer used to generate using old version.