on 10-21-2014 9:31 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.