RE: Error Number = 2697 Stored Procedure= taSopHdrIvcInsert Error Description = Line items contain qauntity types that are not allowed for the Order DOCID entered
Hello Pavan,
Here is the data check in taSopHdrIvcInsert that determines if Error Number 2697 should be returned:
if (@I_vSOPTYPE = 2)
begin
if ((@ORDTOBAC = 0) and (exists(select 1 from SOP10200 (nolock) where QTYTBAOR > 0 and SOPTYPE = @I_vSOPTYPE and SOPNUMBE = @I_vSOPNUMBE)))
To find the value of @ORDTOBAC run the following (substituting your DOCID for STDORD):
SELECT ORDTOBAC,* FROM SOP40200
WHERE DOCID = 'STDORD'
AND SOPTYPE = 2
You can then run the following, entering your SOPNUMBE value for the variable:
select * from SOP10200
where QTYTBAOR > 0
and SOPTYPE = 2
and SOPNUMBE = @I_vSOPNUMBE
Basically, your Sales Order DOCID is not setup to allow back orders, but you're back-ordering some quantity on the lines you've imported for this order. You can look at this setting in GP by going to the Sales Order Processing Setup window, select the Sales Document Setup button, select Order, pull up your Order ID and looking at the "Transfer Order to Back Order' option.
Lucas