U.R.Naga Kumar
13th January 2009, 16:31
Greetings!
My requirement is , I just want to run Print Purchase Orders (tdpur4401m000) session through AFS.Currently I am working on Baan IVc4.
1. If we select first field as "Yes" in the Print PO form, automatically one session will appear. i.e tdpur4820s000 - Enter Specific Orders.
2. There we can enter max 10 orders.
My requirement is i want to enter the orders in that zoom session (tdpur4820s000 ) through AFS.
In that sub session form field is orno.select with element as 1. Like that 10 fields are there with elements as 2,3,4,5,...10.
How to enter the specific orders in that particular sub session ?
Thanks in advance. Please respond me ASAP. I am at the end of my project. This thing only pending. Please help me....
Regards!
Naga Kumar
mark_h
13th January 2009, 17:52
Well what I did was right my own session to ask for the 10 orders. Then I ran each order through tdpur4401m000 one at a time. That way I did not have to worry about that subsession.
U.R.Naga Kumar
15th January 2009, 07:49
Dear Mark,
Thank you very much for replying. Whatever you said will work but the problem is, if the user enter 10 different orders that time he/she will get 10 different reports. He/she will not get all the orders in a single report.
My client is asking that he wanted all the orders in a single report.
Can you give me any other clue.
Thanks&Regards!
Naga Kumar
mark_h
15th January 2009, 18:01
Even using tdpur4401m000 doesn't each PO come out on a new sheet? So in this case the only way they would know that got 10 individual reports is if something else prints during the process.
Can you clone tdpur4401m000 to a new session? You can then check for API mode and import your variable. Then just make sure it processes correctly. That is the best solution I can come up with.
You could always run all the reports into a file(using device like ASCIT) then print the file as one report. Not sure what it will look like and including logos is probably out of the picture.
Hey have you tried in the afs using something like orno.select(i) in the stpapi.put.field - where i is 1 thru 10? Never really tried that.
U.R.Naga Kumar
3rd February 2009, 14:22
I am sending the code which I have written for running Print Purchase Orders using AFS:
stpapi.put.field("tdpur4401m000","selection",str$(selection1))
stpapi.insert("tdpur4401m000",true,err.str)
if selection1 = tcyesno.yes then
stpapi.handle.subproc("tdpur4401m000","tdpur4820s000","send")
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.1),1)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.2),2)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.3),3)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.4),4)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.5),5)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.6),6)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.7),7)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.8),8)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.9),9)
stpapi.put.field("tdpur4820s000","orno.select",str$(orno.10),10)
stpapi.continue.process("tdpur4820s000",err.str)
stpapi.end.session("tdpur4820s000",err.str)
endif
if selection1 = tcyesno.no then
stpapi.put.field("tdpur4401m000","suno.f",str$(i.suno.f))
stpapi.put.field("tdpur4401m000","suno.t",str$(i.suno.t))
stpapi.put.field("tdpur4401m000","orno.f",str$(i.orno.f))
stpapi.put.field("tdpur4401m000","orno.t",str$(i.orno.t))
stpapi.put.field("tdpur4401m000","comp.f",str$(i.comp.f))
stpapi.put.field("tdpur4401m000","comp.t",str$(i.comp.t))
endif
stpapi.put.field("tdpur4401m000","prnt.pric",str$(i.prnt.pric))
stpapi.put.field("tdpur4401m000","printed",str$(i.printed))
stpapi.put.field("tdpur4401m000","quan.to.print",str$(i.quan.to.print))
stpapi.put.field("tdpur4401m000","prnt.options",str$(i.prnt.options))
stpapi.put.field("tdpur4401m000","prnt.deladro",str$(i.prnt.deladro))
stpapi.set.report("tdpur4401m000",report.code,"D",err.str)
mess.code = stpapi.get.mess.code("tdpur4401m000",err.str)
if isspace(mess.code) then
stpapi.continue.process("tdpur4401m000",err.str)
mess.code = stpapi.get.mess.code("tdpur4401m000",err.str)
if not isspace(mess.code) then
mess(mess.code,1)
endif
else
mess(mess.code,1)
endif
stpapi.end.session("tdpur4401m000",err.str)
In this code orno.1,orno.2...orno.10 are order numbers which are imported from tdpur4820s000.
Please check the code and guide me.
Thanks&Regards!
Naga Kumar
mark_h
3rd February 2009, 15:44
No reason to have duplicate threads. Additional replies can go http://www.baanboard.com/baanboard/showthread.php?t=54946. I am closing this thread.