cancel
Showing results for 
Search instead for 
Did you mean: 

Approval Procedure - Terms Based on Query HELP !

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member185682
Active Contributor

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

Former Member
0 Kudos

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

kothandaraman_nagarajan
Active Contributor
0 Kudos

Try this,

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

kothandaraman_nagarajan
Active Contributor
0 Kudos

Try this query,

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

Former Member
0 Kudos

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

kothandaraman_nagarajan
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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