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

Block GRPO Based On Items Group

How to block adding GRPO Based on the Items Group.My exact Requirement is to block GTPOs for items whose Group is "PVS Resin" ie SELECT T0.[ItmsGrpNam], T0.[ItmsGrpCod], T1.[ItemName], T1.[ItemCode] FROM OITB T0 INNER JOIN OITM T1 ON T0.ItmsGrpCod = T1.ItmsGrpCod WHERE T0.[ItmsGrpNam] = 'PVC Resin' I need to block adding GRPO of items as per the above query.How van i do this??Is it possible through approval procedure??

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2016 at 09:06 AM

    Hi Nabil,

    try below SP, just change the T2.ItmsGrpCode according to your Item group code.

    IF @transaction_type IN (N'A', N'U')

    AND (@object_type = '20')

    BEGIN

    IF EXISTS(

    SELECT T0.DocEntry

    FROM OPDN T0

    INNER JOIN PDN1 T1

    ON T0.DocEntry = T1.DocEntry

    INNER JOIN OITM T2

    ON T1.itemcode = T2.Itemcode

    WHERE T0.DocEntry = @list_of_cols_val_tab_del AND T2.ItmsGrpCod = '100'

    )

    BEGIN

    SELECT @Error = 13

    SELECT @error_message = 'Error, Pls change Item group'

    END

    END

    Thanks,

    Harshal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2016 at 08:52 AM

    Hi Nabil,

    You can do that through SP_Transaction Notification.

    Thanks,

    Harshal

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Harshal , How can i do this ? I've created an approval procedure with the following query ,I don't know if it is working or not.Also please share me the SP to achieve this.I'm not sure about my method. SELECT T0.[DocNum], T1.[Dscription], T1.[ItemCode], T2.[ItmsGrpNam] FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry, OITB T2 WHERE T2.[ItmsGrpNam] ='PVC Resin'

  • Posted on Jan 12, 2016 at 11:05 PM

    Hi,

    It is not possible to block by approval procedure. You have to above stored procedure at SQL Server management studio under Transaction notification.

    Please search in this forum to work with transaction notification.

    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.