cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP calls EJB/JCo

Former Member
0 Kudos

ABAP to Java method call.

Can anyone provide me with the steps to be taken.

1)I had already created an empty Function module Z_JCO in R/3.

2)I have created a TCP/IP RFC Destination called "TEST".

3)Using Visual Administrator JCo Provider Service, I have created the destination "TEST".

4)From SM59,the test connection is successful.

5)I created a Stateless Session bean and implemented the business method public void processFunction(JCO.Function);

6)In the EJB Module project, I am referencing the sapjco.jar in the Eclipse build path of the project.

Question.

Eventhough I give Z_JCO (ALL CAPITAL LETTERS) as the JNDI name of the Stateless Session bean, I am getting the exception of "NO ejb found. No method exist".

Please let me know what I am missing. ANY HELP WOULD BE GREATLY APPRECIATED.

Do I do anything with librfc32.dll and sapjcorfc.dll which comes with the JCo?

I have installed JCo separetely. I have read JCo comes with WAS as well. What JCo jar do I use?

Thanks,

Ads.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

OK, this post is rather old but does anyone still has the sample source code somewhere and can please send them to me?

thorsten.voss @ isr.de

Would be a great help! Thank you!

Former Member
0 Kudos

Hi!

The sam ecomes true to me. I need to create an EJB in SAP J2EE Engine that can be called via RFC.

The Java Code as well as the basic steps to make the bean up and running would be very helpful.

Is there a how to guide covering this topic?

Thanx in advancefor any tips!!!!!

Please email to vk @ bfact.com

Regards,

Volker

Former Member
0 Kudos

Hi everyone,

I am new in this topic. I want to call one EJB from SAP system. But i don't know anything about RFC destination and how to create RFC destination. So please can you help me for this. If you give me some sample code for the same then it will be better for me to understand. My email address is imbhavik@rediffmail.com

Thanks.

Bhavik

Former Member
0 Kudos

Hi everyone,

I want to use the Z_JCO_RFC_PROVIDER, but unfortunately the function module is missing in the R/3. Do I have to create it? Do I need only one import- and one export-parameter?

Here is my coding from se37:

FUNCTION Z_JCO_RFC_PROVIDER.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(UNAME) LIKE SY-UNAME

*" EXPORTING

*" VALUE(RETURN) LIKE SY-UNAME

*"----


ENDFUNCTION.

When I test the function using the RFC Destination JCO RFC PROVIDER SERVICE (generated in SM59), I get a short dump. Does anyone knows why?

The Connection Test ist ok.

Former Member
0 Kudos

Hi,

I have emailed you the Code Snippet.Hope that helps you.Also i have sent in the details of steps, do check if you have missed out anything.

Regards,

Uma.

Former Member
0 Kudos

Hi Uma,

Could you please email me the code snippet and the required steps at vishalsingh3@yahoo.com

Thanks,

VSingh.

raj_balakrishnan3
Participant
0 Kudos

Thanks to everybody who replied to this question. It was very helpful for me too..

Thanks

Raj Balakrishnan

MauricioMiao
Contributor
0 Kudos

Hi Uma,

I am facing the same issue in my project.

Could you please send me the EJB Code Snippet?

Regards,

Mauricio

Former Member
0 Kudos

Can someone send also the EJB code to me?

greeting

Former Member
0 Kudos

Hi,

Did you try the same with this function module - Z_JCO_RFC_PROVIDER? I have tried to use the JCo Rfc Provider Service with this RFC and it worked fine.Also do check in VA for the EJB you have deployed.

Regards,

Uma.

Former Member
0 Kudos

Hi Uma,

Can you please e-mail me the sample Session bean code you used to get the function module Z_JCO_RFC_PROVIDER to work.

adhappan.thiagarajan-eds@eds.com

Thanks for all your assistance in this regard.

Ads.

Vlado
Advisor
Advisor
0 Kudos

Hi Ads,

Could you paste the stateless bean's home and remote interfaces code and the contents of the application-j2ee-engine.xml. Please also check if the EAR file of the application contains jrfc.jar or sapjco.jar - they must NOT be present there as this would lead to classloading problems.

Best regards

Vladimir

Former Member
0 Kudos

"com.sap.engine.services.rfcengine.RFCException: Incompatible bean type - no " is the error I get when I test the function module in SE37.

Per your instructions I have added EAR Reference to the

sapjco.jar as weak.

What else am I missing. If you have any documentation, please provide. I would appreciate it.

Former Member
0 Kudos

Hi,

The jco jar which you are using is the right one.It is to be included in the libary path the way you have done.

Did you setup the EAR Reference?In application-j2ee-engine.xml, add a weak reference to sapjco.jar and reference type as Library.

Also, send in the stacktrace of your exception and the lookup code for your ejb.The exception which you have specified is not from Jco though,looks like your lookup code is having some problem.

Regards,

Uma.