wilsonphilips
16th November 2006, 20:15
Hi Every Body:
Some one can help me, i need developt an automatic process that select and finalize a Batch.
I'm trying with AFS, the problem is that the subsesion tfgld1111s000 hangs up.
Thanks for the advice.
Kinds Regards
Wilson
mark_h
16th November 2006, 20:50
Code would help. Someone might see somethin I do not think I have done one for finalize a batch will look around.
wilsonphilips
16th November 2006, 21:01
Thanks Mark for your reply.
Bellow the code I'm trying to implement:
stpapi.put.field("tfgld1110m000","tfgld109.year","2006")
rc = stpapi.insert("tfgld1110m000", true, errmess)
stpapi.handle.subproc("tfgld1110m000", "tfgld1111s000", "add")
stpapi.continue.process("tfgld1110m000", errmess)
stpapi.put.field("tfgld1111s000","tfgld100.year","2006")
stpapi.put.field("tfgld1111s000","tfgld100.btno",str$(ninv.w))
rc=stpapi.find("tfgld1111s000",errmess)
if rc = 1 then
stpapi.put.field("tfgld1111s000","sel",str$(etol(tcyesno.yes)))
stpapi.continue.process("tfgld1111s000", errmess)
endif
stpapi.end.session("tfgld1111s000",errmess)
stpapi.end.session("tfgld1110m000",errmess)
Please Help me.
Thanks
mark_h
16th November 2006, 22:31
Okay - try this:
stpapi.put.field("tfgld1110m000","tfgld109.year","2006")
stpapi.put.field("tfgld1110m000","tfgld109.trun","1697")
|rc = stpapi.insert("tfgld1110m000", true, err)
rc=stpapi.find("tfgld1110m000",err)
if rc <> 1 then
message("CHeck error")
endif
stpapi.handle.subproc("tfgld1110m000", "tfgld1111s000", "add")
stpapi.continue.process("tfgld1110m000", err)
stpapi.put.field("tfgld1111s000","tfgld100.year","2006")
stpapi.put.field("tfgld1111s000","tfgld100.btno","14971")
rc=stpapi.find("tfgld1111s000",err)
if rc = 1 then
| Make sure it is no
stpapi.get.field("tfgld1111s000","sel",err)
stpapi.put.field("tfgld1111s000","sel",str$(etol(tcyesno.yes)))
stpapi.update("tfgld1111s000",1,err)
| Check to see if it is yes.
stpapi.get.field("tfgld1111s000","sel",err)
stpapi.mark("tfgld1111s000",err)
stpapi.continue.process("tfgld1111s000", err)
endif
stpapi.end.session("tfgld1111s000",err)
stpapi.end.session("tfgld1110m000",err)
Now this worked on my system. Actually I finalized the 14971 batch on the 1697 run. I got tired of creating new batches for testing. Now what this does not do is handle the report I did not know about. I got prompted for a device and a report was printed. Since I really know nothing about what happens next you will need to handle that. I also make no promises this will work with selecting mutliple batches.