cancel
Showing results for 
Search instead for 
Did you mean: 

Approval Procedure Credit Limit with Net days

0 Kudos

Hello, I've been trying to make an approval procedure with a query that if a customer has an invoice docstatus open and the docduedate is more than today; it goes to an approval procedure.

Can someone please help me? This is the code I've been using, and the orders gets accepted without being approved:

SELECT distinct 'true' FROM OINV T0 INNER JOIN OCRD T1 ON T0.[CardCode] = T1.[CardCode] INNER JOIN ORDR T2 ON T1.[CardCode] = T2.[CardCode] WHERE T0.[DocDueDate] > GETDATE() AND T0.[Docstatus]= 'o'

Thanks!!!

former_member233854
Active Contributor

Could you share you approval document and terms configuration screenshots?

0 Kudos

Thanks a lot for your quick response. Here are the screenshots for the approval procedure config.

0 Kudos

Images attached.

former_member233854
Active Contributor
0 Kudos

I did the same as you here and it worked with no problem.

PS: The query in your screenshot is different from the query you posted first, I tested with the query of the screenshot.

Did you try just update the Approval settings and the query ?

0 Kudos

Thanks!

Thats the problem I don't know why it doesn't work. Because the orders go just right through without doing the process.

What do you mean to update the approval setting and query?

former_member233854
Active Contributor
0 Kudos

I meant to open the approval, remove the authorization query, add again and update. I know that it is silly but I don`t know if SAP keeps the query inside the approval or run from the query manager.

What is the SAP version? And I am assuming you are creating the order with the user that you assign the authorization

0 Kudos

Ok thanks Danilo,

Yes, I'm creating the sales order with any user that appears on the first screenshot.

I have version SBO 9.2 (9.20.170) PL 07

0 Kudos

Already tried, started all over again, and nothing, can't make it work.

Accepted Solutions (0)

Answers (2)

Answers (2)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Change the table OINV to ORDR in your approval and then try.

Regards,

Nagarajan

0 Kudos

THANKS NAGARAJAN K,

I TRIED IT A FEW MINUTES AGO BUT STILL DOESN'T WORK.

THANKS A LOT FOR YOUR TIME.

former_member233854
Active Contributor
0 Kudos

Hi,

Try to change the query to

IF ((SELECT COUNT('A') FROM OINV T0 WHERE DateDiff(DD, GetDate(), T0.DocDueDate) > 0 AND T0.CardCode = $[$4.0.0]) > 0)
select 'true'
else
select 'false'
0 Kudos

I did it, but still didn't work. I don't know if I'm doing anything wrong. But the orders go right through.