cancel
Showing results for 
Search instead for 
Did you mean: 

production order Qty update-urgent.

Former Member
0 Kudos

Hi all,

I want a query that must not allow me to update the Qty in the Production order.Once production order created from the MRP,it should not allow me to update any Qty at the production orer level what should be query its urgent.

mona.

thanx in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

I suggest a little modification to the above code, to allow modifying the orders manually entered:

IF (@object_type=202)
BEGIN
if (@transaction_type='U') 
 and 
  (select OriginType from OWOR
   where DocEntry=@list_of_cols_val_tab_del )='R'
BEGIN
	set @error = 1
	set @error_message = 'Update Not Allowed in Production Order'
END
END
-- Select the return values
select @error, @error_message
end

Former Member
0 Kudos

OriginType to be checked only for 'MRP' so it should be 'M'


select OriginType from OWOR
   where DocEntry=@list_of_cols_val_tab_del )='M'

former_member204969
Active Contributor
0 Kudos

I think 'M' is for Manual.

Former Member
0 Kudos

Hi

You are right. 'M' is for Manual.

It should be 'R' inside the Stored Procedure.

Answers (1)

Answers (1)

Former Member
0 Kudos

The following Code, when written inside the SP_TransactionNotification Stored procedure, doen not allow to update production order.


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go



ALTER proc [dbo].[SBO_SP_TransactionNotification] 
@object_type nvarchar(25),     -- SBO Object Type
@transaction_type nchar(1),   -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error  int    -- Result (0 for no error)
declare @error_message nvarchar (200)   -- Error string to be displayed
select @error = 0
select @error_message = N'Ok'
--------------------------------------------------------------------------------------------------------------------------------
-- ADD YOUR CODE HERE
--------------------------------------------------------------------------------------------------------------------------------
IF (@object_type=202)
BEGIN
if (@transaction_type='U')
BEGIN
	set @error = 1
	set @error_message = 'Update Not Allowed in Production Order'
END
END
-- Select the return values
select @error, @error_message
end