cancel
Showing results for 
Search instead for 
Did you mean: 

Goods Receipt

former_member682293
Participant
0 Kudos

Dear Experts

Is there any possible to stop adding the Goods Receipt without unit price.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186712
Active Contributor
0 Kudos

Hi Rathna,

Yes there is.

In the Stored Procedure, you can create a small query to avoid the user to add lines without prices.

If you need help just let me know.

Regards

former_member682293
Participant
0 Kudos

Hi silva

can you provide me the query

former_member186712
Active Contributor
0 Kudos

Sure,

  -- Documents without price in Goods Entry.

IF @OBJECT_TYPE = '59' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')

  BEGIN

   IF EXISTS(

    SELECT T0.Price FROM IGN1 T0

    where  IsNull(T0.Price, '0') = '0' and T0.DocEntry = @list_of_cols_val_tab_del)

   BEGIN

    SELECT @ERROR=1,@ERROR_MESSAGE='Please insert the price !'

  END

end

Not tested but I think it works

former_member682293
Participant
0 Kudos

Hi silva

Thanks for your reply, I will test it and let you know the status

former_member682293
Participant
0 Kudos

Hi silva

I got the following error while execute the query in stored procedure

Msg 137, Level 15, State 2, Procedure _Tmsp_goodsreceiptwithoutprice, Line 11

Must declare the scalar variable "@OBJECT_TYPE".

Msg 137, Level 15, State 2, Procedure _Tmsp_goodsreceiptwithoutprice, Line 15

Must declare the scalar variable "@list_of_cols_val_tab_del".

Msg 137, Level 15, State 1, Procedure _Tmsp_goodsreceiptwithoutprice, Line 17

Must declare the scalar variable "@ERROR"

former_member186712
Active Contributor
0 Kudos

Hi Rathna,

Did you add the query in the [SBO_SP_TransactionNotification] ?

Normally this variables should be there.

This should be the beggining of the SP

ALTER proc [dbo].[SBO_SP_TransactionNotification]

@object_type nvarchar(20),     -- 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'

"the query"

end

former_member682293
Participant
0 Kudos

Hi silva

Thanks for your reply. The query is working

Answers (0)