baan2tm0
20th November 2005, 16:35
We are currently trying to automate the manual blocking/unblocking of the sales order using AFS.

When I execute my test code:

Dim oBaaN As New Object
Dim sUnblocking As String
Dim tSalesOrder As String
Dim ErrorMsg As String
Dim sFunctionCall As String = Space(100)
Dim RetVal As String

oBaaN = CreateObject("Baan4.Application")
oBaaN.Timeout = 10

tSalesOrder = "tdsls040"
sUnblocking = "tdsls4225m000"

oBaaN.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & _
sUnblocking & Chr(34) & "," & Chr(34) & ".orno" & Chr(34) & "," & _
Chr(34) & "105588" & Chr(34) & ")")

oBaaN.ParseExecFunction("ottstpapihand", "stpapi.find(" & Chr(34) & _
sUnblocking & Chr(34) & "," & Chr(34) & sFunctionCall & Chr(34) & ")")

RetVal = oBaaN.ReturnValue
sFunctionCall = oBaaN.FunctionCall


I get a BW error:

1: process 3 - Fatal error: Zero pointer: name '' in qss.search
2: process 3 - Fatal error: Can not continue tdsls4225m000 in DLL:
ottstpstandard(<28>)
3: process 3 - Fatal error: Use of NULL pointer on ''
4: process 3 - Fatal error: Can not continue tdsls4225m000 in DLL:
ottstpstandard(<28>)

Please help me sirs and madames. Thanks very much in advance and have a great day. :)

p.cole
20th November 2005, 18:38
This will not solve your problem, but will make it easier to debug and the program will run faster. Instead of calling the stpapi functions from within VB/VBA first create a new DLL within Baan (ttadv2131m000) that contains all the stpapi function calls. You can test this does the automation correctly from within Baan.

Then from within VBA call the function(s) that your new DLL exposes. Things will run faster with less chance for breakage because the interface between Baan and VB will be cleaner.

baan2tm0
21st November 2005, 06:26
i believe we donot have the rights to run that session (ttadv2131m000), i think we didn't pay for the development module. :confused: am i right?

anyway thanks for the help. :)

p.cole
21st November 2005, 14:28
Correct. If you don't have the Development Tools license you won't be able to run ttadv2131m000.

mark_h
21st November 2005, 15:46
Since we do not use the sales modules I thought I would just run the session. The first thing it did was ask a question(tdsls42251) - does your system do this? If so the first command I would expect to see for the session is stpapi.enum.answer. Not sure if it will solve your problem, but it was the first thing I noticed.