Applies ToDynamics GP 2010 Field Service Anywhere

TechKnowledge Content

IssueHow can I locate an allocation for an item in Microsoft Dynamics GP when the system is indicating that my item is allocated and you cannot find the allocation anywhere? ResolutionThis script checks the various modules and will return results of where the item is allocated. Before running the script to look for allocated quantities, be sure you have a backup made. Edit and then execute the below script in SQL Server Management Studio against the company database.Note Be sure to replace the item number "A" in the second line with the correct item number that you are looking for.declare @ITEMNMBR char(30)select @ITEMNMBR = 'A'print 'Allocated Documents in Sales Order Processing'print '==============================================================='print ''if exists (select * from sysobjects where name ='SOP10200')Begin print 'Allocated Orders in Sales Order Processing'select SOPNUMBE,ITEMNMBR,ITEMDESC,ATYALLOC from SOP10200 where ITEMNMBR = @ITEMNMBR and ATYALLOC > 0 and  SOPTYPE = 2endif exists (select * from sysobjects where name ='SOP10200')Begin print 'Allocated Invoices in Sales Order Processing'select SOPNUMBE,ITEMNMBR,ITEMDESC,ATYALLOC from SOP10200 where ITEMNMBR = @ITEMNMBR and ATYALLOC > 0 and  SOPTYPE = 3endif exists (select * from sysobjects where name ='SOP10200')Begin print 'Allocated Fulfillment Orders in Sales Order Processing'select SOPNUMBE,ITEMNMBR,ITEMDESC,ATYALLOC from SOP10200 where ITEMNMBR = @ITEMNMBR and ATYALLOC > 0 and  SOPTYPE = 6endPrint ''print 'Allocated Returns in Purchase Order Processing'print '===============================================================' print ''if exists (select * from sysobjects where name ='POP10500 and POP10310')Beginselect A.POPRCTNM,A.ITEMNMBR, QTYRESERVED,* from POP10500 A join POP10310 Bon A.POPRCTNM=B.POPRCTNM AND A.RCPTLNNM=B.RCPTLNNM AND A.ITEMNMBR=B.ITEMNMBR where A.ITEMNMBR = @ITEMNMBR and A.QTYRESERVED > 0 endselect A.POPRCTNM,A.ITEMNMBR, QTYRESERVED,* from POP10500 A join POP10310 B on B.POPRCTNM=B.POPRCTNM AND A.RCPTLNNM=B.RCPTLNNM AND A.ITEMNMBR=B.ITEMNMBR where A.ITEMNMBR = @ITEMNMBR and A.QTYRESERVED > 0 Print ''print 'Allocated documents in Inventory'print '==============================================================='print ''if exists (select * from sysobjects where name ='IV10001')Beginselect IVDOCNBR,ITEMNMBR,TRXQTY from IV10001 where ITEMNMBR = @ITEMNMBR and TRXQTY < 0 select IVDOCNBR,ITEMNMBR,TRXQTY from IV10001 where ITEMNMBR = @ITEMNMBR and TRXQTY > 0 and IVDOCTYP = 3endprint ''print 'Allocated Invoices in Invoicing'print '==============================================================='print ''if exists (select * from sysobjects where name ='IVC10101')Beginselect INVCNMBR,ITEMNMBR,QUANTITY from IVC10101 where ITEMNMBR = @ITEMNMBR and DOCTYPE = 1endprint ''print 'Allocated Assembly documents in Bill of Materials'print '==============================================================='print ''if exists (select * from sysobjects where name ='BM10300')Beginselect TRX_ID,ITEMNMBR,ATYALLOC from BM10300 where Component_ID <> 0 and ITEMNMBR = @ITEMNMBR and ATYALLOC > 0 endPrint ''print 'Allocated Orders in Service Call Management'print '==============================================================='print ''if exists (select * from sysobjects where name ='SVC00203')Beginselect CALLNBR,ITEMNMBR,ATYALLOC,LOCNCODE from SVC00203 where ITEMNMBR=@ITEMNMBR and  LINITMTYP='P' AND ATYALLOC <> 0endselect CALLNBR,ITEMNMBR,ATYALLOC,LOCNCODE from SVC00203 where ITEMNMBR=@ITEMNMBR and  LINITMTYP='P' AND ATYALLOC <> 0print 'Allocated Service Call Transfers'print '==============================================================='print ''if exists (select * from sysobjects where name ='SVC00701')Beginselect ORDDOCID,ITEMNMBR,TRNSFQTY from SVC00701 where ITEMNMBR=@ITEMNMBR and TRNSFQTY <> 0endprint 'Allocated Service Call Transfers (serial)'print '==============================================================='print ''if exists (select * from sysobjects where name ='SVC00702')Beginselect ORDDOCID,ITEMNMBR,SERLTQTY from SVC00702 where ITEMNMBR=@ITEMNMBR and SERLTQTY <> 0endprint 'Allocated RTV lines'print '==============================================================='print ''if exists (select * from sysobjects where name ='SVC05601')Beginselect RTV_Number,ITEMNMBR, QUANTITY, * from SVC05601 where ITEMNMBR=@ITEMNMBR and RTV_Status=2 and CUSTOWN=0 and Transfer_Reference=''endselect RTV_Number,ITEMNMBR, QUANTITY, * from SVC05601 where ITEMNMBR=@ITEMNMBR and RTV_Status=2 and CUSTOWN=0 and Transfer_Reference=''print 'Allocated Documents in Depot Management'print '==============================================================='print ''if exists (select * from sysobjects where name ='SVC06100')Beginselect WORKORDNUM,IBITEMNUM,QUANTITY,LOCNCODE from SVC06100 where IBITEMNUM=@ITEMNMBR AND WORECTYPE = 2 AND QUANTITY <> 0 Endif exists (select * from sysobjects where name ='SVC06101')Beginselect WORKORDNUM,ITEMNMBR,ATYALLOC,LOCNCODE from SVC06101 where ITEMNMBR=@ITEMNMBR AND WORECTYPE = 2 and ATYALLOC <> 0    endif exists (select * from sysobjects where name ='SVC06120')Beginselect WORKORDNUM,ITEMNMBR,SERLTQTY from SVC06120 where ITEMNMBR=@ITEMNMBR AND WORECTYPE = 2 AND SERLTQTY <> 0Endprint ''print 'Allocated Documents in Project Accounting'print '==============================================================='print ''if exists (select * from sysobjects where name ='PA10901')Beginselect PAIV_Document_No,ITEMNMBR,PABase_Qty,LOCNCODE from PA10901 where ITEMNMBR=@ITEMNMBR and PABase_Qty <> 0 and PAIV_Transfer_Type = 1endprint ''print 'This is the (general) allocated or pending issue quantity in the MOP1400 for this Manufacturing Order'print '==============================================================='print ''if exists (select * from sysobjects where name ='MOP1400')Beginselect MANUFACTUREORDER_I, ITEMNMBR, ATYALLOC from MOP1400 where ATYALLOC > 0 and ITEMNMBR = @ITEMNMBRendprint 'This is the (bin) allocated quantity in the MOP1900 for this Manufacturing Order'print '==============================================================='print ''if exists (select * from sysobjects where name ='MOP1900')Beginselect MANUFACTUREORDER_I, ITEMNMBR, ATYALLOC, LOCNCODE, BIN from MOP1900 where ATYALLOC > 0 and ITEMNMBR = @ITEMNMBRendprint 'This is the (lot) allocated or pending issue quantity in MOP1020 for this Manufacturing Order'print '==============================================================='print ''if exists (select * from sysobjects where name ='MOP1020')Beginselect MANUFACTUREORDER_I, ITEMNMBR, SERLTNUM, FROM_SITE_I, DOCNUMBR from MOP1020 where ITEMNMBR =@ITEMNMBRendprint 'Pending transactions that can hold allocations'print '==============================================================='print ''if exists (select * from sysobjects where name ='MOP1200 and MOP1020 and MOP1025 and MOP1026')Beginselect * from MOP1020 where DOCNUMBR in (select PICKNUMBER from MOP1200 where POSTED=1)select * from MOP1025 where MOPDOCNUM in (select PICKNUMBER from MOP1200 where POSTED=1)select * from MOP1026 where MOPDOCNUM in (select PICKNUMBER from MOP1200 where POSTED=1)end

More Information

This article was TechKnowledge Document ID:27161

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.