PeterM
9th September 2011, 20:53
I've written a own 3 GL Conversion Program for a printer and configured a printer. That works well, but in the Conversion Program I've some cases, I do not anything. There's no printout in this cases. I want to produce an Error-Entry in the Baan Printqueue in this cases. Does any Body know which global Variable I've to set, or another way to give back an error ?

P.S.: The variable "ret" does not work, also "e" has no effect.

THX for your help ...

mark_h
9th September 2011, 21:25
Why not just put a text file somewhere on the system that says "No data found". Then when you get an empty report instead of running the conversion program on it you just sent this file through the conversion. Not 100% sure I understand what you are asking.

PeterM
12th September 2011, 16:24
Thanks for your attempt of help Mark.
I found the simplest answer for my problem: Just write the Error directly in the BaaN-Printqueue table ttaad320 ( in company 000 ) :

select max(ttaad320.seqn):max.seq
from ttaad320
where ttaad320._compnr = 0
and ttaad320.user = :logname$
and ttaad320.date = date.num()
and ttaad320.rpac = :pac
and ttaad320.rmod = :mod
and ttaad320.repc = :rep
and ttaad320.tmpf = :file
and ttaad320.stat = ttaad.stat.premature
as set with 1 rows
selectdo
endselect

db.retry.point()
select ttaad320.*
from ttaad320 for update
where ttaad320._compnr = 0
and ttaad320.user = :logname$
and ttaad320.seqn = :max.seq
selectdo
ttaad320.stat = ttaad.stat.error
ttaad320.ccby = logname$
ttaad320.errm = errm
ttaad320._compnr = 0
db.update(tttaad320, db.retry)
commit.transaction()
endselect

mark_h
12th September 2011, 21:53
Good Solution.