2016 Sep 06 9:50 AM
Hello,
I'am not sure where to put this Question. ABAP Connectivity showed up when i searched for RFC thats why I put it here.
I'am trying to implement an SAP connector for my companys external output management system using callbacks. To do so I intend to use JCo.
As a first step I tried to call SXMI_XOM_RMGS_QUERY but that gives me: "com.sap.conn.jco.AbapException: (126) NOT_LOGGED_ON: NOT_LOGGED_ON".
So I googled about this and found out that I have to logon to the XOM SMAPI using BAPI_XMI_LOGON. So I tried the following before calling the XOM function:
func = dest.getRepository().getFunction("BAPI_XMI_LOGON");
func.getImportParameterList().setValue("EXTCOMPANY", "MyCompany");
func.getImportParameterList().setValue("EXTPRODUCT", "MyProduct");
func.getImportParameterList().setValue("INTERFACE", "XOM");
func.getImportParameterList().setValue("VERSION", "0.2"); // tried 0.1 as well
func.execute(dest);
But I still get the NOT LOGGED ON message. Next thing I tried was giving the user I use for the destination all profiles associated with XMI but that didn't do the trick either.
Does someone have an idea?
Greetings.
2016 Sep 06 11:31 AM
Hi Michael,
I also don't know those BAPIs, but if you need to call some logon BAPI before calling other BAPIs I guess that the needed logon information is stored in the RFC context at ABAP side.
This would mean that you need a stateful call context to keep this RFC context information in your RFC call sequence. For achieving this, please have a look into the JCo JavaDoc at class JCoContext.
Try to nest your RFC call sequence between an appropriate JCoContext.begin(destination) and a JCoContext.end(destination) statement.
I hope this helps.
Best regards,
Stefan
Hello,
I'am not sure where to put this Question. ABAP Connectivity showed up when i searched for RFC thats why I put it here.
I'am trying to implement an SAP connector for my companys external output management system using callbacks. To do so I intend to use JCo.
As a first step I tried to call SXMI_XOM_RMGS_QUERY but that gives me: "com.sap.conn.jco.AbapException: (126) NOT_LOGGED_ON: NOT_LOGGED_ON".
So I googled about this and found out that I have to logon to the XOM SMAPI using BAPI_XMI_LOGON. So I tried the following before calling the XOM function:
func = dest.getRepository().getFunction("BAPI_XMI_LOGON");
func.getImportParameterList().setValue("EXTCOMPANY", "MyCompany");
func.getImportParameterList().setValue("EXTPRODUCT", "MyProduct");
func.getImportParameterList().setValue("INTERFACE", "XOM");
func.getImportParameterList().setValue("VERSION", "0.2"); // tried 0.1 as well
func.execute(dest);
But I still get the NOT LOGGED ON message. Next thing I tried was giving the user I use for the destination all profiles associated with XMI but that didn't do the trick either.
Does someone have an idea?
Greetings.
2016 Sep 06 10:07 AM
Hi Michael,
well, this is not exactly a problem "with RFC", but rather with the function modules/BAPIs you are using. The RFC ("Connectivity") appears to work fine, you just don't know, how these XMI BAPIs work, what inputs they expect in order to produce the desired result, etc. So it's more a problem on application level, not on technical (RFC communication) level.
They application component for function group SXMI is BC-CCM-API-CSI-XMI, so I would ask the experts there.
Best Regards, Ulrich
2016 Sep 06 10:30 AM
Hi Ulrich,
thanks for your reply.
I never wanted to say that the system isn't working as intended but that I have an specific goal and doesn't know how to get the information I need to achieve it. The documentations I consulted are not really specific on how to exactly logon to such an SMAPI (Specification for a Generic Interface to the SAP R/3 Spool System for External Output Management Systems(BC-XOM), SAP Java Connector (Standalone-Version) Release 3.0, and others) and on the web there are a lot of dead links to moved or deleted articles.
Since I'am pretty new to all the sap infrastructure I don't know how to contact those BC-CCM-API-CSI-XMI experts you are talking about. Googling them only shows up some technical sofware documentation on sites which doesn't seem to be official SAP sites.
I'am sorry if my question wasn't well formulated but I'am looking for information on how to properly logon to a SMAPI. I don't want to report any ill behavior of the sap system.
Greetings.
2016 Sep 06 11:31 AM
Hi Michael,
I also don't know those BAPIs, but if you need to call some logon BAPI before calling other BAPIs I guess that the needed logon information is stored in the RFC context at ABAP side.
This would mean that you need a stateful call context to keep this RFC context information in your RFC call sequence. For achieving this, please have a look into the JCo JavaDoc at class JCoContext.
Try to nest your RFC call sequence between an appropriate JCoContext.begin(destination) and a JCoContext.end(destination) statement.
I hope this helps.
Best regards,
Stefan
2016 Sep 06 1:24 PM
Hi Stefan,
thank you for your reply, this did indeed the trick.
The problem is that the logon is successfull but since I used stateless RFCs, the session is not used for the second call, which requires to be logged on to XOM. I thought the logon was the problem so I didn't post the "whole" code. For other people that might have the same or a similar problem I want to document the problem and solution here. This was the not working code:
JCoDestination dest = JCoDestinationManager.getDestination("dest");
JCoFunction func;
// logon call
func = dest.getRepository().getFunction("BAPI_XMI_LOGON");
func.getImportParameterList().setValue("EXTCOMPANY", "MyCompany");
func.getImportParameterList().setValue("EXTPRODUCT", "MyProduct");
func.getImportParameterList().setValue("INTERFACE", "XOM");
func.getImportParameterList().setValue("VERSION", "0.2");
func.execute(dest);
// XOM call which failed because logon information is not stored
func = dest.getRepository().getFunction("SXMI_XOM_RMGS_QUERY");
func.getImportParameterList().setValue("ROMS", "MyRoms");
func.execute(dest);
Using the following code instead gets rid of the error:
JCoDestination dest = JCoDestinationManager.getDestination("dest");
JCoFunction func;
JCoContext.begin(dest);
// logon call
func = dest.getRepository().getFunction("BAPI_XMI_LOGON");
func.getImportParameterList().setValue("EXTCOMPANY", "MyCompany");
func.getImportParameterList().setValue("EXTPRODUCT", "MyProduct");
func.getImportParameterList().setValue("INTERFACE", "XOM");
func.getImportParameterList().setValue("VERSION", "0.2");
func.execute(dest);
// XOM call is successfull now since we are logged on to the XOM SMAPI
func = dest.getRepository().getFunction("SXMI_XOM_RMGS_QUERY");
func.getImportParameterList().setValue("ROMS", "MyRoms");
func.execute(dest);
JCoContext.end(dest);
2016 Sep 06 2:53 PM
Hi Michael,
thanks for sharing your knowledge,
In addition - like also written in the JCo JavaDoc - I strongly recommend to put the JCoContext.end(dest) into a try-finally-block. Otherwise it won't be called in case of an exception being thrown and thus resulting in an unreleased stateful RFC connection.
Please always try to avoid such potential connection leaks.
Best regards,
Stefan
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |