GRPO Quantity in Excess of PO Quantity

Hi,
1. I want to block receipt of quantity (GRPO) if it is in excess of PO quantity.  How can I do this?
2. Alternatively, I want to set tolerance of, say +/- 10%, deviation from PO quantity.  How can I set up this tolerance?
Thanks,
Nash'at

Hi,
Below is the query
if @transaction_type = 'A' and @object_type = '20'
begin
     if exists(select T.docentry from pdn1 T, por1 T1 where T.docentry = @list_of_cols_val_tab_del and T.baseentry = T1.docentry and T.Quantity > T1.Quantity)
     begin     
          SET @error = 10
          SET @error_message = N'GRPO Qty cannot be more than PO'
     end
end
for add the above code to add in SQL you can search in the forums for documentation as SP_Transaction, you will get lot of information.
Hope this helps your problem
Regards
Shanker

Similar Messages

  • SP to Block GRPO Qty if greater than PO Qty

    Hi all,
    I need to block the GRPO Document when adding it if the Qty in the GRPO is greater than the PO Qty.
    But this Stored Procedure blocks me even when i raise the GRPO with Qty less than the PO Qty.
    IF @transaction_type IN ('A') AND
    (@Object_type = '20')
    BEGIN
    IF EXISTS (SELECT T1.BaseEntry
    FROM dbo.OPDN T0
    INNER JOIN dbo.PDN1 T1 ON T1.DOCENTRY = T0.DocEntry
    INNER JOIN dbo.POR1 T2 ON T2.DOCENTRY = T1.BaseEntry
    WHERE T1.BaseType = '22' AND
    T1.ItemCode = T2.ItemCode AND
    T1.BaseLine = T2.LineNum AND
    T0.DOCENTRY = @list_of_cols_val_tab_del
    GROUP BY T1.BaseEntry
    HAVING SUM(T1.Quantity) > SUM(T2.OpenQty))
    Begin
    SELECT @Error = 10, @error_message = 'GRPO quantity is greater than PO  quantity'
    End
    END
    Is something wrong with this SP...

    Hi
    Check bellow Sp
    --------------- Validation for Goods Receipt PO Restricting Excess Qunatity ----------------------------
    IF @Object_type = '20' and @transaction_type = 'A'
    BEGIN
    declare  @line int
    SELECT @line = (LineNum + 1)
    From PDN1
    Where PDN1.DocEntry = @list_of_cols_val_tab_del
       and (Quantity > BaseOpnQty)
    Order by LineNum
    If (not ISNULL(@line, 0) = 0)
    begin
      Set @error = 10
      Set @error_message = 'Line quantity' + CONVERT(nvarchar(4), @line) +' is more then open quantity !'
    end
    END
    Thanks& Regards
    AndakondaRamudu

  • GRPO Validation

    Hi all,
    I am trying to provide validation to Grpo document.
    my requierment is as follows.
    1) i have one PO with 10 qty.
    2) i create one grpo doc. based on this PO and i receive 4 qty now my open qty is 6.
    3) when next time i create grpo based on this po ,grpo doc will bydefault display 6 qty .
    now my requierment is like if increase grpo qty greater than partialy open po Qty(in this example >6) it should give error.
    i have following validation but its not working with partial delivery of purchase order.
    --GRPO Quantity Should not Be Greater than PO Quantity.
    IF @transaction_type IN (N'A', N'U') AND
    (@Object_type = N'20')
    begin
    if exists (SELECT T0.BaseEntry,sum(T0.Quantity),sum(T1.Openqty)
    FROM dbo.PDN1 T0 INNER
    JOIN dbo.POR1 T1 ON T1.DocEntry =
    T0.BaseEntry inner JOIN dbo.OPDN T2 ON T0.DocEntry = T2.DocEntry
    WHERE T0.BaseType = 22 AND T0.BaseLine
    = T1.LineNum --and T0.ItemCode = T1.ItemCode
    and T0.DOCENTRY = @list_of_cols_val_tab_del and T2.DocType='I'
    group by T0.BaseEntry
    Having (Sum (T0.Quantity) > sum (T1.Quantity )) or (Sum (T0.quantity) > sum(T1.openqty)))
    begin
    select @Error = 10, @error_message =
    'Item Qty In GRPO can not be greater than Item Qty in Purchase Order Document'
    end
    end
    kindly provide the solution.
    thanx in advance.

    Hi,
    Try this
    IF @transaction_type IN (N'A', N'U') AND
    (@Object_type = N'20')
    begin
    if exists (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
    and T0.DOCENTRY = @list_of_cols_val_tab_del
    GROUP BY T0.BaseEntry
    HAVING (SUM(T0.Quantity) > SUM(T1.Quantity)) or sum(t0.quantity) > sum(t0.BaseOpnQty))
    begin
    select @Error = 10, @error_message = 'GRPO
    quantity is greater PO quantity'
    end
    end
    Hope this helps,
    Son

  • Reg: SP_Transaction for GRPO

    Hi All,
    I had written an SQL Code in SP_Tranasction, where GRPO Quantity is more than PO Qty.
    The code works perfectly when the GRPO Quantity is more than PO Quantity, but stops even when GRPO Quantity is equal to PO Quantity.
    Below is the code:
    if @transaction_type = 'A' and @object_type = '20'
    begin
         if exists(select T.docentry from pdn1 T, por1 T1 where T.docentry = @list_of_cols_val_tab_del and T.baseentry = T1.docentry and T.Quantity > T1.OpenQty)
         begin     
              SET @error = 10
              SET @error_message = N'GRPO Qty cannot be more than PO'
         end
    end
    Currently we are using 2005B PL35.
    Please help me to resolve.
    Regards
    Shanker

    Try this one:
    if @transaction_type = 'A' and @object_type = '20'
    begin
         if exists(select T.docentry from pdn1 T, por1 T1 where T.docentry = @list_of_cols_val_tab_del and T.baseentry = T1.docentry and
            T.Quantity > T1.OpenQty and T.BaseLine = T1.LineNum)
         begin     
              SET @error = 10
              SET @error_message = N'GRPO Qty cannot be more than PO'
         end
    end
    Thanks,
    Gordon

  • Qty and Price changes in GR(PO) Document

    Hi All,
               One of my client want to restrict the Qty and Unit Price of GR(PO) Document in such a way where a user should not be able to change the Qty and Unit price while posting a  GR(PO) Document.
               The System what is followed now is :
               Say User raised a Purchase Order Of Qty - 5 Tons & Unit Price - 100/-
               This Purchase Order will get approved by Manager and then it gets added. Once the Purchase order gets added we post GR(PO) Document copying the same Purchase Order to the GR(PO) Document.
               Say We received the material.........Qty - 5.2 Tons...........In this case system should allow to post this quantity and add the GR(PO) Document.
               Where as when We received Qty - 6 Tons, System should not allow to post with this Quantity, (Say there should be some variance in Quantity which has to be allowed)
               Is there any settings which can be made to achive this????????????
    Thanks and Regards,
    Sree.

    hi,
    u can achieve it thru SP_TransactionNotification
    try this code
    --      Block GRPO if in Excess in PO Qty
    IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'20')
    begin
         if exists (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 and T0.DOCENTRY = @list_of_cols_val_tab_del
         GROUP BY T0.BaseEntry
         HAVING (SUM(T0.Quantity) > SUM(T1.Quantity)) or sum(t0.quantity) > sum(t0.BaseOpnQty))
         begin
              select @Error = 10, @error_message = 'GRPO quantity is greater PO quantity'
         end
    end
    fidel

  • Decimals in Qty and Price in Table control

    Hi All,
    I have having two issues with decimals in table control.
    1. I have a field defined as type KWMENG in the Internal table that is mapped to the table control. I also gave the REF FIELD in the
        field properties as it is a QTY field and FORMAT as QUAN.
        Issue: THe issue here is the data is displaying as 100.000. As this is a QTY field we want it to show just 100.
        I tried changing it to CHAR field and display but this will not work for me as i am using this data later in some calculations.
    2. The other issue is with the PRICE field. I have defined as type KWERT in the internal table mapping to the table control. I gave
        FORMAT as DEC in field properties.
        Issue: The issue here is when the calculated value is say 5.60 it is displaying as 5.00.
    Does anyone has any idea. I think i am missing something but not sure what it is.
    Thanks in advance,
    Karuna.

    hi,
    u can achieve it thru SP_TransactionNotification
    try this code
    --      Block GRPO if in Excess in PO Qty
    IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'20')
    begin
         if exists (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 and T0.DOCENTRY = @list_of_cols_val_tab_del
         GROUP BY T0.BaseEntry
         HAVING (SUM(T0.Quantity) > SUM(T1.Quantity)) or sum(t0.quantity) > sum(t0.BaseOpnQty))
         begin
              select @Error = 10, @error_message = 'GRPO quantity is greater PO quantity'
         end
    end
    fidel

  • Problem in fetching data by using loop.

    Hello Friends,
    i have to create one report based upon item wise.
    Based upon item wise i have displayed Total stock qty and
    then item wise GRPO details with Qty data.
    I have created Stored procedure for this.
    Now i have kept one column RestQty which is basically used to
    display rest quantity based upon the data of Total Stock Qty and GRPO quantity.
    To Implement this logic i have used loop condition but its not returning correct
    qty on Rest Qty column.
    Rest Qty should work like this:-
    Item aaaaa
    If Total Quantity = 28
    GRPO Quantity = 40(First GRPO Qty),
              7(second last GRPO Qty), &
              3 (Last GRPO Quantity)
    Now Total quantity always first check with Last GRPo Qty,
    it means 28 > 3 then 3 comes to Rest Qty col.
    then Total quantity check with second Last GRPo Qty,
    it means 28 > 7 + 3(Last GRPo Qty) then 7 comes to Rest qty col.
    then Total quantity first check with first GRPo Qty,
    it means 28 > 40(first grpo qty) + 7 + 3, its not satisfied,
    hence it should display 28 - (7+3) = 18 in rest qty col.
    if we sum Rest qty column for Item aaaa then it should equal to Total Qty for particular item.
    so its should work for Item aaaa, based upon this other items should work like this.
    so i only need to correct the data of Rest Qty col, other are ok.
    Please help me to correct this query.
    Regards,

    SELECT OITM.ItemCode,OITM.ItemName,sum(OITW.onhand) as onhand,abc.basenum as GRPONo, abc.docdate as GRPODate,
    (select top 1 docrate from opdn where docentry = abc.baseentry and docnum = abc.basenum) as GRPORate,
    (select  sum(quantity) from pdn1 where docentry = abc.baseentry and abc.itemcode = itemcode) As GRPOQty,null,
    (select top 1 price from pdn1 where docentry = abc.baseentry and abc.itemcode = itemcode) As GRPOUnitPrice,
    (select distinct top 1 opch.docnum from opch inner join pch1 on opch.docentry = pch1.docentry
    where pch1.baseentry = abc.baseentry) as APInvNo,
    (select distinct top 1 opch.docdate from opch inner join pch1 on opch.docentry = pch1.docentry
    where pch1.baseentry = abc.baseentry) as APInvDt,
    (select distinct top 1 opch.u_dodamt from opch inner join pch1 on opch.docentry = pch1.docentry
    where pch1.baseentry = abc.baseentry) as APInvDocRate
    FROM OITW
    INNER JOIN OITM ON OITW.ItemCode = OITM.ItemCode
    INNER JOIN OITB ON OITM.ItmsGrpCod = OITB.ItmsGrpCod
    left join sri1 as abc on OITW.ItemCode = abc.ItemCode
    WHERE(OITW.OnHand <> 0 Or oitw.iscommited <> 0 Or oitw.onorder <> 0 Or oitw.minstock <> 0)
    AND (OITW.ItemCode IN (SELECT pdn1.ItemCode FROM Opdn
    inner join pdn1 on opdn.docentry = pdn1.docentry
    where opdn.series = 314 or opdn.series = 94 or opdn.series = 663))and (abc.Direction = 0)
    AND (abc.LineNum =(SELECT MAX(LineNum) AS Expr1 FROM  SRI1
    WHERE (ItemCode = abc.ItemCode) AND (SysSerial = abc.SysSerial))) AND basetype = 20
    and abc.docdate >= (@FromDate) and abc.docdate <= (@ToDate)
    group by OITM.ItemCode,OITM.ItemName, oitm.suppcatnum,
    abc.basenum, abc.sysserial, abc.baseentry, abc.basenum, abc.docdate,
    oitm.ItmsGrpcod, oitb.ItmsGrpNam, abc.baseentry, abc.SysSerial, abc.ItemCode,oitw.itemcode
    order by OITM.ItemName,abc.basenum

  • Stored Procedure To Block if A/R Delivery Qty Qty in Sales Order

    Hi Experts,
    Can we Block to post the A/R Delivery Document if the quantity is greater than the quantity mentioned in the Sales order (Base Document).
    If We can Please Help me with the procedure
    With regards,
    G.Eshvanth Singh

    Hi,
    Here is a store procedure to block delivery creation if its qty is exceeding SO qty:
    IF @transaction_type IN (N'A', N'U') AND
    (@Object_type = N'20')
    begin
    if exists (SELECT T0.BaseEntry, SUM(T0.Quantity)
    FROM [dbo].[DLN1] T0 INNER
    JOIN [dbo].[RDR1] T1 ON T1.DOCENTRY =
    T0.BASEENTRY
    WHERE T0.BaseType = 22 AND T0.ItemCode =
    T1.ItemCode AND T0.BaseLine = T1.LineNum
    and T0.DOCENTRY = @list_of_cols_val_tab_del
    GROUP BY T0.BaseEntry
    HAVING (SUM(T0.Quantity) > SUM(T1.Quantity)) or sum(t0.quantity) > sum(t0.BaseOpnQty))
    begin
    select @Error = 10, @error_message = 'GRPO
    quantity is over PO quantity'
    end
    end
    you place the SP_TN into your SQL server SBO company database programmability --> system store procedures --> dbo.SBO_SP_TransactionNotification --> right click this dbo --> select Script stored Procedure as select Alter to New query editor,
    the result will be as follows:
    @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'
    -- ADD YOUR CODE HERE
    -- Select the return values
    select @error, @error_message
    end
    GO
    There are five out parameters:
    Put the code I have given in the -- ADD YOUR CODE HERE part.
    let me know your e-mail address if you want to have SP_TN pdf file from SAP
    Rgds,

  • Query for vendor rating

    Dear All
    I want a query for Vendor rating, which is based on PO Date  PO Quantity GROP Date GRPO Quantity (i.e comparision on that and we can find out this vendor is good for me.)
    Pls Provide me solution.

    Moving this thread from ERP-MM to [SAP Business One Core|SAP Business One Application;

  • Authorization at row level

    Hi All,
    I have a scenario where if a particular user creates a purchase order andhe selects as incorret warehouse, the document should go for approval. I tried the following query but this send any purchase order created fr approval.
    SELECT DISTINCT 'TRUE'  FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[WhsCode] ='MS0006'
    What could be wrong with this query?
    Thanks,
    Joseph

    Hi Istvan,
    Similarly i have created codes for other documents.
    IF @transaction_type IN (N'A', N'U')
    begin
    if exists(select T.docentry from WOR1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[wareHouse] in ( '1','2','MS0007','MS0001','MS0003','MS0004','MS00010','MS0011', 'MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076', 'MS0077',
    'MS0079', 'MS0090', 'MS0123', 'MS0134', 'MS0138', 'MS0198', 'MS0210', 'MS0233', 'MS0234', 'MS0269', 'MS0273', 'MS0274', 'MS0283',
    'MS0284', 'MS0287' , 'MS0288', 'MS0333',
    'MS0078', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0202', 'MS0203') )
    begin
    SET @error = 21
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    If @object_type='20' AND @transaction_type = 'A'
    BEGIN
    If Exists
    (SELECT T0.Price, T1.Price
       FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry and
                T0.BaseLine=T1.LineNum and T0.BaseType=22
       WHERE T0.DocEntry = @list_of_cols_val_tab_del
         and T0.Price!=T1.Price)
    Begin
    SELECT @error = 1,
    @error_message = 'Price is different from order !'
    End
    END
    IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'20')
    begin
         if exists (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 and T0.DOCENTRY = @list_of_cols_val_tab_del
         GROUP BY T0.BaseEntry
         HAVING (SUM(T0.Quantity) > SUM(T1.Quantity)) or sum(t0.quantity) > sum(t0.BaseOpnQty))
         begin
              select @Error = 10, @error_message = 'GRPO quantity is greater PO quantity'
         end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '22'
    begin
    if exists(select T.docentry from POR1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0006','MS0007','MS0011', 'MS0012','MS0014', 'MS0015','MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076',
    'MS0078', 'MS0079', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0201', 'MS0202', 'MS0203', 'MS0217','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '20'
    begin
    if exists(select T.docentry from PDN1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0006','MS0007','MS0011', 'MS0012','MS0014', 'MS0015','MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076',
    'MS0078', 'MS0079', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0201', 'MS0202', 'MS0203', 'MS0217','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '21'
    begin
    if exists(select T.docentry from RPD1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0006','MS0007','MS0011', 'MS0012','MS0014', 'MS0015','MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076',
    'MS0078', 'MS0079', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0201', 'MS0202', 'MS0203', 'MS0217','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '18'
    begin
    if exists(select T.docentry from PCH1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0006','MS0007','MS0011', 'MS0012','MS0014', 'MS0015', 'MS0016','MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076',
    'MS0078', 'MS0079', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0201', 'MS0202', 'MS0203', 'MS0217','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '19'
    begin
    if exists(select T.docentry from RPC1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0006','MS0007','MS0011', 'MS0012','MS0014', 'MS0015','MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076',
    'MS0078', 'MS0079', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0201', 'MS0202', 'MS0203', 'MS0217','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '17'
    begin
    if exists(select T.docentry from RDR1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0007','MS0001','MS0003','MS0004','MS00010','MS0011', 'MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076', 'MS0077',
    'MS0079', 'MS0090', 'MS0123', 'MS0134', 'MS0138', 'MS0198', 'MS0210', 'MS0233', 'MS0234', 'MS0269', 'MS0273', 'MS0274', 'MS0283',
    'MS0284', 'MS0287' , 'MS0288', 'MS0333',
    'MS0078', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0202', 'MS0203','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '15'
    begin
    if exists(select T.docentry from DLN1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0007','MS0001','MS0003','MS0004','MS00010','MS0011', 'MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076', 'MS0077',
    'MS0079', 'MS0090', 'MS0123', 'MS0134', 'MS0138', 'MS0198', 'MS0210', 'MS0233', 'MS0234', 'MS0269', 'MS0273', 'MS0274', 'MS0283',
    'MS0284', 'MS0287' , 'MS0288', 'MS0333',
    'MS0078', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0202', 'MS0203','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '16'
    begin
    if exists(select T.docentry from RDN1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0007','MS0001','MS0003','MS0004','MS00010','MS0011', 'MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076', 'MS0077',
    'MS0079', 'MS0090', 'MS0123', 'MS0134', 'MS0138', 'MS0198', 'MS0210', 'MS0233', 'MS0234', 'MS0269', 'MS0273', 'MS0274', 'MS0283',
    'MS0284', 'MS0287' , 'MS0288', 'MS0333',
    'MS0078', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0202', 'MS0203','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '13'
    begin
    if exists(select T.docentry from INV1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0007','MS0001','MS0003','MS0004','MS00010','MS0011', 'MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076', 'MS0077',
    'MS0079', 'MS0090', 'MS0123', 'MS0134', 'MS0138', 'MS0198', 'MS0210', 'MS0233', 'MS0234', 'MS0269', 'MS0273', 'MS0274', 'MS0283',
    'MS0284', 'MS0287' , 'MS0288', 'MS0333',
    'MS0078', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0202', 'MS0203','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    IF @transaction_type IN (N'A', N'U') and @object_type = '14'
    begin
    if exists(select T.docentry from RIN1 T where T.docentry = @list_of_cols_val_tab_del and
    T.[WhsCode] in ( '1','2','MS0007','MS0001','MS0003','MS0004','MS00010','MS0011', 'MS0022', 'MS0023','MS0024',
    'MS0027','MS0028','MS0035', 'MS0040', 'MS0041','MS0042','MS0043','MS0044','MS0048', 'MS0062', 'MS0065', 'MS0076', 'MS0077',
    'MS0079', 'MS0090', 'MS0123', 'MS0134', 'MS0138', 'MS0198', 'MS0210', 'MS0233', 'MS0234', 'MS0269', 'MS0273', 'MS0274', 'MS0283',
    'MS0284', 'MS0287' , 'MS0288', 'MS0333',
    'MS0078', 'MS0091', 'MS0137', 'MS0143', 'MS0153', 'MS0154', 'MS0155', 'MS0156', 'MS0158', 'MS0183',
    'MS0199', 'MS0202', 'MS0203','P00001','P00002','P00003','P00007','P00008','P00009','P00010','P00011',
    'P00012','P00013','P00014','P00015','P00016','P00017','P00018','P00026','P00028','P00030','P00033') )
    begin
    SET @error = 20
    SET @error_message = N'YOU CANNOT USE THIS WAREHOUSE FOR THE TRANSACTION'
    end
    end
    Now at times, we get the error message that header data is missing.
    Thanks,
    Joseph

  • Open Quantity of PO in GRPO PLD

    Hi All
    How do you display the open quantity (which is still not delivered) of purchase order into the PLD of Goods Receipt PO?
    Thanks
    SV Reddy

    Hi SV,
    i think, it is possible on FMS.
    (or)
    Try to Create the Query PLD for example Check the below thread,
    Detailed , POs after GRPO -Balance Qty Query
    Regards,
    Madhan.

  • How to restrict the excess quantity delivery from the delivery note ?

    Dear All,
    As we know we make the delivery note with the reference of sales order so ordered quantity will be copied in the delivery note automatically. At the time of picking we can reduce the delivery quantity and make the partial delivery.
    But for example I have the sales order of quantity 5 and I make the delivery with refernce of same Sales order so my delivery quantity comes 5 and now if I make the quantity 7 instead of 5 in delivery note only and do the picking of 7 quantity yet system is allowing me then PGI is also possible. It means I delivering excess good than the ordered quantity. Which should not happen to make the cycle full proof.
    I dont what setting is required to avoid this major error. please Gurus Reply soon.
    regards,
    Vojas

    Hi,
    Use t-code 0VLP, select your item category which u determining in delivery >>> Go to details>>>in fron of Min/Max Qty put option B
    Check minimum qty   --- B (Situation rejected with an error message)
    Check overdelivery  --- B (Situation rejected with an error message).
    When user try to change qty,system will give error.
    Kapil
    Edited by: Kapildev Farakte on Dec 28, 2009 10:33 AM

  • Error "Part1 will not be done for the excess GR quantity" in STO GRN

    Hi,
    While posting STO grn the error message is displayed "Part1 will not be done for the excess GR quantity".
    We have checked CIN settings for Excise groups, the "GRs per EI" is maintained as "2 Multiple goods receipt, multiple credit".
    In J1ID, for materials it is already maintained as "2 Multiple goods receipt, multiple credit".
    No partial GR is posted for the delivery.
    Still system is throwing the error message "Part1 will not be done for the excess GR quantity".

    Hi,
    Please provide the following for a clear picture.
    1. PO qty
    2. Quantity invoiced by the supplying plant
    3. Quantity you are mentioning in GR
    Regards,
    Siva

  • Updating quantity in existing GRPO (before creation of excise document)

    We have a case, especially when we get solvents (liquid hydrocarbons which are prone to evaporation losses), wherein a quantity comes with a delivery challan, but the correct quantity (after adding acceptable loss of solvent to actual quantity unloaded in the factory) will be given with the VAT and excise invoices, usually given 1-2 days after supplying the material. In this mean time, I should be able to enter the actual quantity unloaded and proceed with issues to production, and later on add the acceptable loss quantity to the existing GRPO, and go for creating excise invoices.
    I don't think this is possible in the current SAP B1. Please add this functionality in a future release. This will be a problem for every chemical company that buys solvents from traders (which almost everyone does).

    Closing for lack of better answers or solutions.

  • How To Reverse Excess Confirmed Quantity in Process Order?

    Hi Experts,
    Good day!
    I have a Process Order with Total Quantity of 68,180 L which currently have  a status of TECO CNF  DLV  PRC  BASC BCRQ GMPS MACM*. I made my first partial confirmation with a quantity of 1,000 L for my Finished Good u2013 this is a confirmation with automatic goods receipt. Then I mistakenly made my Final Confirmation for this order with a quantity of 71,125 L for my Finished Good. I only noticed that my last confirmation was incorrect after the Finished Good in Stock has been depleted already. The 101 movement for the Finished Good that was posted during my final confirmation was not reversed anymore when I canceled my confirmation in CORS. I tried to reverse using a 102 movement type for this order in MB31 however it didnu2019t allow me to proceed and gave me an error said u201Cdeficit of .....in Unrestricted useu201D.
    Currently my Process Order has a total Delivered Quantity of 72,125 L which is much greater than the required total order quantity of 68,180 L.
    Anybody knows how to reverse this excess confirmed quantity? Your response is much appreciated.
    Thanks. Have a wondeful day!
    Rockz

    Hi Rockz,
    You mean you made Good Receipt (confirmation) excess 3,945L .
    Right now, you want to cancel only 3,945L.
    As you said, FG already depleted.
    If have no quantity in unrestricted Use, how can we make good movement(102) (because error:u201Cdeficit of .....in Unrestricted useu201D occur when you do TCode MB31 for 102)
    If you want to cancel 3,945L, first, you must reverse that Batch of FG 3,945L to Unrestricted use (MMBE to check stock), then you use the TCode MB31 with movement 102 for reverse FG excess, if this finish, quantity in delivery of Process Order will be subtract 3,945L.
    (reverse that Batch of FG 3,945L to Unrestricted use ,mean is  the Batch of FG which you depleted for somethings like fill to bottle....)
    Regard,
    DiepNguyen.

Maybe you are looking for

  • How can i move photos from my iphone to my pc

    Hi all Please help! Im trying to transfer photos from my iphone 4s to my pc and i havent a clue how! Can someone please give me an idiots guide about how to do this! Regards James

  • How to send Mail to external system - Check the program ?

    Hi all,       The following is a ABAP Program to Send a mail to external mail id. this program is not showing error but when executed it say "No message sent" what i've to do to overcome this hurdles. if any solution or prerequisites then ' please gi

  • Image (Co. Logo) in Template header appears but not in Topic when viewing a topic which is attached to the Template

    I have an image (Co. logo) placed in the header of a template. Topics are attached to the template. I also have a separate page that has hyperlinks to the the Topics in the several books I have in the project. When I generate (WebHelp) project and vi

  • No audio in iTunes

    "Suddenly" (isn't it always?) I have no audio in iTunes (10.6.1). Audio in other apps is fine. May be something obvious, but I'm stumped. Any ideas?

  • Automating/Speeding Up PDF Production

    I use Illustrator CS5 and in the course of one day I might make 10-20 PDFs (through the 'Save As' function utilizing Presets). I'm curious to know of any budget-minded solutions to automate this process or at least speed it up. In my dreams I would l