smusba
4th January 2009, 08:05
Dear Gurus,
Sometime in Report while coding I get 0(zero)values in the report while executing for the first time . Next when I run same report with same inputs again and again I get some values . Why is that I get different values in the first execution of the report.
manish_patel
5th January 2009, 07:53
It might be possible that variable initialization is not done properly. If you can post your code; someone may help you.
smusba
6th January 2009, 07:02
Here is my code:
functions:
function read.main.table()
{ |db.set.to.default(ttdsfl003)
|dqua = 0.0
select tdrpl100.*,tiitm001.*
from tdrpl100,tiitm001
where tdrpl100.rwar =:rwar
and tdrpl100.dwar = :dwar
and tdrpl100.rddt between :odat.f and :odat.t
and tdrpl100.item refers to tiitm001.item
|and tdsfl003.item refers to tdrpl100
order by tdrpl100.item
selectdo
select tdsfl003.*
from tdsfl003
where tdsfl003.orno = :tdrpl100.orno
and tdsfl003.pono = :tdrpl100.pono
selectdo
endselect
rprt_send()
endselect
}
prashant
6th January 2009, 08:35
hi,
Which fields in the report are getting wrong value while running it 2nd time.
and what is the actual value present in the table or which have to come here.
Those values which are printing wrong, Before starting the first SELECT,initialize integer fields with 0 and string field with "" .AS suggested by manish_patel
thanks
smusba
6th January 2009, 09:41
Hi,
I'm taking direct values from table tdsfl003.pqua . This value changes after first execution.
mark_h
6th January 2009, 15:56
functions:
function read.main.table()
{ |db.set.to.default(ttdsfl003)
|dqua = 0.0
select tdrpl100.*,tiitm001.*
from tdrpl100,tiitm001
where tdrpl100.rwar =:rwar
and tdrpl100.dwar = :dwar
and tdrpl100.rddt between :odat.f and :odat.t
and tdrpl100.item refers to tiitm001.item
|and tdsfl003.item refers to tdrpl100
order by tdrpl100.item
selectdo
select tdsfl003.*
from tdsfl003
where tdsfl003.orno = :tdrpl100.orno
and tdsfl003.pono = :tdrpl100.pono
selectdo
selectempty
| Initialize all tdsfl003 fields need for report
tdsfl003.pqua = 0
endselect
rprt_send()
endselect
}
Add a selectempty on tdsfl003. When it does not find a record in tdsfl003 it will have the data from the last successful find.