lehighwiz
22nd April 2002, 21:26
does it matter which version of baan i am running as to the usability of stpapi? I am running 4c2, and am having problems utilizing this method.

gfasbender
22nd April 2002, 21:40
Make sure you have the latest updates of Baan solutions 10923 and 14719.

Youp2001
23rd April 2002, 13:56
As far as I know the first supported version is Baan IV c4. I think you need at least the Baan IV c4 tools.

Youp

lehighwiz
23rd April 2002, 15:17
thanks guys,

pardon my ignorance, but is there another way for me to automate sessions from an outside language (ie VB)? STPAPI calls from vb start baan in the background for me and actually start the session that i want, but they do not put the data into the fields like they should. I get the message 'unknown message' after sending stpapi.put data to the form.

Thanks in advance for all your help.

Matt

mark_h
23rd April 2002, 15:53
You may want to check on those patches that Gordon recommended. This may be causing the problem that you are encountering with the VB Code. Search through the tools forum I posted an example somewhere that Gordon helped me to get working.

And for Youp - the stpapi commands are available on 4c3.

Good Luck!

Mark

lehighwiz
23rd April 2002, 17:31
I got those patches installed on our test server and i attempted to use the stpapi methods. I no longer get any errors, rather i get nothing at all...I see the 'option dialog' box appear at the bottom after a successful logon, then it accepts all my commands, but there is no response...then the baan session exits normally. here is my code:

Set BaanObj = CreateObject("Baan4.Application")
SessionName = "tdsst9402m000"
FieldName = "yrno.f"
FieldValue = "2001"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"

FieldName = "yrno.t"
FieldValue = "2001"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"

FieldName = "yrpt.f"
FieldValue = "4"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"

FieldName = "yrpt.t"
FieldValue = "4"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.put.field(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & FieldName & Chr(34) & "," & Chr(34) & FieldValue & Chr(34) & ")"

ErrMessage1 = Space(30)
ReportName = "tdsst940211000"
DeviceName = "HP8000DN"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.continue.process(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & ErrMessage1 & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.set.report(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & ReportName & Chr(34) & "," & Chr(34) & DeviceName & Chr(34) & "," & Chr(34) & ErrMessage1 & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.print.report(" & Chr(34) & SessionName & Chr(34) & "," & Chr(34) & ErrMessage1 & Chr(34) & ")"
BaanObj.ParseExecFunction "ottstpapihand", "stpapi.end.session(" & Chr(34) & SessionName & Chr(34) & ")"
BaanObj.Quit


End


i cannot see anything different between my code and your(mark_h) sample code in another thread. I am almost there, but not yet...Thanks for your help.

Matt

mark_h
23rd April 2002, 17:41
First thing I noticed is that the stpapi.set.report needs to go before the stpapi.continue. I would also comment out the stpapi.print.report command. In doing my function servers I usually use the set.report and continue, then end the session. Only once I have I used the set.report and the print.report command. But you may have to try different variations to get it to work.

Also I am more familiar with the Baan coding than with the VB coding. The VB code I got to work was mainly with Gordon's help. I have not moved that stuff into production just yet.

Mark

gfasbender
23rd April 2002, 17:49
ReportName = "rtdsst940211000"

Call stpapi.set.report() before using the stpapi.print.report() or stpapi.continue.process() call!

lehighwiz
23rd April 2002, 17:52
THANK YOU...it works.

Matt

Kingsto88
11th August 2006, 11:12
Hello all experts,

1) Is AFS available in Baan 4c2??
2) If AFS is not available in baan4c2, can i upgrade only the tools to baan4c4 and leave the application in baan4c2?

Thanks n regards,

mark_h
11th August 2006, 15:17
Yes - it is available in 4c2. Just jump out an look for ottstpapihand in your tools directory. You may need to make sure you have the latest patches for 4c2.

Kingsto88
8th September 2006, 10:51
hi mark,
you say api works in c2.
i tried but failed, this message appears "dynamic link library to tc.ignore.process"

what must i do to get api to work in c2??

thanks n regards,

mark_h
10th September 2006, 01:15
I recommend contacting Baan and getting the latest libraries or stpapi update.