cancel
Showing results for 
Search instead for 
Did you mean: 

how to call a static method from an event handler

Former Member
0 Kudos

Hi,

I'm trying to call a static method of class I designed. But I don't know how to do it. This method will be called from an event handler of a web dynpro for Abap application.

Can somebody help me?

Thx in advance.

Hamza.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

--

Former Member
0 Kudos

Hi Hamza.

What exactly is your problem? Do you need the syntax?

classname=>static_meathd_name( )

Cheers,

Sascha

Former Member
0 Kudos

To clearly specify the problem.

I have a big part code that I use many times in my applications. So I decided to put it in a static method to reuse the code. but my method calls functions module of HR module. but just after the declaration ( at the first line of the call function) it thows an exception. So I can't call my method.

Former Member
0 Kudos

Hi,

Make sure your import and export parameters are of the same type as

the ones in your functions (may pass syntax check, but not runtime)

grtz,

Koen

Former Member
0 Kudos

but I got the same result in testing the class method from within the class builder

kind regards

Hamza

Former Member
0 Kudos

Hi,

the static method coding will contain some errors,

check the interface declaration of the functions, and check the datatypes of

the local parameters you send to it

grtz,

Koen

alejandro_bindi
Active Contributor
0 Kudos

Exactly which exception you're getting? check in ST22 transaction, you may get useful additional info to solve your problem.

Regards

Former Member
0 Kudos

You were right it was due to incompatible type of parameters.

Thx.

Hamza

Answers (2)

Answers (2)

Former Member
0 Kudos

Please post the piece of code with some overlapping code where you are getting the exception, will help to see what is causing it.

Former Member
0 Kudos

--

Former Member
0 Kudos

Hi,

cl_classname=>methodname( paramaters ).

grtz,

Koen