on 11-16-2004 11:36 AM
JCo connections:
I found a couple of good documents for connecting from Java to ABAP. Whenever it comes to the other direction (ABAP to Java), information is somehow rare.
I had a look at the examples coming with the JCo lib, however I would like to find some more complex examples. Especially the transfer of larger result sets (obtained on the Java side) is interesting.
Does anybody know something like this? I have tried Google, but somehow always the same few articles showed up.
Any hints?
Timed out, close as cleanup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I am trying to use the JCO RFC provide service to get ABAP call from SAP web AS (solution manager). And get some problems.
I create a destination named acc, and register a destination using sm59 on Solution Manager with the same programid, sapgateway, and gateway system number. I write and deploy a stateless EJB with the JNDI name same as the function name. But when I call this function from solution manager, it always raises exception
com.sap.mw.jco.JCO$Exception: (123) JCO_ERROR_FUNCTION_NOT_FOUND: JCO.Server could not find server function 'ACI_READ_SLD_DATA'
at com.sap.mw.jco.MiddlewareJRfc$Server.dispatchRequest(MiddlewareJRfc.java:1947)
at com.sap.mw.jco.MiddlewareJRfc$Server.listen(MiddlewareJRfc.java:1507)
at com.sap.mw.jco.JCO$Server.listen(JCO.java:6820)
at com.sap.mw.jco.JCO$Server.run(JCO.java:6749)
at java.lang.Thread.run(Thread.java:534)
(The function name ACI_READ_SLD_DATA) And in JNDI registry I can see the name ACI_READ_SLD_DATA.
It seems that the JCO server can not found the function in repository. But I dont know how to add the function module the repository of this JCO Server.
And I do not know what should be set in the repository of the RFC destination in VA . Currently the repository set in the RFC Destination is some information about the WAS (Solution Manager).
I searched for more document for this issue, but did not get right information.
So I beg for you help. I will really appreciate if you can give us some help.
Thanks in advance.
Regards, Jackie Ju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
Thank you for your help.
The example5 shows how to create JCO.Server by self. But my task to use the JCO Server started by J2EE engine rfc provider. I can not get the respository used by engine.
I create a new RFC destination using Virual administration tools, set the programid, sap gateway, system number..., and then deploy a stateless EJB which has the same JNDI name with the function module name. According to the document, the method "processFunction" can be called when ABAP call the relevant function module...But it does not work
The link for that document is http://help.sap.com/sapdocu/netweaver/nw/nw04/helpdata/EN/6a/82343ecc7f892ee10000000a114084/frameset...
Regards,
Jackie
Hi Claus,
My name is Raul, I'm working at JCO Project in Spain.
I'm starting to work with JCO, would you very kind to send me these examples of JCO?
Thanks.
Raul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have one file with the name "SAP Java Connector"(Jco), where it has example. I don't remember where download. If you like this file, write your email and send you it.
Excuse me for my english.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also use the JCO RFC Provider Service of the Web Application Server for your ABAP to Java calls.
The steps involved in that are
1. Configure destination in SM59 in SAP.
2. Create RFC Destination in Visual Admin.
3. Create a stateless session bean with JNDI name as the name of calling function module in SAP.
4. Add a business method public void processFunction(JCO.Funtion fn) which is called by the JCO RFC Provider Service. The name should be 'processFunction'.
5. Set library references in application-j2ee-engine.xml to type weak for the following
a. com.sap.mw.jco.
b. com.sap.tc.Logging (if you are using the logging api )
Here is the sample code for the EJB biz method
/**
Business Method.
*/
public void processFunction(JCO.Function function) {
try {
// Get the import parameters for the function module
JCO.ParameterList importList = function.getImportParameterList();
logger.infoT("The value sent is" +
(String)importList.getValue("USER_NAME"));
// Set the export parameter value for the function module
JCO.ParameterList export = function.getExportParameterList();
export.setValue("From EJB", "RETURN");
function.setExportParameterList(export);
}
catch (java.lang.Exception e) {
e.printStackTrace();
}
}
Hi all,
I am responsible for the EJB Container development and recently we had a lot of problems with exporting the result of the public void processFunction(JCO.Function function) EJB method.
All the problems come from the fact that remote EJB interfaces are used, which implies parameters serialization, i.e. changes loss.
In order to use the JCO.Function parameter for both importing and exporting values then EJB local interfaces have to be used. Moreover, the local interfaces give much better performance and I recommend using them even though the function does not have export values.
Best regards,
Svetoslav
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.