<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Events in classes. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064299#M971512</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please dont send any links, i got enough links and documents with me..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jul 2008 04:22:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-09T04:22:04Z</dc:date>
    <item>
      <title>Events in classes.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064297#M971510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one explain me the functionality about events and event handlers in ABAP OO??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Arun Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 04:14:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064297#M971510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T04:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Events in classes.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064298#M971511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this link&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5403493"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/message/5402992#5402992 &lt;B&gt;[original link is broken]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=21&amp;amp;Itemid=77" target="test_blank"&gt;http://www.erpgenie.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=21&amp;amp;Itemid=77&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 04:17:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064298#M971511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T04:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Events in classes.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064299#M971512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please dont send any links, i got enough links and documents with me..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 04:22:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064299#M971512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T04:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Events in classes.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064300#M971513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Classes can have typical events, e.g. double-click, hotspot, context menu, expand folder etc. When you double-click on an ALV list the ALV grid instance "fires" the event DOUBLE_CLICK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every other instance which has been registered as event handler for this event (and the instance firing the event) is noticed by the "event handling" framework. In order to register for an event you &lt;/P&gt;&lt;P&gt;1) define a method as event handler  and&lt;/P&gt;&lt;P&gt;2) register this method using the SET HANDLER statement, e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SET HANDLER: lcl_eventhandler=&amp;gt;handle_double_click   FOR go_grid.  " register for single instance
SET HANDLER: lcl_eventhandler=&amp;gt;handle_double_click   FOR ALL INSTANCES.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a sample report you may have a look at &lt;SPAN __jive_macro_name="thread" id="393444"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Event handling is a general paradigm of any OO-language. Using events you can decouple the sender and receiver of the event. The sender instance has no clue about who are the receivers of a fired event.&lt;/P&gt;&lt;P&gt;Finally, if several event handlers are registered you cannot rely on any order of execution (which is synchronous).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 05:04:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064300#M971513</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-07-09T05:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Events in classes.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064301#M971514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;event raise on control for example grip alv or text control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this event respond  and registered in application server by event handler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 08:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064301#M971514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T08:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Events in classes.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064302#M971515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;Whilst the SENDER doesn't know about the RECEIVER  &lt;STRONG&gt;the reverse is not true&lt;/STRONG&gt;. Some people might (wrongly) infer from the comment about the sender that the receiver doesn't know either. I'm only adding the comment below  hopefully to clear this up for some people who perhaps a new to OO programming and OO ABAP in particular.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using the parameter SENDER the receiver can know what object triggered the event. This is of course useful where you have say multiple grid displays on the screen and an action needs to be performed depending on what object triggered it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

class lcl_event_handler definition.
************************************************************************
* CLASS     cl_event_receiver
* DEFINITION
************************************************************************
  public section.
    methods:
*--To add new functional buttons to the ALV toolbar
handle_toolbar for event toolbar of cl_gui_alv_grid
importing e_object e_interactive
          sender,
*--To implement user commands
handle_user_command
for event user_command of cl_gui_alv_grid
importing e_ucomm
          sender,
...
class lcl_event_handler  implementation.
*--Handle Toolbar
  method handle_toolbar.
*    PERFORM handle_toolbar USING e_object e_interactive .
  endmethod .
*--Handle Hotspot Click
  method handle_hotspot_click .
*    PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
.........

 create object  go_handler.

    set handler  go_handler-&amp;gt;handle_user_command
    for go_grid1.

set handler  go_handler-&amp;gt;handle_user_command
    for go_grid2.

......

form handle_toolbar
case g_sender
when go_grid1 

etc

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry if this info is a case of "stating the obvious" but reading the forums there's quite a bit of confustion surronding event generation and handling in OO ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2008 09:27:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/events-in-classes/m-p/4064302#M971515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-09T09:27:22Z</dc:date>
    </item>
  </channel>
</rss>

