Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Global class event handler not called

LeonardoAraujo
SAP Mentor
SAP Mentor
0 Likes
910

I am having a problem where I created a function module that instatiates an application log class. This application log class has methods ON_* for public events of other classes.

The function module then processes its routines and as a result some of these events are raised. Ex: The function module creates a Purchase order and in that class I have a public even PO_CREATED that is raised upon succesfull creation of the PO. The global class APPLICATION_LOG I created has a method ON_PO_CREATED for event PO_CREATED of class ZCL_MAT_PO.

I put a break point in the APPLICATION LOG method but is os not called.

ANy idea of what Iam doing wrong or missing?

Thanks,

Leo

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
704

Hi Leo, did you set the handler method?

SET HANDLER <method_name> FOR <object>.

Regards,

Rich Heilman

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
705

Hi Leo, did you set the handler method?

SET HANDLER <method_name> FOR <object>.

Regards,

Rich Heilman

Read only

0 Likes
704

Hey RICH!!

In my function module, I put:

SET HANDLER: o_log->on_sto_created,

o_log->on_goods_issue_posted.

Not enough...

Leo

Read only

0 Likes
704

Forgot to mention that I created the events as static.

Leo

Read only

0 Likes
704

I don't know what I did... Probaby was a bad data set. The code is infact working.

I put the SET HANDLER XXXXXXX. (static event) and it works.

Thanks a lot Rich!! You are the man!

Leo