priyanka pawar
16th April 2012, 12:18
Input field for this report is Business Partner, item, Sales office, Product line and date range.
Product Line column will have constant value. I had hardcode that value in report layout (before field).
Respective to Product Line column I want addition of amounts i.e only 4 line of report but now i am getting 4 pages of report.
I had written logic as,
I am selecting Item and amount from tdsls401 and from that item I am selecting production line from tcibd001 according to there production line I am adding that amount in variable.
Above function i my function which is written in program script
function read.main.table()
{
select tdsls401.*
from tdsls401
inner join tdsls400 on tdsls401.orno = tdsls400.orno
where tdsls401.odat inrange :ordt.f and :ordt.t
and tdsls401.item inrange :item.f and :item.t
and tdsls401.ofbp inrange :bpid.f and :bpid.t
and tdsls400.cofc inrange :cwoc.f and :cwoc.t
selectdo
select tcibd001.cpln
from tcibd001
where tcibd001.item = :tdsls401.item and
tcibd001.cpln inrange :div.f and :div.t
selectdo
if tcibd001.cpln="BLK" then
inorder.amt.blk=inorder.amt.blk + tdsls401.oamt
sale.amt.blk = sale.amt.blk + (tdsls401.qidl * tdsls401.pric)
total.order.blk = total.order.blk + tdsls401.qoor
open.order.blk = inorder.amt.blk - sale.amt.blk
else
if tcibd001.cpln="INT" then
inorder.amt.int = inorder.amt.int + tdsls401.oamt
sale.amt.int = sale.amt.int + (tdsls401.qidl * tdsls401.pric)
total.order.int = total.order.int + tdsls401.qoor
open.order.int = inorder.amt.int - sale.amt.int
else
if tcibd001.cpln="PWD" then
inorder.amt.pwd = inorder.amt.pwd + tdsls401.oamt
sale.amt.pwd = sale.amt.pwd + (tdsls401.qidl * tdsls401.pric)
total.order.pwd = total.order.pwd + tdsls401.qoor
open.order.pwd = inorder.amt.pwd - sale.amt.pwd
else
if tcibd001.cpln="WP" then
inorder.amt.wp = inorder.amt.wp + tdsls401.oamt
sale.amt.wp = sale.amt.wp + (tdsls401.qidl * tdsls401.pric)
total.order.wp = total.order.wp + tdsls401.qoor
open.order.wp = inorder.amt.wp - sale.amt.wp
endif
endif
endif
endif
endselect
rprt_send()
endselect
}
Please guide me.
Product Line column will have constant value. I had hardcode that value in report layout (before field).
Respective to Product Line column I want addition of amounts i.e only 4 line of report but now i am getting 4 pages of report.
I had written logic as,
I am selecting Item and amount from tdsls401 and from that item I am selecting production line from tcibd001 according to there production line I am adding that amount in variable.
Above function i my function which is written in program script
function read.main.table()
{
select tdsls401.*
from tdsls401
inner join tdsls400 on tdsls401.orno = tdsls400.orno
where tdsls401.odat inrange :ordt.f and :ordt.t
and tdsls401.item inrange :item.f and :item.t
and tdsls401.ofbp inrange :bpid.f and :bpid.t
and tdsls400.cofc inrange :cwoc.f and :cwoc.t
selectdo
select tcibd001.cpln
from tcibd001
where tcibd001.item = :tdsls401.item and
tcibd001.cpln inrange :div.f and :div.t
selectdo
if tcibd001.cpln="BLK" then
inorder.amt.blk=inorder.amt.blk + tdsls401.oamt
sale.amt.blk = sale.amt.blk + (tdsls401.qidl * tdsls401.pric)
total.order.blk = total.order.blk + tdsls401.qoor
open.order.blk = inorder.amt.blk - sale.amt.blk
else
if tcibd001.cpln="INT" then
inorder.amt.int = inorder.amt.int + tdsls401.oamt
sale.amt.int = sale.amt.int + (tdsls401.qidl * tdsls401.pric)
total.order.int = total.order.int + tdsls401.qoor
open.order.int = inorder.amt.int - sale.amt.int
else
if tcibd001.cpln="PWD" then
inorder.amt.pwd = inorder.amt.pwd + tdsls401.oamt
sale.amt.pwd = sale.amt.pwd + (tdsls401.qidl * tdsls401.pric)
total.order.pwd = total.order.pwd + tdsls401.qoor
open.order.pwd = inorder.amt.pwd - sale.amt.pwd
else
if tcibd001.cpln="WP" then
inorder.amt.wp = inorder.amt.wp + tdsls401.oamt
sale.amt.wp = sale.amt.wp + (tdsls401.qidl * tdsls401.pric)
total.order.wp = total.order.wp + tdsls401.qoor
open.order.wp = inorder.amt.wp - sale.amt.wp
endif
endif
endif
endif
endselect
rprt_send()
endselect
}
Please guide me.