#1
|
|||
|
|||
Conexion de SAP con ASP
Hola.
Estoy tratando de aprender a conectar SAP 6.0 ECC con ASP(no tengo la versión .NET). He realizado pruebas de conexión y las realiza satisfactoriamente, pero al agregar codigo para conectarse al RFC desea la página se queda perdida tratando de conectarse y no realiza ningún proceso. No se si este haciendo lago más o si me hace falta algo. El codigo en ASP es el siguiente: <%@ LANGUAGE=VBScript%> <%Option Explicit%> <HTML> <META http-Equiv="Refresh" CONTENT="180"> <TITLE>Prueba de acceso de base de datos</TITLE> <body> <% Public con Public sapObj Public theFunc Dim returnFunc, sapConnection, functionCtrl, retcd Set sapObj = CreateObject("SAP.Functions") Set sapConnection = CreateObject("SAP.Logoncontrol.1") 'Set sapConnection = sapConnection.NewConnection 'Set sapConnection = sapObj.Connection sapConnection.SystemNumber = "20" sapConnection.ApplicationServer = "192.138.24.15" sapConnection.client = "100" sapConnection.user = "rgarciac" sapConnection.Password = "contrasena" sapConnection.language = "EN" '************************************** 'Log On to the SAP System '************************************** Set functionCtrl = server.CreateObject("SAP.Functions") retcd=sapConnection.Logon(0,true) If RetCd = False Then Response.write "SAP Logon Fallo" Response.End else Response.write "SAP Logon exitoso." end if 'Hasta este punto me correo bien 'el problema ocurre cuando agrego el codigo siguiente: Set theFunc = functionCtrl.Add("ZHR_PRUEBA") theFunc.exports("ASIGNACION") = "SIEM" returnFunc = theFunc.Call() If returnFunc = True Then Response.write "Si se ha conectado" else Response.write "No cargo la tabla" end if ' Logoff from SAP sapConnection.Connection.Logoff set sapConnection = Nothing Set functionCtrl = Nothing set theFunc = Nothing %> <body> <HTML> Gracias por su ayuda. Saludos |
#2
|
|||
|
|||
Verifica que la función ZHR_PRUEBA
tenga marcado la ópción de ejecutarse en forma remota. esto está en la pestaña atributos opción "Modulo de acceso remoto". Y segundo verifica que el usuario con el cual accesa a SAP tenga permisos para ejecutar RFCs. Atte. Mauricio Hidalgo |
Herramientas | Buscar en Tema |
Desplegado | |
|
|