cancel
Showing results for 
Search instead for 
Did you mean: 

More complex JCO Server examples (ABAP to Java)

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Timed out, close as cleanup

Former Member
0 Kudos

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 don’t 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

gregorw
Active Contributor
0 Kudos

Hello Jackie,

you can setup the repository manualy like it is described in the Example5 coming with the JCo documenatation. Have you looked also at my Weblog about this toppic:

/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection

?

Regards

Gregor

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

Thanks Vicente, that would be great.

You can reach me at

<firstname>.<lastname>@web.de (let's avoid the spam

SidBhattacharya
Product and Topic Expert
Product and Topic Expert
0 Kudos

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();

}

}

Former Member
0 Kudos

Hi Vicente, I'm from Madrid and I'm starting working on JCo. It would be for us very helpful to have the documentation you talked about. Could you mail it to me? ignacio.rabadan@accenture.com

Best regards

gregorw
Active Contributor
0 Kudos

Hello together,

also my Weblog on <a href="/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection and test SAP Java Connector outbound connection</a> may be helpfull.

Regards

Gregor

Former Member
0 Kudos

I would also like the JCo example file if you still have it. (anti-spam email: donald dot dylla at hp dot com)

Thanks

SvetoManolov
Employee
Employee
0 Kudos

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

Former Member
0 Kudos

could you please send me the sample for jco.

fabiob@taipan.it

Thanks a lot

Fabio Bongiovanni