cancel
Showing results for 
Search instead for 
Did you mean: 

Error "not logged on in interface XAL"

onandi
Discoverer
0 Kudos

Hi community,

I am having troubles calling BAPI functions to get CCMS performance values.

I first call BAPI_XML_LOGON and then call BAPI_SYSTEM_MTE_GETPERFCURVAL, but I always get the error "not logged on in interface XAL"..

Could you please help me solve this problem?

Note that I get a SessionID as a result of BAPI_XML_LOGON, so the logon process seems to be OK.

  Dim dest = RfcDestinationManager.GetDestination("ECD")

  Dim funcLogon As IRfcFunction = dest.Repository.CreateFunction("BAPI_XMI_LOGON")

  funcLogon.SetValue("EXTCOMPANY", "DFA")

  funcLogon.SetValue("EXTPRODUCT", "DFA")

  funcLogon.SetValue("INTERFACE", "XAL")

  funcLogon.SetValue("VERSION", "1.0")

  funcLogon.Invoke(dest)

  Dim func As IRfcFunction = dest.Repository.CreateFunction("BAPI_SYSTEM_MTE_GETPERFCURVAL")

  Dim tid As IRfcStructure = func.GetStructure("TID")

  Dim ret As IRfcStructure

  tid.SetValue("MTSYSID", "XXX")

  tid.SetValue("MTMCNAME", "XXXXXX_XXX_00")

  tid.SetValue("MTNUMRANGE", "005")

  tid.SetValue("MTUID", "0000611040")

  tid.SetValue("MTCLASS", "100")

  tid.SetValue("MTINDEX", "0000000204")

  tid.SetValue("EXTINDEX", "0000000102")

  func.SetValue("EXTERNAL_USER_NAME", "Agent")

  func.Invoke(dest)

  ret = func.GetStructure("RETURN")

Thanks in advance,

Oscar.

Accepted Solutions (1)

Accepted Solutions (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Oscar,

obviously, this ABAP application requests some higher level 'logon'. I assume it keeps it's state in the backend session. Hence, you need to make sure to keep the context in the ABAP system. Hence, you need to make the destination communication stateful for the two calls. Hence, surround the invocation of those two calls by a RfcSessionManager.BeginContext(dest) and RfcSessionManager.EndContext(dest). This will associate a connection with your current NCo execution scope and thus make the connection to the target system stateful. In order to avoid connection leaks, it is a good idea to call EndContext(dest) in a finally block.

Best regards,

Markus


onandi
Discoverer
0 Kudos

Hi Markus,

The problem is solved calling BeginContext and EndContext.

Thank you very much.

Regards,

Oscar.

Answers (1)

Answers (1)

samirakis
Explorer
0 Kudos

Thank you! it solved my problem as well! unfortunatly in BC-XOM documents is not mentioned what should do with created session which is made with logon function