cancel
Showing results for 
Search instead for 
Did you mean: 

Calling ABAP method from JCo

Former Member
0 Kudos

Hi All,

I need to invoke a static method of an ABAP class from JCo. Is this possible? I am new to JCo. Any help in this regard is highly appreciated.

Thanks,

Praneeth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Praneeth,

i'm not sure about calling ABAP class method from JCo directly, but there is a possibility to call function module from SAP R3. And the shortest way to do so is described in thread, answered by me.

I guess there is no problem to call an class method from an function module.

Please consider rewording points if helpfull.

regards,

mz

Former Member
0 Kudos

Hi Maxim,

Thanks for your reply. However, I am aware of the fact that we can call function modules from JCo. I am interested to know if I can call a method of an ABAP class which is not wrapped around a function module. I guess I need to create a function module for each method of the ABAP class and have the import and export parameters same as those of the method.

Thanks,

Praneeth

Former Member
0 Kudos

Praneeth,

unfortunately i'm not aware of any way to do that. And i'm almost sure it's not possible. To call a class method, you have to create and maintain an class object instance. And it is not clear, where that instance should be maintained if you call it from outside of ABAP Runtime. That's why creating an class instance in a function module is probbably the right way to do it. In this case the life-circle of the object is driven by ABAP runtime.

regards,

mz