cancel
Showing results for 
Search instead for 
Did you mean: 

writing approval condition

Y-Yusuf
Explorer
0 Kudos
274

Hi experts,

I am trying to write an approval query to send vendor invoices without a base document for approval, but since the BaseType field is not a physical field, I cannot see the item and column numbers. How should I write the query? Writing it as $[$OPCH."BaseType"] does not work. Please help me. 

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

SonTran
Active Contributor
0 Kudos
Y-Yusuf
Explorer
0 Kudos
Hi, I tried the query. It sends the A/P invoice without a base document for approval, but it also sends an A/P invoice that I opened with the copy target from a purchase order for approval. So, it's not working exactly as intended. Thanks.
SonTran
Active Contributor
0 Kudos
I tested the query in my test environment and it works fine. Could you please check if there is other approval template that still trigger AP Invoice document
Y-Yusuf
Explorer
0 Kudos
It worked. Thank you very much, regards.

Answers (2)

Answers (2)

seanarchernz
Explorer
0 Kudos

Hi,

BaseType is stored at document line level as a document may draw from multiple base documents.

When there is no base document the PCH1.BaseType will be -1.  So your query could check for a MAX(PCH1.BaseType) = -1 to determine if there are no base documents.  Or MIN(PCH1.BaseType) = -1 to determine if the are at least some lines without base documents.

Y-Yusuf
Explorer
0 Kudos
Hi, I tried PCH1, but it didn't work. Can you show me how to use it in the query, because what I have tried so far hasn't worked? Thanks, regards.
nidhisingh14
Product and Topic Expert
Product and Topic Expert
0 Kudos
Y-Yusuf
Explorer
0 Kudos
Hi, I have already done enough research and looked at all this content. None of it worked. Instead, I would appreciate it if you could directly help me write the query. I want to trigger the approval process for a vendor invoice that does not have a base document. Thanks, regards.