E-FAIL error

When adding a particular SO Header UDF to the report I get this error message.

 "data provider or other service returned an E_FAIL status"

I have reviewed all the data in the field and there are no unusual characters it's all numbers.

the report worked until earlier this week when there was an issue with an additional program importing data into the file.

The UDF is a total of line data in SO_Sales Order Detail. The field it is totaling comes from a script.

The script (if relevant)

tmpQtyOrd = 0

tmpRetail = 0

retVal = oBusObj.GetValue("QuantityOrdered",tmpQtyOrd)
retVal = oBusObj.GetValue("UDF_RETAIL_PRICE",tmpRetail)

retVal = oBusObj.SetValue("UDF_EXT_RETAIL", tmpQtyOrd*tmpRetail)

has anyone seen this error before and know how to get around it?