RKL eSolutions Blog Trends and Insights

Calculate Replenishment Parameters Unexpected Error in Sage 500 ERP

Have you ever received a Calculate Replenishment Parameters Unexpected Error in Sage 500 ERP? To be more specific any of these messages:

  • "Unexpected Error running Stored Procedure spimCalcEOQ"
  • "Unexpected Error running Stored Procedure spimCalcSafetyStock"
  • "Unexpected Error running Stored Procedure spimCalcOrderPoint"
  • "Unexpected Error running Stored Procedure spimCalcLinePoint"

Unfortunately, the message does not provide you with what is actually occurring. So here are the detailed steps for resolving this error message in Sage 500 ERP.

This issue will only occur if the company is setup to track changes for the IM module. If anything is set to 'Summary' or 'Detail' within the IM Options/Data Retention/Maintenance Audit for Additions,  Changes, and/or Deletions then entries are recorded in the tciMaintAuditLog.

Sage 500 ERP Calculate Replenishment Parameters

Part of this process inserts rows into table tciMaintAuditLog. This is where the error occurs but not all the time. Originally it was thought we had some type of permissions issue since it was only happening to certain users. It turns out that one column in this table is populated with a concatenated value. This value is different if you are running the Sage 500 ERP Client local or from Terminal Services or Citrix.

The column is ProgramName. Let me explain the details of the concatenated string.

  • Sage ERP MAS 500/Calculate Replenishment Parameters/268828752/SOA/HQ-PRCH-T430-01/13

The value above, that is passed into spimCalcEOQ for example, is used to populate the column ProgramName in table tciMaintAuditLog. The column is varchar(80). The above string is 84 characters long. There is not error checking and so the INSERT fails.

The string is broken down as such:

  • Sage ERP MAS 500 – this is the program name
  • Calculate Replenishment Parameters – This is the Task Name on the Business Desktop
  • 268828752 – This is the Task ID from the Task Table associated with the Task Name
  • SOA – this is the company ID

    The next part is where some of the variability comes into play.

  • HQ-PRCH-T430-01 – This is the name of a Terminal Server since the clients are not installed locally. If they were installed locally this would just be '//'.
  • 13 – This is the ID of the user on the Terminal Server

I think you closed this ticket as you could not find anything wrong. Well I found the issue. The column name was too short for the ProgramName column in tciMaintAuditLog.

This has been reported as a bug but I do not believe you will see this corrected. This is the same in all versions prior to Sage 500 ERP v2013 (v7.5) as of the time of this writing.

Joe Noll

Written by Joe Noll

Joe is the President of the RKL eSolutions brand with a background in MCITP, MCTS Sage 500 ERP Certified Consultant Sage 500 ERP Certified Developer Sage ERP X3 Certified Developer Sage ERP X3 Technical Consultant Specialties: SQL Server Optimization assistance, Virtualization, Business Continuity Planning.