Skip to Content
author's profile photo Former Member
Former Member

Block documents with earlier Posting Date- Inventory Transfer Request

Hi Experts.,

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Nov 18, 2015 at 02:32 PM

    Hi,

    Why did you marked as assumed answer?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Posted on Nov 18, 2015 at 02:09 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.