noorulhaq
17th December 2005, 16:27
Hi Everybody,
I want to Automate the Release Outbound Data Session using the AFS.
I am working on the Session Release Outbound Data (tdilc4202m000).
In this session I can fillup the Fields using the command Put.Fields and trigger the "Continue" Process by using the continue.process command.
But when we do that(manually), we will get the next screen as printer setup(Select Device 000) screen. when we fill up the device type and when we click on the continue, the data getting updated in the respective tables.
How can I automate the printer setup screen via AFS?
(If possible pl. provide some sample source).
Apart from this, if any body come across the same kind of situation in some other session, pl explain to me, how you over came accross that.
Your kindful help is highly Appriciated.
Thanks in Advance.
Hitesh Shah
17th December 2005, 17:57
How can I automate the printer setup screen via AFS?
stpapi.set.report and then stpapi.cont.process should do the task .
mark_h
18th December 2005, 01:48
Of course Hitesh is correct. Just a reminder that you might want to do search on the forum first - maybe using the session name. You might even find code like this thread (http://www.baanboard.com/baanboard/showthread.php?t=13108&highlight=tdilc4202m000). There is lots of code in this forum that you may find useful.
noorulhaq
18th December 2005, 17:19
Thanks For All. But still i am not getting it.
I 've posted the source which I am using, can anyone please give some suggession.
' The Following code is written in vb.net
Dim mSession as String = "tdilc4202m000"
Dim Retval As String=""
Dim F1 As String = "runnumber.f"
Dim F1Val As String = 10
'Put fields
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & mSession & Chr(34) & "," & Chr(34) & F1 & Chr(34) & "," & Chr(34) & F1Val & Chr(34) & ")")
Dim F2 As String = "runnumber.t"
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & mSession & Chr(34) & "," & Chr(34) & F2 & Chr(34) & "," & Chr(34) & F1Val & Chr(34) & ")")
Dim F3 As String = "koor.f"
Dim F3Val As String = "3" ' PRP Warehouse Order
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & mSession & Chr(34) & "," & Chr(34) & F3 & Chr(34) & "," & Chr(34) & F3Val & Chr(34) & ")")
Dim F4 As String = "koor.t"
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & mSession & Chr(34) & "," & Chr(34) & F4 & Chr(34) & "," & Chr(34) & F3Val & Chr(34) & ")")
Dim F5 As String = "orno.f"
Dim F5Val As String = "10"
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & mSession & Chr(34) & "," & Chr(34) & F5 & Chr(34) & "," & Chr(34) & F5Val & Chr(34) & ")")
Dim F6 As String = "orno.t"
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & mSession & Chr(34) & "," & Chr(34) & F6 & Chr(34) & "," & Chr(34) & F5Val & Chr(34) & ")")
sFunctionCall = BaaNObject.FunctionCall
Dim ReportName as String = "tdilc420201000"
Dim DeviceCode as string = "d"
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.set.report( " & Chr(34) & mSession & Chr(34) & "," & Chr(34) & ReportName & Chr(34) & "," & Chr(34) & DeviceCode & Chr(34) & "," & Chr(34) & sFunctionCall & Chr(34) & ")")
sFunctionCall = BaaNObject.FunctionCall
BaaNObject.ParseExecFunction("ottstpapihand", "stpapi.continue.process( " & Chr(34) & mSession & Chr(34) & "," & Chr(34) & sFunctionCall & Chr(34) & ")")
sFunctionCall = BaaNObject.FunctionCall
mark_h
20th December 2005, 17:59
Your set.report should look like this:
stpapi.set.report("tdilc4202m000","rtdilc420201000",spool.device,err.msg)
Notice the r before the report.
noorulhaq
21st December 2005, 07:46
Thanks for all.
I corrected the statment and it is like the following.
stpapi.set.report("tdilc4202m000","rtdilc420201000",spool.device,err.msg)
But still i am not getting.
Any Suggession Pl.
Thanks a lot.
mark_h
22nd December 2005, 19:20
Check the F4 value - I do not see where that is set. Double check the fields in your program versus what is in the program when you run it manually. Also remember that user defaults could get in the way.