2 Replies Latest reply: May 17, 2012 4:58 PM by zipi ganan RSS

Approval query 2

zipi ganan
Currently Being Moderated

Last week I sent a quetion about an approval query.

 

This is the link

http://scn.sap.com/thread/3174007#

 

The answer Gordon gave me helped me alot.

 

Now I would like to add another condition to the query and i do not succeed.

 

The query which was build with Gordon's help is this :

 

"

SELECT distinct 'true'

FROM dbo.OINV T0

INNER JOIN dbo.OCRD T1 ON T0.CardCode = T1.CardCode

INNER JOIN dbo.OBPP T2 ON T1.Priority = T2.prioCode and T2.priocde = 2

WHERE T0.CardCode = $[oinv.CardCode"

 

The added condition is  - the invoice should be only items invoice.

 

Can you please help me? thank you

 

Zipi Ganan

  • Re: Approval query 2
    Jitin Chawla
    Currently Being Moderated

    Hi,

     

    Check this :

     

    SELECT distinct 'true'

    FROM dbo.OINV T0

    INNER JOIN dbo.OCRD T1 ON T0.CardCode = T1.CardCode

    INNER JOIN dbo.OBPP T2 ON T1.Priority = T2.prioCode and T2.priocde = 2

    WHERE T0.CardCode = $[oinv.CardCode]  and T0.Doctype ='I'

     

    Kind Regards,

    Jitin

    SAP Business One Forum Team

    • Re: Approval query 2
      zipi ganan
      Currently Being Moderated

      thank you for your help. i've solved it in  another way . here is my solution

       

      "SELECT distinct 'true'

      FROM dbo.OINV T0
      INNER JOIN dbo.OCRD T1 ON T0.CardCode = T1.CardCode

      WHERE $[OINV.docType] =  'I' and T1.priority = 2 and T0.CardCode = $[oinv.CardCode].

       

      thanks again

       

      Zipi Ganan