You need to update the docnumber / vnddocnum in these tables
update PM20000 set DOCNUMBR = '584771' where VCHRNMBR = '002779'
update POP30300 set VNDDOCNM = '584771' where POPRCTNM = 'rct001575'
update PM00400 set DOCNUMBR = '584771' where DOCNUMBR = 'po001170'
this is a script i ended up using
--This script will identify all transactions with a specific Vendor Document Number, and switch them to a new document number.
declare @CurrVendDocNo varchar(30), @NewVendDocNo varchar(30)
select @CurrVendDocNo = 'po001170' -- Enter Current Vendor Doc Number to Search For
select @NewVendDocNo = '584771' -- Enter New Vendor Doc number to switch it to
select vendorid, pordnmbr,DOCNUMBR from pm20000 where DOCNUMBR = @CurrVendDocNo
select vendorid, POPRCTNM,VNDDOCNM from pop30300 where vnddocnm = @CurrVendDocNo
select VENDORID, docnumbr from pm00400 where DOCNUMBR = @CurrVendDocNo
--Run the script up to here to view the records that will be affected by this change
update PM20000 set DOCNUMBR = @NewVendDocNo where DOCNUMBR = @CurrVendDocNo
update POP30300 set VNDDOCNM = @NewVendDocNo where VNDDOCNM = @CurrVendDocNo
update PM00400 set DOCNUMBR = @NewVendDocNo where DOCNUMBR = @CurrVendDocNo
select vendorid, pordnmbr,DOCNUMBR from pm20000 where DOCNUMBR = @NewVendDocNo
select vendorid, POPRCTNM,VNDDOCNM from pop30300 where vnddocnm = @NewVendDocNo
select VENDORID, docnumbr from pm00400 where DOCNUMBR = @NewVendDocNo
No comments:
Post a Comment