Sandy Blondino
5th June 2014, 17:46
Hello,
I have a question about what should be a simple query in Baan IV script, but it doesn't appear to be working as it did in the past.
The query is:
select ticst001.sitm, ticst001.opol, ticst001.pdno, ticst001.cwar
fromticst001
where ticst001._index3 = {:ticst001.sitm} |, :1} |:tcittb.standard}
and ticst001._index1 = {:tisfc001.pdno}
and ticst001.opol = tcittb.standard
selectdo
select tdilc101.loca, tdilc101.cwar, tdilc101.item, tdilc101.strs
from tdilc101
where tdilc101._index1 = {:ticst001.cwar}
and tdilc101.item = :ticst001.sitm
selectdo
on.hand.qty = tdilc101.stks
endselect
| if ticst001.opol = tcittb.standard then
| |on.hand.qty = tdilc101.strs
| on.hand.qty = tdilc101.stks
| endif
endselect

bhushanchanda
5th June 2014, 18:50
Hi,

Which select loop it doesn't enter? What is the error shown? Have you checked under debugger if the values passed to first selection are right and the record exists? Also try with variables instead of passing table fields.

Sandy Blondino
5th June 2014, 18:58
Sorry. Here is the cleaned up version:

select ticst001.sitm, ticst001.opol, ticst001.pdno, ticst001.cwar
from ticst001
where ticst001._index3 = {:ticst001.sitm}
and ticst001._index1 = {:tisfc001.pdno}
and ticst001.opol = tcittb.standard
selectdo
select tdilc101.loca, tdilc101.cwar, tdilc101.item, tdilc101.strs
from tdilc101
where tdilc101._index1 = {:ticst001.cwar}
and tdilc101.item = :ticst001.sitm
selectdo
on.hand.qty = tdilc101.stks
endselect
endselect


I don't get any errors.
When I step through in debug, I can see the correct values in the on.hand.qty field, but they do not print on the report. Only 0's print.

bhushanchanda
5th June 2014, 19:08
Oh,

So the problem is not with this query. Some questions:-

Is this within your report script or program script?
Is the variable on.hand.qty added in your report input fields?

Sandy Blondino
5th June 2014, 20:29
This code is from the report script.

The variable on.hand.qty is defined in the report script, but not listed in the report input fields because it gives an error when defined in 2 places.

bhushanchanda
5th June 2014, 20:45
Are there any conditions defined in the report layout? Pls attach a snapshot of the report layouts.

Sandy Blondino
5th June 2014, 20:59
the condition on layout detail.4 is 'material list' = yes.
The field 'material list' on the session form always default to yes.

bhushanchanda
5th June 2014, 21:01
Add material list field in report input fields and its done.

JaapJD
6th June 2014, 09:11
tdilc101.stks is missing in the select part of the 2nd query.

bhushanchanda
6th June 2014, 10:49
tdilc101.stks is missing in the select part of the 2nd query.

Thats it. I guess you got your answer. Please do not double post.

avpatil
10th June 2014, 19:15
Isn't this query is wrong
where ticst001._index3 = {:ticst001.sitm}
It should query with some other field and not with ticst001

JaapJD
10th June 2014, 22:54
It can be right if some value has been assigned to ticst001.sitm before the query is executed.