Ratakan

Informations :

Change Vendor ID after PO already Created

1 Before update




2 PO akan diupdate dengan Vendor ID yang berbeda dengan syarat PO belum dibuatkan Receivings sama sekali

Create Procedure berikut

CREATE PROCEDURE Change_Vendor_PO_WORK

@PONUMBER varchar(17) ,
@VENDORID_NEW varchar (15)

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

UPDATE POP10100
Set VENDORID = @VENDORID_NEW
Where PONUMBER = @PONUMBER
and PONUMBER not in (select PONUMBER from POP10500)

update POP10110
set VENDORID = @VENDORID_NEW
where PONUMBER = @PONUMBER and PONUMBER not in (select PONUMBER from POP10500)

update a
set a.VENDNAME = b.VENDNAME
from POP10100 a
inner join PM00200 b on a.VENDORID = b.VENDORID
Where PONUMBER = @PONUMBER
and PONUMBER not in (select PONUMBER from POP10500)

END
GO


--execute this SP to run this procedure

--exec Change_Vendor_PO_WORK '@PONUMBER','@VENDORID_NEW'





3 After Update



4 Coba receivings Manual 




No comments