on 09-12-2008 7:07 AM
hi all,
How to make plant field mandatory in GRPO using Stored procedure notification ?
Expecting your valuable reply.
Jeyakanthan
No it is not an user defined field(UDF),it's profit center(OcrCode)
in row level of GRPO.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'
declare @SO_Price numeric(10,2)
declare @SO_U_MRP numeric(10,2)
IF @transaction_type = 'A' AND @object_type = '20'
BEGIN
IF (SELECT max(ISNULL(T0.ocrcode,-1)) FROM PDN1 T0 WHERE T0.DocEntry = @list_of_cols_val_tab_del) != -1
begin
SET @error = 10
SET @error_message = N'Please Enter Profit Centre'
end
END
select @error, @error_message
END
Petr,
That is exactly correct, thanks for pointing..... it was a oversight
IF (@object_type = '20' AND @transaction_type= 'A')
BEGIN
IF EXISTS (SELECT DocEntry FROM [dbo\].[PDN1\] WHERE (OcrCode IS NULL OR OcrCode = '') AND DocEntry = @list_of_cols_val_tab_del)
BEGIN
SELECT @error =1, @error_message = 'Profit Center cannot be blank'
END
END
It's not working for grpo without plant created from purchase order.
Anway thanks a lot everyone quick responses.
Posts answered question.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sridharan,
It works well when delivery created from sales order/grpo created from purchase order.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sridharan,
I tested SP code it's not blocking delivery/grpo without entering plant.
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
It works fine for me. Without 'Profit Centre' (Plant) it would not allow you to add GRPO and Delivery.
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'
IF @transaction_type = 'A' AND @object_type = '20'
BEGIN
IF (SELECT max(ISNULL(T0.ocrcode,-1)) FROM PDN1 T0 WHERE T0.DocEntry = @list_of_cols_val_tab_del) != -1
begin
SET @error = 10
SET @error_message = N'Please Enter Profit Centre'
end
END
IF @transaction_type = 'A' AND @object_type = '15'
BEGIN
IF (SELECT max(ISNULL(T0.ocrcode,-1)) FROM DLN1 T0 WHERE T0.DocEntry = @list_of_cols_val_tab_del) != -1
begin
SET @error = 10
SET @error_message = N'Please Enter Profit Centre'
end
END
select @error, @error_message
END
Dear Sir
I wrote a same type of query to make the Vendor Reference No Field (NumAtCard) in GRPO and one another query for make the Project code as mandatory in the line item for the same document.
i applied the query through user defined value set up, but i am unable to solve the issue. I would like to know, how to apply the same query in to the document to make the field mandatory .
Please help me to sort out the same.
Thanks
Regards
Kashi
Thanks sudha,
SP code is working,We also want plant to be mandatory in delivery note,Whether it is possible to alter in same SP ?
Jeyakanthan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you mean you need a UDF plant have to input value by SP TN?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the Plant field a User field that you have defined?
If it is a UDF then in the definition itself you have the option to make it mandatory?
Suda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.