Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 25th October 2016, 09:29
RafaPros RafaPros is offline
Newbie
 
Join Date: Jul 2016
Posts: 2
RafaPros is on a distinguished road
Baan: IV - DB: SQL Server - OS: Windows Server 2008
Problemas con subsesión tdilc4113s000 desde sesión tisfc0202m000

He probado con todas las posibilidades que he encontrado en el foro y no hay manera de conseguir que funcione correctamente:
Code:
 Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc001.cprj" & Chr(34) & "," & Chr(34) & codobra & Chr(34) & ")")
            Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc001.mitm" & Chr(34) & "," & Chr(34) & articulo & Chr(34) & ")")

            If Baanobj.Error <> 0 Then
                ErrDon = "Error al poner valor de Obra y Pieza"
                MsgBox("Baan IV automatización  " & Baanobj.Error & vbCrLf & "Valor de retorno de la función: " & Baanobj.Error.ToString & vbCrLf & "Donde: " & ErrDon)
                Baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & Sesion & Chr(34) & ")")
                Baanobj.Quit
                Baanobj = Nothing
                Exit Sub
            End If

            RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.find(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & valor & Chr(34) & ")")
            Dim tempstr2 = Baanobj.FunctionCall
            ' MsgBox("PARADA DE COMPROBACION, RESULTADO DE FIND =  " & tempstr2)
            If Baanobj.Error <> 0 Then
                ErrDon = "Error en la búsqueda de la OF " & OF_cod
                MsgBox("Baan IV automatización  " & Baanobj.Error & vbCrLf & "Valor de retorno de la función: " & Baanobj.Error.ToString & vbCrLf & "Donde: " & ErrDon)
                Baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & Sesion & Chr(34) & ")")
                Baanobj.Quit
                Baanobj = Nothing
                Exit Sub
            End If
 Baanobj.ParseExecFunction("ottstpapihand", "stpapi.get.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc001.pdno" & Chr(34) & "," & Chr(34) & valor & Chr(34) & ")")
If V_pdno <> CInt(tempstr2) Then
                MsgBox("Hay un problema entre el número de orden leida en el grid (" & V_pdno & ") y el número obtenido en BaaN (" & CInt(tempstr2) & ")")
                Baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & Sesion & Chr(34) & ")")
                Baanobj.Quit
                Baanobj = Nothing
                Exit Sub
                ' V_pdno = CInt(tempstr2)
            End If
Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "qdlv.frm" & Chr(34) & "," & Chr(34) & valor & Chr(34) & ")")
 Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc001.dldt" & Chr(34) & "," & Chr(34) & Temp_fecha1 & Chr(34) & ")")
 Baanobj.ParseExecFunction("ottstpapihand", "stpapi.get.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc001.qrdr" & Chr(34) & "," & Chr(34) & valor & Chr(34) & ")")
                    tempstr = Baanobj.FunctionCall
                    tempstr = Mid(tempstr, 25 + Len(Sesion) + 13, 3)
                    total = Val(tempstr)

                    Baanobj.ParseExecFunction("ottstpapihand", "stpapi.get.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "qdlv.frm" & Chr(34) & "," & Chr(34) & valor & Chr(34) & ")")
                    Dim tempstr1 = Baanobj.FunctionCall
                    tempstr1 = Mid(tempstr1, 25 + Len(Sesion) + 8, 3)
                    cantidad1 = Val(tempstr1)

                    'Controlamos que la serie de " & tempstr2 & " esté o no completa  " & cantidad1.ToString & " de " & total.ToString)
                    If cantidad1 = total Then
                        RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "comp.frm" & Chr(34) & "," & Chr(34) & "1" & Chr(34) & ")")
                    Else
                        RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "comp.frm" & Chr(34) & "," & Chr(34) & "2" & Chr(34) & ")")
                    End If
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.enum.answer(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc02023" & Chr(34) & "," & "1" & ")")
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.enum.answer(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc02024" & Chr(34) & "," & "1" & ")")
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.enum.answer(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc02029" & Chr(34) & "," & "1" & ")")
 RetVal = Baanobj.parseexecfunction("ottstpapihand", "stpapi.handle.subproc(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & subsesion & Chr(34) & "," & Chr(34) & "add" & Chr(34) & ")")
                        If Baanobj.error <> 0 Then
                            MsgBox("¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Error al lanzar la subsesión " & subsesion & ", Handle = " & Baanobj.error & " obj " & Baanobj.ToString)
                        End If
