hanibal
24th November 2008, 13:19
i have this report script shown below.i need to print similiar report but with condition to print only the " bom = tibom010.sitm" which have ( "retail.price = tdisa001.prir = 0 ")
i dont know if i can apply this condition in session script as then it will be applied for all reports related to this session,unless there is a way that i dont know to make it apply for 1 report.
------------------------
declaration:
table ttdisa001
table ttihra350
table ttcmcs008
table ttcibd001
table ttibom010
extern domain tcqiv1 sub.total
extern domain tcpric retail.price
extern domain tcpric unit.price
extern domain tcpric exc.rate
extern domain tcqiv1 total.amt.d
double sub.total1(1,100)
double retail.price1(1,100)
|string item.dsca1(50,100)
string unit1(50,100)
string bom.dsca1(50,100)
string bom1(50,100)
double qty1(1,100)
long i,j
domain tcitem bom
domain tcbool print.bom
domain tcdsca bom.dsca
|domain tcdsca item.dsca
domain tccuni unit
domain tiqbm2 qty
|domain tcpric retail.price
|domain tcqiv1 sub.total
before.tdsls401.item.1:
before.layout:
unit.price = 0.00
i = 0
j = 1
select tibom010.*
from tibom010
where tibom010._index1 = {:tdsls401.item}
|as set with 1 rows
selectdo
i = i + 1
j = 1
bom1(1,i)= tibom010.sitm
qty1(1,i)= tibom010.qana
select tdisa001.*
from tdisa001
where tdisa001._index1 = {:tibom010.sitm}
|group by tdisa001.item
as set with 1 rows
selectdo
select tcibd001.*
from tcibd001
where tcibd001._index1 = {:tibom010.sitm}
selectdo
unit1(1,i) = tcibd001.cuni
bom.dsca1(1,i) = tcibd001.dsca
endselect
retail.price1(1,i) = tdisa001.prir
sub.total1(1,i) = tdisa001.prir * tibom010.qana
unit.price = unit.price + tdisa001.prir*tibom010.qana
endselect
endselect
detail.5:
before.layout:
bom= ""
qty = 0
if j <= i then
bom = bom1(1,j)
qty = qty1(1,j)
bom.dsca = bom.dsca1(1,j)
unit = unit1(1,j)
retail.price = retail.price1(1,j)
sub.total = sub.total1(1,j)
endif
after.layout:
bom= ""
qty = 0
j = j + 1
if j <= i then
layout.again()
else
for j = 1 to 100
bom1(1,j) = ""
qty1(1,j) = 0
bom.dsca1(1,j) = ""
unit1(1,j) = ""
retail.price1(1,j) = 0
sub.total1(1,j) = 0
endfor
print.bom = FALSE
endif
i dont know if i can apply this condition in session script as then it will be applied for all reports related to this session,unless there is a way that i dont know to make it apply for 1 report.
------------------------
declaration:
table ttdisa001
table ttihra350
table ttcmcs008
table ttcibd001
table ttibom010
extern domain tcqiv1 sub.total
extern domain tcpric retail.price
extern domain tcpric unit.price
extern domain tcpric exc.rate
extern domain tcqiv1 total.amt.d
double sub.total1(1,100)
double retail.price1(1,100)
|string item.dsca1(50,100)
string unit1(50,100)
string bom.dsca1(50,100)
string bom1(50,100)
double qty1(1,100)
long i,j
domain tcitem bom
domain tcbool print.bom
domain tcdsca bom.dsca
|domain tcdsca item.dsca
domain tccuni unit
domain tiqbm2 qty
|domain tcpric retail.price
|domain tcqiv1 sub.total
before.tdsls401.item.1:
before.layout:
unit.price = 0.00
i = 0
j = 1
select tibom010.*
from tibom010
where tibom010._index1 = {:tdsls401.item}
|as set with 1 rows
selectdo
i = i + 1
j = 1
bom1(1,i)= tibom010.sitm
qty1(1,i)= tibom010.qana
select tdisa001.*
from tdisa001
where tdisa001._index1 = {:tibom010.sitm}
|group by tdisa001.item
as set with 1 rows
selectdo
select tcibd001.*
from tcibd001
where tcibd001._index1 = {:tibom010.sitm}
selectdo
unit1(1,i) = tcibd001.cuni
bom.dsca1(1,i) = tcibd001.dsca
endselect
retail.price1(1,i) = tdisa001.prir
sub.total1(1,i) = tdisa001.prir * tibom010.qana
unit.price = unit.price + tdisa001.prir*tibom010.qana
endselect
endselect
detail.5:
before.layout:
bom= ""
qty = 0
if j <= i then
bom = bom1(1,j)
qty = qty1(1,j)
bom.dsca = bom.dsca1(1,j)
unit = unit1(1,j)
retail.price = retail.price1(1,j)
sub.total = sub.total1(1,j)
endif
after.layout:
bom= ""
qty = 0
j = j + 1
if j <= i then
layout.again()
else
for j = 1 to 100
bom1(1,j) = ""
qty1(1,j) = 0
bom.dsca1(1,j) = ""
unit1(1,j) = ""
retail.price1(1,j) = 0
sub.total1(1,j) = 0
endfor
print.bom = FALSE
endif