on 10-24-2015 3:39 AM
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
hi experts,
can someone help me on this? thank you very much..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Silent Knight,
If I setup Approval Procedure with below query on Sales Order Level, it works.
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]
This query will not directly run in query generator as there is another way of checking the output.
Please make sure that you have done below settings for Originator and Sales Order document shown below.
1. Approval Stage
2. Approval Template-Originator Tab
3. Approval Template-Document Tab
4. Approval Template-Stages Tab
5. Approval Template-Terms Tab
Once you do all the settings and apply query to the template. Open Sales Order and select customer whose CreditLine<Balance and keep the Sales Order open and Go to Tools-->Queries-->User Queries--> and click on the approval query that you saved (Query shown in screen shot in my test case) and once it returns True in query output then it will go for approval.
Hope this will help you to identify where what goes wrong.
Thanks,
Rahul
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your query is not linked with sales order and its validating only OCRD balance, not with sales order document total.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.