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

Similar Messages

  • Validation If unit price of GRPO is different from PO

    Hi,
    I  am trying to assign 1 validation for scenario mentioned in the subject. The validation which i have tried is showing me error even if i have not changed the unit price at the GRPO level.
    IF @transaction_type IN (N'A', N'U') AND
    (@Object_type = N'20')
    begin
    if exists (SELECT T1.[Price], T3.[Price] FROM OPDN T0  INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN OPOR T2 ON T2.DocEntry=T1.BaseEntry  INNER JOIN POR1 T3 ON T2.DocEntry = T3.DocEntry
    WHERE T1.ItemCode=T3.ItemCode And T1.[Price]<>T3.[Price])
    Begin
    select @Error = 10, @error_message =
    'UNit price is different from PO'
    Regards-
    Monica.

    Hi Mona
    Try with this : 
    If @object_type='20' AND @transaction_type = 'A'
    BEGIN
    If Exists
    (SELECT TRUE
       FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry and
                T0.BaseLine=T1.LineNum
       WHERE T0.DocEntry = @list_of_cols_val_tab_del
          AND (T0.BaseRef=' ' or T0.BaseRef IS NULL)
         AND T0.Price!=T1.Price)
    Begin
    SELECT @error = 1,
    @error_message = 'Price is different'
    End
    END
    The logic is same but becasue of data coming into the system . Also check in your database
    select * from POR1
    Hope this helps
    Bishal

  • Excise Condition Types with validity

    Dear All
    Is it possible to maintain tax conditions with validity periods. for ex: jmop 8% from 1/1/2010 to 26/02/2010....10% from 27/02/2010 to 31//3/2010..If Yes, what tax rate will be triggered for existing open PO's. If the GRPO date is 27.02.2010 or 28.02.2010
    Kindly throw some light
    Regards
    JK

    Hi,
    As per our observations,
    If PO is before 27.2.2010 and GRN on or after 27.2.2010, system will calculate JMOP @ 10% only.(.(Condition Record JMOP-8%-1.1.2001 -26.2.2010) & ( 10% from 27.2.2010-31.12.2010 )
    If GRN Booked before 27.2.2010 and invoice booking on or after 27.2.2010 Cenvat Clearing will be @8% only.(Condition Record JMOP-8%-1.1.2001 -26.2.2010) & ( 10% from 27.2.2010-31.12.2010 )
    IF PO is on or after 27.2.2010 JMOP @ 10% only.
    Experts Pl. comment on this.
    Regards,
    Rajeswari

  • 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

  • View data in client B from client A in the same SID without a valid logon?

    Hi Folks
    We are planning on upgrading our 4.6C system to ERP 6.0, and are initialy considering having two clients in the same sandbox SID.  One would be for the developers to perform code remediation checks (client A), and one would contain a copy of production data for performing testing of functionality over live data (client B).
    Would it be possible to view data in client B from client A in the same system without a valid logon to client B or RFC connection to client B from client A?   For example via the use on an ABAP program to SQL the database?
    I know one can use transactions like SM30/SM31 to view, compare, and adjust data between clients, but this requires an RFC connection and valid logon to the target client.
    Regards
    Kevin.

    Hi Kevin.
    >
    Kevin McLatchie wrote:
    > Would it be possible to view data in client B from client A in the same system without a valid logon to client B or RFC connection to client B from client A?   For example via the use on an ABAP program to
    Short answer: yes.
    If someone has the right to write and execute ABAP reports on the system he is able to access the data of all clients. So I don't think that this setup is advisable. Don't mix development and production data in one system.
    Best regards,
    Jan

  • DEVOLUÇÃO DE EXPORTAÇÃO - CFOP 3201 - GRC VALIDA DADOS DI.

    Boa tarde a todos!
    Estamos em um projeto de NFE XML 2.00 e nos deparamos com o seguinte erro:
    Ao emitirmos um NF-e de devolução da mercadoria que se encontrava no Porto (devolução de exportação - CFOP 3201), a validação do monitor GRC informa que é necessário constar os dados de importação, apesar deste processo não se tratar de importação. Os seguintes logs de validação são gerados:
    Erro de validação: campo Código do fabricante estrangeiro no sistema. Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_ADI-CFABRICANTE, ID campo I028)
    Erro de validação: campo Nº da adição. Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_ADI-NADICAO, ID campo I026)
    Erro de validação: campo Nº sequencial do artigo na adição. Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_ADI-NSEQADIC, ID campo I027)
    Erro de validação: campo . Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_IMP-CEXPORTADOR, ID campo I024)
    Erro de validação: campo . Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_IMP-DDESEMB, ID campo I023)
    Erro de validação: campo . Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_IMP-DDI, ID campo I020)
    Erro de validação: campo . Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_IMP-NDI, ID campo I019)
    Erro de validação: campo . Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_IMP-UFDESEMB, ID campo I022)
    Erro de validação: campo . Campo é obrigatório e não pode ficar em branco. (campo IT_NFE_IMP-XLOCDESEMB, ID campo I021)
    Estamos no SAPK-10015INSLLNFE e as seguintes notas relacionadas a validação estão aplicadas:
    1493980     Validation for field xJust in cancel and skipping messages
    1499921     Problem with validation after implementing SP15
    1500046     Upgrade validation rule for field ID for version 2.00
    1500742     Adjust validation for field NADICAO and NSEQADIC layout 2.00
    1502217     Extend validation rules for , layout 2
    1504379     Adjust validation for field X_CLISTSERV
    1511291     Update allowed values for field E1_CPAIS for validation
    1511577     Update validation rules for field VUNCOM_V20
    1520861     Update validation rules for OIL_CPRODANP and OIL_UFCONS
    Não encontrei nenhuma nota SAP recente para o componente SLL-NFE que seja relacionada a este problema.
    Desde já agradeço pela ajuda.
    Sds / Renato Penido.

    Boa tarde, Fernando,
    Obrigado pela pronta resposta.
    Debugamos a BADI e descobrimos que os dados de importação estão sendo gravado "em branco", gerando o erro de validação no GRC, tal qual dito por você.
    Aprimoramos a lógica da BADI para que a tag de importação não seja preenchida indevidamente para as notas de devolução do porto e as notas foram aprovadas.
    Muito obrigado,
    Renato Penido.

  • How do i open a web page with VeriSign Class 3 Extended Validation SSL SGC SS CA certfificate i can't open web pages with this, how do i open a web page with VeriSign Class 3 Extended Validation SSL SGC CA certfificate i can't open web pages with this

    how do i open a web page with VeriSign Class 3 Extended Validation SSL SGC SS CA ?

    Hi
    I am not suprised no one answered your questions, there are simply to many of them. Can I suggest you read the faq on 'how to get help quickly at - http://forums.adobe.com/thread/470404.
    Especially the section Don't which says -
    DON'T
    Don't post a series of questions in  a single post. Splitting them into separate threads increases your  chances of a quick answer.
    PZ
    www.pziecina.com

  • When i login it says my apple id is valid but its not an icloud id

    when I try to login i get a message telling me my apple id is valid but its not an icloud id .I dont have any apple mobile priducts so i have no idea what to do.Any advice would be greatly appreciated.

    You are getting this message because you are trying to create an iCloud account on a PC by signing with your Apple ID.  You can only sign into an existing account on a PC.  You first have to create iCloud account on an iOS device (iPhone, iPad or iPod Touch) running iOS 5 or higher, or on a Mac running OS X Lion (10.7.5) or higher.  After creating your account on one of these devices you will then be able to sign into the account using this ID on your PC.

  • Closing stock report with GRPO

    Hai all
      Please help me to write this query,
    For example
    I have  query to take closing stock report ,but my requirement is ,i want split up for Closing stock and closingvalue
    like, if i have 40 closing stock means i want details how 40 is arrived
    for example i run closing stock report as on 2009-03-31
    means i want this format
    Itemcode ClosingStock Closing value
    ITM001         40                460
    ITM002         20                210.......
    ItemCode GRPOno. VendorCode quantity Rate  GRPO Date
    ITM001        10001          V0001      10       10      2009-02-01
    ITM001        10002          V0002      20       11     2009-03-15
    ITM001        10003          V0003      10       14    2009-03-31
    ITM002        10021          V0011      10       10      2009-02-11
    ITM002        10022          V0015      10       11     2009-03-14

    Hai Jeyakanthan A 
      I want small change in your query
    SELECT T0.ItemCode,T0.TransType, SUM(T0.InQty)-SUM(T0.OutQty) AS 'Closing Stock',SUM(T0.OpenValue) as 'Balance' FROM OINM T0
    *where docdate <= '[%0]'*
    GROUP BY T0.ItemCode,T0.TransType
    Having
    T0.TransType = 20 ORDER BY T0.ItemCode,T0.TransType
    I tried this query for taking closing stock for given date, its giving me correct result
    SELECT T0.ItemCode, T0.Ref1, T0.CardCode, T0.InQty, T0.Price, T0.DocDate FROM OINM T0 WHERE T0.TransType = 20 AND
    (T0.DocDate >= '[%0]' AND
    T0.DocDate <= '[%1]') ORDER BY T0.ItemCode, T0.Ref1, T0.CardCode, T0.InQty, T0.Price, T0.DocDate
    In this query i want only the GRPO no,date,price.... for closing stock quantity
    Edited by: Prasanna s on May 14, 2009 12:39 PM

  • HT204053 Dear Support Team, every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud???

    Dear Support Team,
    Every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud?
    Thanks

    It is not possible to create a new iCloud account using a Windows machine. You must create the account using a Mac (10.7.5 or more) or an IOS device (iPhone etc). Once that is done you can sign into and use the account on your Windows machine.

  • TS1368 When I try to make a purchase at the App Store or iBook Store or iTunes an error message tells me my account is not valid at the UK store. I live in Canada so how did I get to be connected to the UK and how can I get back to Canada?

    When I try to make a purchase at the App Store or iBook store or at iTunes an error message tells me my account is not valid for the UK store. I've no idea how I got connected there and I'd like help getting back to Canada where I live. Any suggestions?

    Change App Store
    1. Tap "Settings"
    2. Tap "iTunes & App Stores"
    3.Tap "View Apple ID"
    4. Enter your user name and password.
    5. Tap "Country/Region."
    6. Tap "Change Country/Region"
    7. Select the region where you are located.
    8. Tap "Done".

  • Creating Master to show only rows for which valid entries exist in Detai

    I have created a Master-Detail Form in my Apex application based off of views to tables in a private remote Database.
    In the Master-Detail Creation Wizard, at the "Link Master and Detail" page, I specified that the defined Primary Key in the Master Column should be equal to the corresponding Foreign Key in the Detail Column.
    My goal is to have my Master Form only display rows for which a valid corresponding entry exists in the Detail Form. Yet, the above setup returns all of the rows from the Master Table, even where the corresponding Detail entry is blank.
    Can you provide some light on what I'm doing wrong, and how I can accomplish what I want to do?
    Thank you!

    I have created a Master-Detail Form in my Apex application based off of views to tables in a private remote Database.
    In the Master-Detail Creation Wizard, at the "Link Master and Detail" page, I specified that the defined Primary Key in the Master Column should be equal to the corresponding Foreign Key in the Detail Column.
    My goal is to have my Master Form only display rows for which a valid corresponding entry exists in the Detail Form. Yet, the above setup returns all of the rows from the Master Table, even where the corresponding Detail entry is blank.
    Can you provide some light on what I'm doing wrong, and how I can accomplish what I want to do?
    Thank you!

  • Validating records into a maintenance view

    Hi folks!
    I have a simple Z table (say ZTABLE) and a Z view based on it with some related description (say ZVIEW).  The ZTABLE has a DEC field (called COEF) with 2 decimals and it should have only numbers between 0 and 1.
    I set the valid interval from 0 to 1 but, as help says, it's only checked for CHAR, NUMC, DEC, INT1, INT2 and INT4 data types.  Not for DEC.
    Then I use an event on ZVIEW.  On SE11 I went to "Table maintenance generator" - Environment - Modification - Events.  So there I put the 05 event (Creating a new entry) and I programed the check.  It works fine for new entries, but if you have a record on table and you want to change the COEF field you can put there any number, even outside the 0-1 range.
    I tried with the 01 event (Before saving the data in the database) but it seams to be called only for last record.
    Could anybody tell me what can I do?
    Thanks!

    Hi,
    Since it is a Z TABLE..
    You can directly modify the flow logic in SE51.
    Go to SE51
    Give the program name - SAPL + Function group name
    Screen number
    Press change..
    In the flow logic..
    Add a module after the FIELD ztable-number, in the PAI event..
    Ex..
    FIELD ZTABLE-NUMBER MODULE NUMBER_CHECK.
    And in the module validate the number..
    MODULE NUMBER_CHECK INPUT.
      IF ZTABLE-NUMBER <> '0' OR
          ZTABLE-NUMBER <> '1'.
         MESSAGE E208(00) WITH 'Not a valid number'.
      ENDIF.
    ENDMODULE.
    Thanks,
    Naren

  • Mandatory item validation at a page level?

    Hi,
    We have a page where the list of mandatory items changes according to how some 'key' items are set by the user e.g. if they select option 1 on item 1 we need a different set of mandatory fields than if they set option 2 - setting option 1 in item 4, may imply that some further items are mandatory, In addition, some items become mandatory due to circumstances known only on the database. We have in excess of 40 items on this page. Once all mandatory items are complete, the status of the page is saved as 'complete' - the user can always save the page as 'incomplete'.
    We already have a database package that can check a table row to see if it is 'complete', it knows all the circumstances for when an items becomes mandatory and can produce a list of fields and the reasons why they have failed validation.
    Is it possible to call this db package during page validation and use it to perform 'item' validations i.e. identify the invalid items and place the appropriate message inline with them?

    Hi,
    You can create a pl/sql page validation where you call you procedure.
    begin
    package_k.proc_p(item1,item2,...,itemN);
    end;
    You should define the type of the validation, but it is very straight forward,
    Regards,
    Max.

  • Error message 'not a valid PDF document'

    Hi folks,
    my Z10 has trouble opening some PDF documents sent as email attachment. When I try to open them the error message appears:
    Important message
    The document cannot be opened because it is not a valid PDF document
    There is no BES10 Service involved in my environment. Mails are synced with with active sync.
    OS Version: 10.2.0.429
    Any suggestion appreciated.
    Best regards,
    RAUMPATROUILLE

    Stuffit is the only app I know of which can decompress its own format. Your Windows clients must use the free Expander to open them. Otherwise, use OS X's built in zip compression and they'll be able to open the files without the need of third party software. Right click on any item, or group of items and choose, "Compress xxx Items" (how it will read if more than one item is chosen).

Maybe you are looking for