Danny Leolux
4th January 2005, 16:05
I have tried to make a session that can print orderdocuments based on the current production planning (tisfc012). By selecting the cwoc and date the documents should be printed.
The problem is I always get "No data within selection".
What am I doing wrong? I followed earlier examples here on Baanboard but I can't seem to get it to work.
Who can help me?
(I attached the script to explain what I've tried to do)
|******************************************************************************
|* tiprdd417m000 0 VRC B40O c4 llx4
|* Productiedocumenten op afd.bezetting printen
|* dvh
|* 17-12-04 [14:14]
|******************************************************************************
|* Script Type: 4
|******************************************************************************
|****************************** DECLARATION SECTION ***************************
declaration:
table ttisfc001
table ttisfc012
extern domain tccwoc e.cwoc
extern domain tcdate e.date.f
extern domain tcdate e.date.t
extern domain tcmcs.str20 e.device
extern domain tcorno tisfc001.pdno
extern domain tccprj tisfc001.cprj
#pragma used dll ottstpapihand
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
|****************************** CHOICE SECTION ***************************
choice.cont.process:
on.choice:
read.main.table()
|****************************** FIELD SECTION ***************************
field.e.date.f:
when.field.changes:
e.date.t = e.date.f
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
functions:
function read.main.table()
{
domain tcmcs.str100 errm
domain tcdate l.date
l.date = date.num() + 1000
select tisfc012.*, tisfc001.*
from tisfc012, tisfc001
where tisfc012._index1 inrange {:e.cwoc, :e.date.f}
and {:e.cwoc, :e.date.t}
and tisfc012.pdno refers to tisfc001
order by tisfc012._index1
selectdo
errm = ""
stpapi.put.field("tisfc0408m000", "order.sorted",
str$(tisfc.osrt.order))
stpapi.put.field("tisfc0408m000","cprj.f", "")
stpapi.put.field("tisfc0408m000","cprj.t", "ZZZZZZ")
stpapi.put.field("tisfc0408m000","pdno.f", str$(tisfc012.pdno))
stpapi.put.field("tisfc0408m000","pdno.t", str$(tisfc012.pdno))
stpapi.put.field("tisfc0408m000","opno.f", "")
stpapi.put.field("tisfc0408m000","opno.t", "999")
stpapi.put.field("tisfc0408m000","prdt.t", str$(l.date))
stpapi.put.field("tisfc0408m000", "document.sorted",
str$(tisfc.dsrt.doc.by.order))
stpapi.put.field("tisfc0408m000", "print.org",
str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "print.dupl",
str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "print.modi",
str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "covn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "roul.b", str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "oprn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "matl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "matn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "subn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "chel.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "sawl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "collect.sawl",
str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "cutl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "collect.cutl",
str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "recn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "insn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "pcdl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "print.config",
str$(tcyesno.no))
stpapi.set.report("tisfc0408m000", "rtisfc040802001",
str$(e.device), errm)
stpapi.continue.process("tisfc0408m000", errm)
stpapi.end.session("tisfc0408m000")
endselect
}
The problem is I always get "No data within selection".
What am I doing wrong? I followed earlier examples here on Baanboard but I can't seem to get it to work.
Who can help me?
(I attached the script to explain what I've tried to do)
|******************************************************************************
|* tiprdd417m000 0 VRC B40O c4 llx4
|* Productiedocumenten op afd.bezetting printen
|* dvh
|* 17-12-04 [14:14]
|******************************************************************************
|* Script Type: 4
|******************************************************************************
|****************************** DECLARATION SECTION ***************************
declaration:
table ttisfc001
table ttisfc012
extern domain tccwoc e.cwoc
extern domain tcdate e.date.f
extern domain tcdate e.date.t
extern domain tcmcs.str20 e.device
extern domain tcorno tisfc001.pdno
extern domain tccprj tisfc001.cprj
#pragma used dll ottstpapihand
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
|****************************** CHOICE SECTION ***************************
choice.cont.process:
on.choice:
read.main.table()
|****************************** FIELD SECTION ***************************
field.e.date.f:
when.field.changes:
e.date.t = e.date.f
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
functions:
function read.main.table()
{
domain tcmcs.str100 errm
domain tcdate l.date
l.date = date.num() + 1000
select tisfc012.*, tisfc001.*
from tisfc012, tisfc001
where tisfc012._index1 inrange {:e.cwoc, :e.date.f}
and {:e.cwoc, :e.date.t}
and tisfc012.pdno refers to tisfc001
order by tisfc012._index1
selectdo
errm = ""
stpapi.put.field("tisfc0408m000", "order.sorted",
str$(tisfc.osrt.order))
stpapi.put.field("tisfc0408m000","cprj.f", "")
stpapi.put.field("tisfc0408m000","cprj.t", "ZZZZZZ")
stpapi.put.field("tisfc0408m000","pdno.f", str$(tisfc012.pdno))
stpapi.put.field("tisfc0408m000","pdno.t", str$(tisfc012.pdno))
stpapi.put.field("tisfc0408m000","opno.f", "")
stpapi.put.field("tisfc0408m000","opno.t", "999")
stpapi.put.field("tisfc0408m000","prdt.t", str$(l.date))
stpapi.put.field("tisfc0408m000", "document.sorted",
str$(tisfc.dsrt.doc.by.order))
stpapi.put.field("tisfc0408m000", "print.org",
str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "print.dupl",
str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "print.modi",
str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "covn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "roul.b", str$(tcyesno.yes))
stpapi.put.field("tisfc0408m000", "oprn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "matl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "matn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "subn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "chel.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "sawl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "collect.sawl",
str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "cutl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "collect.cutl",
str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "recn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "insn.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "pcdl.b", str$(tcyesno.no))
stpapi.put.field("tisfc0408m000", "print.config",
str$(tcyesno.no))
stpapi.set.report("tisfc0408m000", "rtisfc040802001",
str$(e.device), errm)
stpapi.continue.process("tisfc0408m000", errm)
stpapi.end.session("tisfc0408m000")
endselect
}