smusba
15th December 2008, 07:49
Dear Gurus,
Below i had written the Query to get the lot no of the order type (purchase)
1:i.e I should track those items with lots for purchase.
2:these lots i should match to get the suppliers.
This is my script.
field.item.f:
when.field.changes:
item.t = item.f
field.ddat.f:
when.field.changes:
ddat.t = ddat.f
|****************************** function section ******************************
functions:
function read.main.table()
{
flag = 0
kgs = 0.0
cas = 0.0
totcas = 0.0
totkgs = 0.0
stra = 0.0
totstra = 0.0
stoc = 0.0
qty = 0.0
amnt = 0.0
select tdsls045.*
from tdsls045
|where tdsls045.cwar between :cwar.f and :cwar.t
where tdsls045.ddat between :ddat.f and :ddat.t
and tdsls045.item between :item.f and :item.t
order by tdsls045.item,tdsls045.ddat
selectdo
select tdilc401.*
from tdilc401
|where tdilc401.item between :item.f and :item.t
where tdilc401.koor = tdilc.koob.act.sls
|and tdilc401.cwar = :tdsls045.cwar
|and tdilc401.clot = :tdltc001.clot
and tdilc401.item = :tdsls045.item
and tdilc401.orno = :tdsls045.orno
and tdilc401.pono = :tdsls045.pono
order by tdilc401.clot
selectdo
select tdltc001.*
from tdltc001
where tdltc001.olot = tdltc.olot.purch
and tdltc001.clot = :tdilc401.clot
selectdo
endselect
if tdilc401.clot = clot then
else
flag = 1
kgs = 0.0
qty =0.0
amnt = 0.0
endif
kgs = tdilc401.qsts
qty = qty + tdsls045.dqua
amnt = amnt + tdsls045.amnt
select tiitm001.*
from tiitm001
|where tiitm001.item = :tdilc401.item
where tiitm001.item = :tdsls045.item
selectdo
endselect
rprt_send()
endselect
endselect
}
I have attached my output as well.
see the output it is giving different values for the same input in supplier column
Below i had written the Query to get the lot no of the order type (purchase)
1:i.e I should track those items with lots for purchase.
2:these lots i should match to get the suppliers.
This is my script.
field.item.f:
when.field.changes:
item.t = item.f
field.ddat.f:
when.field.changes:
ddat.t = ddat.f
|****************************** function section ******************************
functions:
function read.main.table()
{
flag = 0
kgs = 0.0
cas = 0.0
totcas = 0.0
totkgs = 0.0
stra = 0.0
totstra = 0.0
stoc = 0.0
qty = 0.0
amnt = 0.0
select tdsls045.*
from tdsls045
|where tdsls045.cwar between :cwar.f and :cwar.t
where tdsls045.ddat between :ddat.f and :ddat.t
and tdsls045.item between :item.f and :item.t
order by tdsls045.item,tdsls045.ddat
selectdo
select tdilc401.*
from tdilc401
|where tdilc401.item between :item.f and :item.t
where tdilc401.koor = tdilc.koob.act.sls
|and tdilc401.cwar = :tdsls045.cwar
|and tdilc401.clot = :tdltc001.clot
and tdilc401.item = :tdsls045.item
and tdilc401.orno = :tdsls045.orno
and tdilc401.pono = :tdsls045.pono
order by tdilc401.clot
selectdo
select tdltc001.*
from tdltc001
where tdltc001.olot = tdltc.olot.purch
and tdltc001.clot = :tdilc401.clot
selectdo
endselect
if tdilc401.clot = clot then
else
flag = 1
kgs = 0.0
qty =0.0
amnt = 0.0
endif
kgs = tdilc401.qsts
qty = qty + tdsls045.dqua
amnt = amnt + tdsls045.amnt
select tiitm001.*
from tiitm001
|where tiitm001.item = :tdilc401.item
where tiitm001.item = :tdsls045.item
selectdo
endselect
rprt_send()
endselect
endselect
}
I have attached my output as well.
see the output it is giving different values for the same input in supplier column