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

Good receipt PO

Hi all,

does anyone know how to protect quantity receipt not more than outstanding PO quantities?

for example, in my PO i have 20 pcs. then i only received 5 pcs in my first GRPO. so, the open PO quantity will be 15 pcs.

i need a protection message appear when i receipt more than 15 pcs in my next GRPO.

we tried to using stored procedure for this case, but that procedure also protect partial receipt.

does anyone can sharing with me about this case?

please help me. it's very urgent.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:53 AM


    Stored Procedure is the only way and I am sure it can be done. Please paste your original Stored proc code here and I will take a look.

    Check this out

    SELECT T0.BaseEntry, SUM(T0.Quantity) FROM [dbo\].[PDN1\] T0 INNER JOIN [dbo\].[POR1\] T1 ON T1.DOCENTRY = T0.BASEENTRY

    WHERE T0.BaseType = 22 AND T0.ItemCode = T1.ItemCode AND T0.BaseLine = T1.LineNum

    GROUP BY T0.BaseEntry

    HAVING SUM(T0.Quantity) < SUM(T1.Quantity)


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      eh sisca, nemu jg. kok jauh2 sih..:p


      DECLARE @numlinii int



      IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'20')


      SELECT @numlinii = (LineNum + 1) FROM PDN1

      WHERE PDN1.DocEntry = @list_of_cols_val_tab_del AND

      ((Quantity > BaseOpnQty))

      ORDER BY LineNum ASC

      IF (ISNULL(@numlinii, 0) <> 0)


      SET @error = 10

      SET @error_message = N'YunPho TOP Bgt ' + CONVERT(nvarchar(4), @numlinii) + N' is invalid !'

      --GOTO error_mesg




      Yun Pho

      Edited by: Yun Pho on Jan 30, 2008 2:17 PM

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.