Skip to Content
0

Approval Procedure - Terms Based on Query HELP !

Jan 23, 2017 at 08:20 AM

82

avatar image
Former Member

Hi,

I have two requirement on the approval query, basically the concept is the same just that it apply in different document. So there will be two different query.

Requirement A:

A/P Invoice need approval if Doctotal > 1000 AND CardCode NOT IN ('A001', 'A002')
Which mean A/P Invoice can be created directly if Doctotal < 1000 or Doctotal > 1000 and CardCode is A001/A002

Requirement B:

Outgoing Payment need approval if Doctotal > 1000 AND CardCode NOT IN ('A001', 'A002')
Which mean Outgoing Payment can be created directly if Doctotal < 1000 or Doctotal > 1000 and CardCode is A001/A002

Thank you

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

DIEGO LOTHER Jan 23, 2017 at 12:27 PM
1

Hi Olga,

If I understood correct. Use this queries:

A/P Invoice

SELECT CASE WHEN $[$4.0.0] NOT IN ('A001', 'A002') AND $[$29.0.NUMBER] > 1000 THEN 'TRUE' ELSE 'FALSE' END

Outgoing Payment

SELECT CASE WHEN $[$5.0.0] NOT IN ('A001', 'A002') AND $[$45.0.NUMBER] > 1000 THEN 'TRUE' ELSE 'FALSE' END

Hope it helps.

Kind Regards,

Diego Lother

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

Hi Diego,

Sorry to bother you again, can you help me on this post?

https://answers.sap.com/questions/290267/sp-tn-to-check-the-value-of-a-column-field-in-oins.html

Thanks

0
Nagarajan K Jan 23, 2017 at 08:34 AM
0

Hi,

Try for AP Invoice,

SELECT Distinct 'True' FROM OPCH T0 WHERE $[$4.0.0] IN ('V20000','V30000') and $[$29.0.Number] >1000

Note: Change card code in above query.

Regards,

Nagarajan

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

Hi Nagarajan,

It doesn't work when I try to create the A/P Invoice, show error message as below:

Could not commit transaction: Error -1 detected during transaction

Thanks

0
Nagarajan K Jan 23, 2017 at 12:47 PM
0

Try this query,

SELECT Distinct 'True' FROM OPCH T0 WHERE $[-$4.0.0] NOT IN ('V20000','V30000') and $[$29.0.Number] >1000

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

Hi,

The query doesn't work either.

It showed error message in a second and the document can be created even meet the approval condition.

Error message = "Internal error (-1003) occurred [Message 131-183]

Thanks

0
Nagarajan K Jan 24, 2017 at 07:41 AM
0

Try this,

SELECT Distinct 'True' FROM OPCH T0 WHERE $[-$4.0.0] NOT IN ('V20000','V30000') and $[OPCH.Doctotal.Number] >1000

Share
10 |10000 characters needed characters left characters exceeded