Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 31st May 2006, 14:02
richard richard is offline
Senior Member
 
Join Date: Oct 2001
Location: France
Posts: 178
richard is on a distinguished road
Baan: triton 3.2/Baan IV/LN - DB: Oracle 9.2.0.6/informix 31 - OS: HP UX 11.23
Where-used device in job sessions

Hello,

We made a session to print which job session is printed on a specific device or device list.
We have some printers with more than one hundred outputs, so it's easy for the user or administrator to see all sessions in one shot.
ttaad5400 gives also the information but not summarized.
Code:
|******************************************************************************
|* tcsss5400_940  0  VRC B40O c4 prod
|* Liste des job liés à une imprimante donnée
|* guth
|* 17/05/06 [10:35]
|******************************************************************************
|* Script Type: 4
|******************************************************************************
                                                                                
|****************************** DECLARATION SECTION ***************************
declaration:

	table	tttaad501		|-- Session par job --
	table	tttaad503		|-- Var entrée par job --
	table	tttaad510		|-- Historique Job
	table	tttaad511		|-- Détails historique job
	table	tttadv380		|-- Query

	extern	domain	tcedi.prnt	dev.f, dev.t
	extern	domain	tcyesno		uniq.histo
	extern	domain	tcyesno		incl.inact
	extern	domain	tcncmp		societe
	extern	domain	tcmcs.st13	sess.query
	extern	domain	tcmcs.str60	desc.s.q
	domain	tcedi.prnt		max.z
	long	sig.eg

|****************************** PROGRAM     SECTION ***************************
before.program:
	max.z = string.set$("~", 50)
|****************************** ZOOM FROM   SECTION ***************************
|****************************** FORM	     SECTION **************************
form.1:
init.form:
	get.screen.defaults()

|****************************** CHOICE      SECTION ***************************
choice.cont.process:
on.choice:
	execute(print.data)

choice.print.data:
on.choice:
	if rprt_open() then
		liste()
		rprt_close()
	else
		message("Traitement abandonné !")
		choice.again()
	endif
|****************************** FIELD       SECTION ***************************
field.dev.f:
when.field.changes:
	dev.t = spes(dev.f) & max.z

field.uniq.histo:
check.input:
	if uniq.histo = empty then
		message("Saisie obligatoire !")
		set.input.error("")
	endif

field.incl.inact:
check.input:
	if incl.inact = empty then
		message("Saisie obligatoire !")
		set.input.error("")
	endif
	
|****************************** MAIN TABLE  SECTION ***************************
|****************************** FUNCTION    SECTION ***************************
functions:

function domain tcmcs.str100 spes(domain tcmcs.str100 entrant)
{
	return( strip$(shiftl$(entrant)) )
}

function liste()
{
	societe = get.compnr()

	select	ttaad501.cjob, ttaad501.cpac, ttaad501.cmod, ttaad501.cses,
		ttaad501.devc, ttaad501.acti, ttaad500.desc
	from	ttaad501, ttaad500
	where	ttaad501.devc inrange :dev.f and :dev.t
	and	ttaad501.cjob refers to ttaad500
	selectdo
		if incl.inact = tcyesno.no and ttaad501.acti <> ttyeno.yes then
			continue
		endif
		sess.query = ttaad501.cpac & ttaad501.cmod & ttaad501.cses
		tt.session.desc(sess.query, desc.s.q)
		remonte.dernier.histo.job(compnr)
	endselect


	if societe = 0 then
		return
	endif
	societe = 000
	
	select	ttaad501.cjob, ttaad501.cpac, ttaad501.cmod, ttaad501.cses,
		ttaad501.devc, ttaad501.acti, ttaad501.seri, ttaad500.desc
	from	ttaad501, ttaad500
	where	ttaad501.devc inrange :dev.f and :dev.t
	and	ttaad501.cjob refers to ttaad500
	and	ttaad500._compnr = 000
	and	ttaad501._compnr = 000
	selectdo
		if incl.inact = tcyesno.no and ttaad501.acti <> ttyeno.yes then
			continue
		endif
		sess.query = ttaad501.cpac & ttaad501.cmod & ttaad501.cses
		tt.session.desc(sess.query, desc.s.q)
		if ttaad501.cpac = "tt" and 
		   ttaad501.cmod = "adv" and 
		   ttaad501.cses = "3180m000" then
			select	ttaad503.rcrd
			from	ttaad503
			where	ttaad503._index1 = {:ttaad501.cjob, :ttaad501.seri}
			and	ttaad503._compnr = 000
			as set with 1 rows
			selectdo
				sig.eg = pos(ttaad503.rcrd, "=")
				sess.query = ttaad503.rcrd((sig.eg + 2); 9)
				select	ttadv380.cqur,
					ttadv380.desc
				from	ttadv380
				where	ttadv380._index1 = {:sess.query}
				and	ttadv380._compnr = 000
				selectdo
					sess.query = "Q: " & spes(ttadv380.cqur)
					desc.s.q = ttadv380.desc
				selectempty
				endselect
			endselect
		endif
		remonte.dernier.histo.job(000)
	endselect
}

function remonte.dernier.histo.job(domain tcncmp soc)
{
	if soc = 0 then
		select	ttaad511.cjob, ttaad511.edte, ttaad511.stim,
			ttaad511.sdts, ttaad511.stis,
			ttaad511.rerr
		from	ttaad511
		where	ttaad511._index1 = {:ttaad501.cjob}
		and	ttaad511.cpac = :ttaad501.cpac
		and	ttaad511.cmod = :ttaad501.cmod
		and	ttaad511.cses = :ttaad501.cses
		and	ttaad511._compnr = 000
		order by ttaad511.cjob, ttaad511.edte desc, ttaad511.stim desc
		as set with 1 rows
		selectdo
			rprt_send()
		selectempty
			if uniq.histo = tcyesno.no then
				ttaad511.edte = 0
				ttaad511.sdts = 0
				ttaad511.stim = 0
				ttaad511.stis = 0
				ttaad511.rerr = empty
				rprt_send()
			endif
		endselect
	else
		select	ttaad511.cjob, ttaad511.edte, ttaad511.stim,
			ttaad511.sdts, ttaad511.stis,
			ttaad511.rerr
		from	ttaad511
		where	ttaad511._index1 = {:ttaad501.cjob}
		and	ttaad511.cpac = :ttaad501.cpac
		and	ttaad511.cmod = :ttaad501.cmod
		and	ttaad511.cses = :ttaad501.cses
		order by ttaad511.cjob, ttaad511.edte desc, ttaad511.stim desc
		as set with 1 rows
		selectdo
			rprt_send()
		selectempty
			if uniq.histo = tcyesno.no then
				ttaad511.edte = 0
				ttaad511.sdts = 0
				ttaad511.stim = 0
				ttaad511.stis = 0
				ttaad511.rerr = empty
				rprt_send()
			endif
		endselect
	endif
}

regards
Attached Files
File Type: txt psss54000.txt (5.4 KB, 40 views)

Last edited by ~Vamsi : 31st May 2006 at 16:29.
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Job Daemon Hanging / Using crontab to run sessions from command line? rmarles Tools Administration & Installation 20 21st October 2016 12:27
Running own sessions in a batch job Andy Purdey Tools Development 8 24th May 2006 12:57
BaanIVc3 : profile device for batch job? bean_k Performance & Tuning 2 19th September 2005 19:22
Running sessions thru job pinakin Tools Administration & Installation 2 11th September 2002 09:05


All times are GMT +2. The time now is 02:32.


©2001-2017 - Baanboard.com - Baanforums.com