Hello Musa88,
This issue is caused by bug 25107. Run the script below on the application database to fix the issue. The stored procedure causes the error if your company ID is greater than 4 characters in length.
Alter Procedure APDoc_QCPP_RefNbr @parm1 varchar(1), @parm2 varchar (10), @parm3 varchar(10) as
Select * From APDoc
Where DocClass = @parm1 and CpnyID = @parm2 and (APDoc.DocType = 'VO' OR APDoc.DocType = 'PP')
and APDoc.RefNbr LIKE @parm3 and Status <> 'V'
Order by RefNbr
Let me know if this fixes the problem.