This website is not affiliated with, sponsored by, or approved by SAP AG.

Event handler registration

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Event handler registration

Postby chris55 » Tue Dec 10, 2013 11:40 am

Just been reading SAP Help and other stuff on the internal management of event handlers. Here's some code I'm working on:

Code: Select all
LOOP AT OBJLIST INTO WA_OBJLIST.

  IF WA_OBJLIST-INSTID->FIELD1 = 'X'.
    SET HANDLER WA_OBJLIST-INSTID->HANDLER1 FOR WA_OBJLIST-INSTID ACTIVATION 'X'.
  ELSE.
    SET HANDLER WA_OBJLIST-INSTID->HANDLER1 FOR WA_OBJLIST-INSTID ACTIVATION ' '.
  ENDIF.

  CALL METHOD WA_OBJ_LIST-INSTID->CHECK_STATUS.

ENDLOOP.


There seems to be a suggestion that continuously registering and de-registering a handler can be problematic. Obviously there are other coding possibilities, but any thoughts on this particular arrangement?
Thanks,
Chris.
chris55
 
Posts: 274
Joined: Wed Apr 02, 2003 8:29 am
Location: England, Middlesbrough

Re: Event handler registration

Postby mhunter » Sat Feb 08, 2014 3:20 pm

Hi Chris,

This should work fine, but it is simpler to do it this way:

SET HANDLER WA_OBJLIST-INSTID->HANDLER1 FOR WA_OBJLIST-INSTID ACTIVATION WA_OBJLIST-INSTID->FIELD1.

Best regards,
Michael
mhunter
 
Posts: 3
Joined: Mon Feb 03, 2014 8:22 am


Return to ABAP

Who is online

Users browsing this forum: No registered users and 8 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.