just_fro
19th January 2004, 17:37
Please help with this.....

I run a query in order to find some specific orders.
The report simply prints these orders along with some extra data.
Human action is needed to check the orders and execute an extra session......

Now the question/challenge:
I don't have any sources, but can I start the session from the query-report script?
(since I don't have any sources, I cannot program any zoom-variables......all i can do is 'pass' 'background-process' in order to execute the session without having to press 'continue')

Something tells me this should be real simple, but I don't see how

nick_rogers
19th January 2004, 17:58
we have several reports that execute sessions. We actually need to start the session(s) before the report prints so we have the zoom.to in the before.program section of the report script. Going by youre need try the after.program section.

just_fro
19th January 2004, 18:40
thnx Nick,

I don't think it really matters if I start the session in the before- or after report section.
I can use the act.and.sleep() in the before program and the reactivate() in a 'correct' detail-line

My main issue is how to tell session what to do.
Problem is, that I'm starting session that needs a 'continue.process'

Somehow I need to pass 'background', but that doesn't seem to be a valid variable (neither is 'job'...... :mad: )

fosterjr
19th January 2004, 20:32
Do a search on AFS.

just_fro
20th January 2004, 18:16
Hi fosterjr

thanx for the tip!
I've searched for AFS and learned a lot.......

Also found your topic on picking lists :D

Exactly what I wanted to do.......run a query and after various checks for a 'good' order I want to print it's picking slip.

(maybe it's time I change my signature to 11 and include " those who understand AFS" :p )

just_fro
22nd January 2004, 16:51
So I've added the following code in my reportscript in order to generate outbound for a single item/order.

Anyone have a clue why this generates ALL outbound and not just the specified orno/item combination ?

spool.device="D99"
stpapi.put.field("tdilc4201m000", "runnumber", "RUN")
stpapi.put.field("tdilc4201m000","koor.f", str$(etol(tdilc.koob.act.sls)))
stpapi.put.field("tdilc4201m000","koor.t", str$(etol(tdilc.koob.act.sls)))
stpapi.put.field("tdilc4201m000", "cuno.f", cuno)
stpapi.put.field("tdilc4201m000", "cuno.t", cuno)
stpapi.put.field("tdilc4201m000", "orno.f", orno)
stpapi.put.field("tdilc4201m000", "orno.t", orno)
stpapi.put.field("tdilc4201m000", "opno.f", str$(0))
stpapi.put.field("tdilc4201m000", "opno.t", str$(999))
stpapi.put.field("tdilc4201m000", "prdt.t", str$(date.num()))
stpapi.put.field("tdilc4201m000", "ddat.f", "")
stpapi.put.field("tdilc4201m000", "ddat.t", str$(date.num()))
stpapi.put.field("tdilc4201m000", "cprj.f", cprj)
stpapi.put.field("tdilc4201m000", "cprj.t", cprj)
stpapi.put.field("tdilc4201m000", "item.f", item)
stpapi.put.field("tdilc4201m000", "item.t", item)
stpapi.put.field("tdilc4201m000", "cntr.f", cntr)
stpapi.put.field("tdilc4201m000", "cntr.t", cntr)
stpapi.put.field("tdilc4201m000", "cwar.f", cwar)
stpapi.put.field("tdilc4201m000", "cwar.t", cwar)
stpapi.put.field("tdilc4201m000", "crte.f", "")
stpapi.put.field("tdilc4201m000", "crte.t", "ZZZZZ")
stpapi.put.field("tdilc4201m000", "print.recom", str$(etol(tcyesno.yes)))
stpapi.put.field("tdilc4201m000", "prnt.shortage", str$(etol(tcyesno.no)))

stpapi.set.report ("tdilc4201m000","rtdilc420101000", spool.device,msg)

stpapi.continue.process("tdilc4201m000", error)


first api call launces ilc4201, so there definitely is communication........

mark_h
22nd January 2004, 17:07
I would expect orno to need to be passed as a string. So stpapi.put.field("tdilc4201m000", "orno.f", orno) would be stpapi.put.field("tdilc4201m000", "orno.f", str$(orno)). Is orno already in string format? If it is not then I am confused on why it even let you compile it.

Mark

just_fro
22nd January 2004, 17:21
Hi Mark,

When I started this morning, the format of the variables was indeed wrong.......so it didn't compile
now everything is in string-format.....it compiles, but doesn't work
:(

mark_h
22nd January 2004, 18:58
Just some standard questions I would ask - actually this should be in the AFS forum. Make sure you have the latest stpapi patch and the latest objects for the code. Once that is done you can do all the puts for the fields, then do a get to validate that the input is making it to the session. Also if you have the code for tdilc4201 you can put it in debug mode and see what is happening when it is called.

Mark

kondratus
11th March 2004, 15:17
Hi just_fro!

in report script:
|********************
declaration:
long id
string var1(100)

before.program:

id = activate("elcwr0509s000")
wait(id, WTHANG)
var1 = receive.bucket$(id)

|********************************************

in script session :
|*************************
declaration:
string var1(100)

after.program:
send.bucket(parent,var1)

|*************************

just_fro
11th March 2004, 21:18
Hello Kondratus,

Thanx for the reply.
I already fixed this by installing a newer standard program (and thus a newer apihandler)

So the issue is solved by using the stpapi-commands
(and it works perfectly!)

G.

manojsharma
12th March 2004, 06:09
Could you please post the script / report script & screen shot of Form

Thanx