Quantcast
Channel: Baanboard.com
Viewing all articles
Browse latest Browse all 4216

Problemas con subsesión tdilc4113s000 desde sesión tisfc0202m000

$
0
0
He probado con todas las posibilidades que he encontrado en el foro y no hay manera de conseguir que funcione correctamente:
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.

Viewing all articles
Browse latest Browse all 4216