Skip to Content
0

Approval Procedure Credit Limit with Net days

Sep 12, 2017 at 06:59 AM

58

avatar image
Former Member

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!!!

10 |10000 characters needed characters left characters exceeded

Could you share you approval document and terms configuration screenshots?

1
Former Member
Danilo Kasparian

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

0
Former Member
Danilo Kasparian

Images attached.

0

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
Former Member
Danilo Kasparian

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?

0

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
Former Member
Danilo Kasparian

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
Former Member
Danilo Kasparian

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

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Danilo Kasparian Sep 13, 2017 at 03:04 PM
0

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'
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0
Nagarajan K Sep 14, 2017 at 12:53 PM
0

Hi,

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

Regards,

Nagarajan

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

THANKS NAGARAJAN K,

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

THANKS A LOT FOR YOUR TIME.

0