cancel
Showing results for 
Search instead for 
Did you mean: 

Block documents with earlier Posting Date- Inventory Transfer Request

Former Member
0 Kudos

Hi Experts.,

Need to block posting inventory transfer request with earlier posting date. Could you please provide SP_TN.

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Why did you marked as assumed answer?

Former Member
0 Kudos

Hi,

Your SP_TN Not blocking. That's y marked as assumed answer.

Based on your SP_TN.

I tried to modified slightly its blocking.



IF @transaction_type IN ('A') AND @object_type = '1250000001'

BEGIN

IF EXISTS(

select T0.DocEntry from OWTQ T0 where

t0.DocEntry = @list_of_cols_val_tab_del  and

convert(nvarchar(15),t0.DocDate,102) <convert(nvarchar(15),getdate(),102))

BEGIN

SELECT @Error = 1, @error_message = 'You are not allowed to enter in earliar posting date '

END

END

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this:

IF @transaction_type in ('A') AND (@OBJECT_TYPE='1250000001')

BEGIN

If exists (SELECT t0.docentry FROM OWTQ T0 WHERE datediff(day,getdate(), T0.[DocDate] ) > 0 and  T0.DocEntry =  @list_of_cols_val_tab_del )

Begin

SET @error = 10

SET @error_message = 'Earlier posting date not allowed'

End

End

Thanks