Eddie Monster
4th January 2005, 22:13
I am trying to get a query in a customized session script to mimic a Form Query in tdpur4533m000 by setting the status = 3 (maintain receipts).

I have two functions (below) that I am trying to get the same results as querying inside the Display Purchase Order Line Status session. I can't seem to get my script query to pull the same data.

I have a bad case of the flu and just can't see what I'm doing wrong. Can anyone offer help - my brains ache.

Thank you very much in advance!

function get.tdpur045.data()
{
select tdpur045.orno, tdpur045.pono, max(tdpur045.srnb)
from tdpur045
group by tdpur045.orno, tdpur045.pono
order by tdpur045.orno, tdpur045.pono
selectdo
get.tdpur045.spur()
| get.tiitm001.data()
if tdpur045.spur = 3 then | Awaiting Maintain Receipts
rprt_send()
else
| Do Nothing...
endif
selectempty
| Do Nothing...
endselect
}


function get.tdpur045.spur()
{
select tdpur045.spur
from tdpur045
where tdpur045.orno = :tdpur045.orno
and tdpur045.pono = :tdpur045.pono
and tdpur045.srnb = :tdpur045.srnb
selectdo

selectempty
tdpur045.spur = 99
endselect

tools123
4th January 2005, 22:53
I do not have access to Baan right now, but:

1.you may try to utilize the index with status as the key field.
I know tdsls045 has one, assuming tdpur045 has one too.
Think of a display session for the same data with query.extend.

2. you may utilize the "as set with 1 rows" after ordering by
index1 desc to get only the latest seq. or where receipt qty <> 0.

Get well soon. you are lucky to have some Baan work :-)

Eddie Monster
5th January 2005, 20:53
I took your suggestion, but wasn't very successful. I was however able to derive the information I needed in a little different manner and that worked!

Thanks for your suggestion.