<?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 Explanation about the code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291850#M1220649</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have limited knowledge on OOPs, can any one explain me the  what exactly happen for each line of the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
*-For Single click functionality
  CREATE OBJECT gv_event_handler.
  SET HANDLER gv_event_handler-&amp;gt;handle_single_click FOR gv_alv_grid1.


*-Call method register_edit_event - To track changes on Enter
  CALL METHOD gv_alv_grid1-&amp;gt;register_edit_event
       EXPORTING
              i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.

*-To Exclude unwanted standard functions of the ALV
*-Copy
  ls_exclude = cl_gui_alv_grid=&amp;gt;mc_fc_loc_copy.
  APPEND ls_exclude TO gt_exclude.


CALL METHOD cl_gui_cfw=&amp;gt;flush.  " To flush the memory

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Mar 2009 21:40:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-06T21:40:46Z</dc:date>
    <item>
      <title>Explanation about the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291850#M1220649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have limited knowledge on OOPs, can any one explain me the  what exactly happen for each line of the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
*-For Single click functionality
  CREATE OBJECT gv_event_handler.
  SET HANDLER gv_event_handler-&amp;gt;handle_single_click FOR gv_alv_grid1.


*-Call method register_edit_event - To track changes on Enter
  CALL METHOD gv_alv_grid1-&amp;gt;register_edit_event
       EXPORTING
              i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.

*-To Exclude unwanted standard functions of the ALV
*-Copy
  ls_exclude = cl_gui_alv_grid=&amp;gt;mc_fc_loc_copy.
  APPEND ls_exclude TO gt_exclude.


CALL METHOD cl_gui_cfw=&amp;gt;flush.  " To flush the memory

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 21:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291850#M1220649</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T21:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Explanation about the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291851#M1220650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data: gv_event_handler type ref to Cl_Gui_ALV_GRID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First you make reference to a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)CREATE OBJECT gv_event_handler.     -&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&amp;gt;This statements creates the actual Objec whose reference we had created earlier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) SET HANDLER gv_event_handler-&amp;gt;handle_single_click FOR gv_alv_grid1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a class an Action is an Event.So when ever an event occurs(Say Mouse click) if itneeds &lt;/P&gt;&lt;P&gt;to be handled you need a Handler method to Handle the Event.Say Execute some task based on CLICK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)   CALL METHOD gv_alv_grid1-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;              i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is any New event that needs to be handle if its not registered in the class.So at runtime to handle it Explicitly it needs to be Registered first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) *-To Exclude unwanted standard functions of the ALV&lt;/P&gt;&lt;P&gt;*-Copy&lt;/P&gt;&lt;P&gt;  ls_exclude = cl_gui_alv_grid=&amp;gt;mc_fc_loc_copy.&lt;/P&gt;&lt;P&gt;  APPEND ls_exclude TO gt_exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On A Grid we have many Buttons our requirement is only some of the buttons .We Exclude the Unwanted button by passing the method associated to the internal table gt_exclude.&lt;/P&gt;&lt;P&gt;Which is passed in the Method 'SET_TABLE_FOR_FIRST_DISPLAY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) CALL METHOD cl_gui_cfw=&amp;gt;flush.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is used to just Clear/Flush the Program memory at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Refer this link|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/object%252boriented%252balv%252bguide]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 23:05:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291851#M1220650</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T23:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Explanation about the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291852#M1220651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your explanation, I know purpose of code, but looking for technical process flow, how really system will provide the functionality. lets take for the below code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;3) CALL METHOD gv_alv_grid1-&amp;gt;register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what will happen if we pass 'cl_gui_alv_grid=&amp;gt;mc_evt_enter' &amp;amp; why we are using '=&amp;gt;' symbol here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Mar 2009 03:11:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291852#M1220651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-07T03:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Explanation about the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291853#M1220652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above method is called to register an Event.It Set Handler before table is set for display.&lt;/P&gt;&lt;P&gt;As soon as an event is Triggered it is its is caught by an handler classs for those events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=&amp;gt;&lt;/STRONG&gt; Its is used to call Static method of a calss.If you are calling static method of a calls you donot have to instansiate it.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;gv_alv_grid1-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;Gv_alv_grid1 is an instance of class cl_gui_alv_grid(Create Object)&lt;/P&gt;&lt;P&gt;to access methods of a class other then static you need to create instance of that class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But static method no instance of the class is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gurpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Mar 2009 09:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291853#M1220652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-07T09:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Explanation about the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291854#M1220653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while refering to static class, the method or the events of the static class are accessed via &lt;STRONG&gt;=&amp;gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;symbol ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thus is a class say cl_gui_alv_grid is a static class and has a method &lt;STRONG&gt;DISPLAY&lt;/STRONG&gt; then to access this method the code is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data:
   cl_grid type ref to cl_gui_alv_grid.

create object cl_grid.

cl_grid=&amp;gt;display.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this shall call the Method DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2009 12:48:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291854#M1220653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-11T12:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Explanation about the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291855#M1220654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's no such thing as a "static class".  Please be careful with your terminology.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2009 15:35:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/explanation-about-the-code/m-p/5291855#M1220654</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-03-11T15:35:21Z</dc:date>
    </item>
  </channel>
</rss>

