JoeleZ
1st February 2013, 04:34
I'm new in baan board, and i want to ask to anyone that mastering reporting.
i want to create report for manufacturing order, that have multiple operation.
and i want to print from MO and printing all of the operation, and break page each operation.
right now i already creating program script but it was just printing for one operation per MO. now we have MO with multiple operation. how can i change the code that i have? here i'll put my code
|******************************************************************************
|* tisfc9401 0 VRC B617 u bsi1
|* Manufacturing Order
|* Installation user
|* 2012-10-25
|******************************************************************************
|* Main table tisfc001 Production Orders, Form Type 4
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttisfc001 | Production Orders
table tbptmm120
table tticst001
table ttcibd001
extern domain tcpdno pdno.f fixed
extern domain tcpdno pdno.t fixed
extern domain tcbool detail.lay
extern domain tcbool hours.line
extern domain tcbool wip.line
extern domain tcbool estimate.line
extern domain tcitem item.product
extern domain tcdsca item.dsca
extern domain tccuni uom
extern domain tiqcp1 quantity
extern domain tiqro2 target.hour
extern domain tcnoru normal.person
extern domain tccwoc work.center
extern domain tcdsca work.cent.name
extern domain tclogn user.log
extern domain tcbool fill.line
|****************************** program section ********************************
|****************************** group section **********************************
group.1:
init.group:
get.screen.defaults()
|****************************** choice section ********************************
choice.cont.process:
on.choice:
execute(print.data)
choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
else
choice.again()
endif
|****************************** field section *********************************
field.pdno.f:
when.field.changes:
pdno.t = pdno.f
|****************************** function section ******************************
functions:
function read.main.table()
{
user.log = logname$
fill.line = false
select tisfc001.*
from tisfc001
where tisfc001._index1 inrange {:pdno.f}
and {:pdno.t}
order by tisfc001._index1
selectdo
detail.lay = false
get.target.hour.and.normal.person()
rprt_send()
print.wip()
print.estimated.materials()
estimate.line = true
detail.lay = false
rprt_send()
estimate.line = false
fill.line = true
rprt_send()
fill.line = false
selectempty
message("No data within selection")
return
endselect
}
function print.wip()
{
|* Yet to decide the logic, when customer comes up with logic to calculate, this can filled
}
function print.estimated.materials()
{
detail.lay = true
select ticst001.*
from ticst001
where ticst001._index1 = {:tisfc001.pdno}
selectdo
item.product = ticst001.sitm
item.dsca = get.item.desc()
select tcibd001.*
from tcibd001
where tcibd001.item = {:tisfc001.mitm}
selectdo
uom = tcibd001.cuni
selectempty
uom = "PCS"
endselect
quantity = ticst001.ques
rprt_send()
endselect
detail.lay = false
}
function domain tcdsca get.item.desc()
{
domain tcdsca l.dsca
l.dsca = ""
select tcibd001.dsca:l.dsca
from tcibd001
where tcibd001._index1 = {:ticst001.sitm}
as set with 1 rows
selectdo
break
endselect
return(l.dsca)
}
function get.target.hour.and.normal.person()
{
target.hour = 0
work.center = ""
normal.person = 0
select tisfc010.prte:target.hour,
tisfc010.cwoc:work.center
from tisfc010
where tisfc010._index1 = {:tisfc001.pdno}
|as set with 1 rows
selectdo
select tirou001.noop:normal.person,
tirou001.dsca:work.cent.name
from tirou001
where tirou001._index1 = {:work.center}
|as set with 1 rows
selectdo
endselect
endselect
}
please help me....
my jobs is on the line...
best regards,
Yoel
i want to create report for manufacturing order, that have multiple operation.
and i want to print from MO and printing all of the operation, and break page each operation.
right now i already creating program script but it was just printing for one operation per MO. now we have MO with multiple operation. how can i change the code that i have? here i'll put my code
|******************************************************************************
|* tisfc9401 0 VRC B617 u bsi1
|* Manufacturing Order
|* Installation user
|* 2012-10-25
|******************************************************************************
|* Main table tisfc001 Production Orders, Form Type 4
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttisfc001 | Production Orders
table tbptmm120
table tticst001
table ttcibd001
extern domain tcpdno pdno.f fixed
extern domain tcpdno pdno.t fixed
extern domain tcbool detail.lay
extern domain tcbool hours.line
extern domain tcbool wip.line
extern domain tcbool estimate.line
extern domain tcitem item.product
extern domain tcdsca item.dsca
extern domain tccuni uom
extern domain tiqcp1 quantity
extern domain tiqro2 target.hour
extern domain tcnoru normal.person
extern domain tccwoc work.center
extern domain tcdsca work.cent.name
extern domain tclogn user.log
extern domain tcbool fill.line
|****************************** program section ********************************
|****************************** group section **********************************
group.1:
init.group:
get.screen.defaults()
|****************************** choice section ********************************
choice.cont.process:
on.choice:
execute(print.data)
choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
else
choice.again()
endif
|****************************** field section *********************************
field.pdno.f:
when.field.changes:
pdno.t = pdno.f
|****************************** function section ******************************
functions:
function read.main.table()
{
user.log = logname$
fill.line = false
select tisfc001.*
from tisfc001
where tisfc001._index1 inrange {:pdno.f}
and {:pdno.t}
order by tisfc001._index1
selectdo
detail.lay = false
get.target.hour.and.normal.person()
rprt_send()
print.wip()
print.estimated.materials()
estimate.line = true
detail.lay = false
rprt_send()
estimate.line = false
fill.line = true
rprt_send()
fill.line = false
selectempty
message("No data within selection")
return
endselect
}
function print.wip()
{
|* Yet to decide the logic, when customer comes up with logic to calculate, this can filled
}
function print.estimated.materials()
{
detail.lay = true
select ticst001.*
from ticst001
where ticst001._index1 = {:tisfc001.pdno}
selectdo
item.product = ticst001.sitm
item.dsca = get.item.desc()
select tcibd001.*
from tcibd001
where tcibd001.item = {:tisfc001.mitm}
selectdo
uom = tcibd001.cuni
selectempty
uom = "PCS"
endselect
quantity = ticst001.ques
rprt_send()
endselect
detail.lay = false
}
function domain tcdsca get.item.desc()
{
domain tcdsca l.dsca
l.dsca = ""
select tcibd001.dsca:l.dsca
from tcibd001
where tcibd001._index1 = {:ticst001.sitm}
as set with 1 rows
selectdo
break
endselect
return(l.dsca)
}
function get.target.hour.and.normal.person()
{
target.hour = 0
work.center = ""
normal.person = 0
select tisfc010.prte:target.hour,
tisfc010.cwoc:work.center
from tisfc010
where tisfc010._index1 = {:tisfc001.pdno}
|as set with 1 rows
selectdo
select tirou001.noop:normal.person,
tirou001.dsca:work.cent.name
from tirou001
where tirou001._index1 = {:work.center}
|as set with 1 rows
selectdo
endselect
endselect
}
please help me....
my jobs is on the line...
best regards,
Yoel