'*******************************************************************************************************************
                '* 25/10/2016 - Rafa Pros - Esta sección se utiliza para probar las posibles soluciones encontradas *
                '*                          No se corresponde con lo que es la secuencia lógica de instrucciones                   *
                '*******************************************************************************************************************
                RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & Sesion & Chr(34) & ")")
                If RetVal <> 0 Then
                    MsgBox("*** ERROR *** end.session tisfc0202m000")
                End If

                MsgBox("PARADA DE COMPROBACION, ENTRADA EN PUESTA DE DATOS 4113 - QSTC, SUBSESIÓN =  " & subsesion)
Hasta aquí, se supone que, funciona bien. No da ningún tipo de error,
En el momento que pasa el mensaje de comprobación y cuando, supuestamente, hace la siguiente línea de código se queda colgado sin mensajes de error:
retval3 = Baanobj.parseexecfunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & subsesion & Chr(34) & "," & Chr(34) & "tdilc402.qstc" & Chr(34) & "," & Chr(34) & cantidad & Chr(34) & ")")
If retval3 <> 0 Then
MsgBox("Retval3 Put qstc = " & retval3)
End If

Agradeceré que alguien me eche una mano.
Reply With Quote
Sponsored Links
  #2  
Old 25th October 2016, 18:45
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I went a head and left this post here. If you can put it in English you might get some responses. I don't have access to a translator here at work. Will try later.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 26th October 2016, 03:25
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well we do not run session tdilc4113m000 from session tisfc0202m000 - we do not build lots. But I do recall when we do receipts it does pop up. I also recall I had to do something different for that session. Not sure if I posted that on here or not - let me search.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #4  
Old 26th October 2016, 03:39
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Is all of the code there? The reason I ask is I see where you put all of the fields on tisfc0202m000, but I do not see where you actually execute a save, update or continue on the session where it would initiate tdilc4113m000. What I see is this(I edited out one error code check for simplicity):

If cantidad1 = total Then
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "comp.frm" & Chr(34) & "," & Chr(34) & "1" & Chr(34) & ")")
Else
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.put.field(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "comp.frm" & Chr(34) & "," & Chr(34) & "2" & Chr(34) & ")")
End If
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.enum.answer(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc02023" & Chr(34) & "," & "1" & ")")
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.enum.answer(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc02024" & Chr(34) & "," & "1" & ")")
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.enum.answer(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & "tisfc02029" & Chr(34) & "," & "1" & ")")
RetVal = Baanobj.parseexecfunction("ottstpapihand", "stpapi.handle.subproc(" & Chr(34) & Sesion & Chr(34) & "," & Chr(34) & subsesion & Chr(34) & "," & Chr(34) & "add" & Chr(34) & ")")
RetVal = Baanobj.ParseExecFunction("ottstpapihand", "stpapi.end.session(" & Chr(34) & Sesion & Chr(34) & ")")
If RetVal <> 0 Then
MsgBox("*** ERROR *** end.session tisfc0202m000")
End If

Basically what I see is put fields to tisfc0202m000, if all went well then do an end session. So you do an handle.subproc on the subsession tdilc4113m000, but then end 4113. That might be why you put field is hanging.

On my system if I put something like this in debug mode I can get to the option dialog box from the log in. I can do a ps as I step thru the code to make sure the session is still running and when a subsession gets kicked off.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 26th October 2016, 03:43
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Should have searched first - see this link http://www.baanboard.com/baanboard/s...ad.php?t=31085 that shows code that works. See how they have a continue in the process. Now as for what fields they put versus what you put you will need to figure out. I am not sure of the differences and all of the questions.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #6  
Old 26th October 2016, 16:15
RafaPros RafaPros is offline
Newbie
 
Join Date: Jul 2016
Posts: 2
RafaPros is on a distinguished road
Baan: IV - DB: SQL Server - OS: Windows Server 2008
complete code

thank you very much for your answers Mark

Excuse my bad English.
Attached you the complete code. The link to the solution set I had already seen and I tried but did not work either.

I have given many laps do not know if the code attached will be entirely correct.

regards
Attached Files
File Type: doc Private Sub BLanzar.doc (55.0 KB, 0 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problema con ASF tisfc0202m000 y tdilc4113s000 RafaPros Forum español 0 25th October 2016 10:35
Ejecutar Dal desde scipt de sesion chenter_chuzo Forum español 0 7th May 2014 23:22
Problemas con Mail Merge 7.2 de NAZDAQ crtapioca Forum español 1 11th May 2012 11:09
Problemas con tareas en crontab petguego Forum español 1 3rd June 2006 13:23
Problemas en sesion con DAL diego13 Forum español 1 24th August 2004 16:29


All times are GMT +2. The time now is 18:51.


©2001-2017 - Baanboard.com - Baanforums.com