ravin_singh
4th February 2013, 20:34
Hi Everyone,

Recently, while a report development I am facing an issue with this query :

function get.1.consum()
{

select cprrp100.*
from cprrp100
where cprrp100.item = {:tcibd001.item}
and cprrp100.type = 4
selectdo
consum1=consum1+cprrp100.quan
endselect
}
The data is accurate. And the relation cprrp100.item = {:tcibd001.item} exists. All the relations exists as mentioned. But the problem is, Selectdo statement never gets called.


Any help??
cprrp100.item is shown as blank

Raveendranath
5th February 2013, 05:22
Hi Ravin_Singh,

The domain of cprrp100.item and tcibd001.item is different.
try this out:

where cprrp100.item(10;38) = :tcibd001.item

ravin_singh
5th February 2013, 10:21
Yes, I got that the domains are different so I used this instead:

function get.1.consum()
{

select cprrp100.*
from cprrp100
where cprrp100._index1 = {"ACT",4}
and cprrp100.psdt inrange {:odat.f} and {:next1.date}
selectdo
item2=trim$(cprrp100.item)
if(item2=item1) then | item1=trim$(tcibd001.item)
consum1=consum1+cprrp100.quan
endif
endselect
}



Its working fine now.

Thanks.

avpatil
6th February 2013, 15:31
Well thus like reading all the records irrespective of item, so you are selecting unnecessary records.