Skip to Content

SAP B1 Approval Procedure

Hi Sir/Ma'am,

I'am trying to create a simple query for my Approval Procedure in SAP B1

,i want to execute approval procedure if OCRD.creditline is less than OCRD.Balance , my problem is everytime i create a sales order it will asking me for approval even creditline is greater than balance, i am sorry i am new of creating script/s, please see my script below for your assistance:

SELECT distinct 'true' FROM OCRD T0 INNER JOIN ORDR T1 ON T0.CardCode = T1.CardCode WHERE T0.[CreditLine] < T0.[Balance]

Regards,

silentknight

1.png (17.1 kB)
2.png (22.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 27, 2015 at 12:15 AM

    hi experts,

    can someone help me on this? thank you very much..

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 24, 2015 at 03:35 AM

    Hi,

    Your query is not linked with sales order and its validating only OCRD balance, not with sales order document total.

    Thanks,

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 25, 2015 at 08:35 PM

    Hi,

    Looks like the Approval Query is not complete and make sure that you have selected Sales Order under Documents Tab of Approval template.

    Please use the below query

    SELECT distinct 'true' FROM OCRD T0 INNER JOIN ORDR T1 ON T0.CardCode = T1.CardCode WHERE T0.[CreditLine] < T0.[Balance] and T0.CardCode=$[$4.0.0]

    Thanks,

    Rahul


    Add comment
    10|10000 characters needed characters exceeded

    • by the way sir i tried also this but still user can add the sales order even the creditline is less than balance.

      SELECT distinct 'true' FROM OCRD T0 INNER JOIN ORDR T1 ON T0.CardCode = T1.CardCode WHERE T0.[CreditLine] < ( T0.[Balance] ) and t0.cardcode =t1.cardcode

      regards

      silentknight