View Single Post
  #9  
Old 7th April 2017, 20:34
cherokee's Avatar
cherokee cherokee is offline
Senior Member
 
Join Date: Jan 2003
Location: Montreal, Canada
Posts: 290
cherokee is on a distinguished road
Baan: Baan IVc3 A&D - DB: Oracle - OS: IBM AIX
Thumbs up

Hello,

I did this and works for me. The only down side is that I couldn't make it work for "Include Printed Lines", other than that works fine.


Code:
function print.storage.list()
{
 domain tcmcs.str100   error.msg
 domain  tcmcs.long      l.pid
 domain  tcmcs.long      l.orno(10)

 stpapi.put.field( "tdpur4421m000", "selection", str$(tcyesno.yes))
 stpapi.handle.subproc( "tdpur4421m000", "tdpur4820s000", "kill")
 l.pid = find.a.process("tdpur4421m000")
 put.var(l.pid,"orno.1",l.orno(1))
 put.var(l.pid,"orno.2",l.orno(2))
 put.var(l.pid,"orno.3",l.orno(3))
 put.var(l.pid,"orno.4",l.orno(4))
 put.var(l.pid,"orno.5",l.orno(5))
 put.var(l.pid,"orno.6",l.orno(6))
 put.var(l.pid,"orno.7",l.orno(7))
 put.var(l.pid,"orno.8",l.orno(8))
 put.var(l.pid,"orno.9",l.orno(9))
 put.var(l.pid,"orno.10",l.orno(10))
 stpapi.set.report("tdpur4421m000", "rtdpur442101101", spool.device, error.msg)
 stpapi.print.report("tdpur4421m000", error.msg)
 stpapi.end.session("tdpur4421m000")
}

function domain tcmcs.long find.a.process(domain tcmcs.str14 i.baan.sess)
{
	long    hold.pno
	long    pno
	long    info(256)
	string  pname(15)
        domain  tcbool  sess.found

	sess.found = false
	pno = 0
	hold.pno = pno
	pno = pstat (pno, pname, info)
	while pno > 0 and not sess.found
		hold.pno = pno
		pno = pstat (pno, pname, info)
		if strip$(pname)=strip$(i.baan.sess) then
			sess.found = true
                        return(info(2))
		endif
	endwhile
        return(0)
}
__________________
Carlos Gonzalez CPIM,CSCP

Last edited by cherokee : 7th April 2017 at 21:28.
Reply With Quote