<?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: Call method within a Method in Class Implementation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273673#M150964</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;we don't see in the code where you have define the cl_gui_alv_grid and where you have create the grid object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgd&lt;/P&gt;&lt;P&gt;Frédéric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Mar 2006 14:19:42 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2006-03-10T14:19:42Z</dc:date>
    <item>
      <title>Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273672#M150963</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 a method in Class definition which gets triggered on the EVENT AFTER_USER_COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish to call method (get_filtered_entries) within the above method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that possible. ? I am new to OO programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your refernec I have my code snippets attached.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
[code]CLASS lcl_event_receiver DEFINITION .
PUBLIC:
METHODS:
        handle_user_command
            FOR EVENT after_user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm e_not_processed.
ENDCLASS.                    "lcl_event_receiver &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_user_command.

*    IF e_not_processed IS INITIAL.

    &amp;lt;b&amp;gt;  CALL METHOD cl_gui_alv_grid-&amp;gt;get_filtered_entries                   
      IMPORTING
          et_filtered_entries = lt_entries.&amp;lt;/b&amp;gt;

*    ENDIF.
  ENDMETHOD.                           "handle_user_command&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: g_event_receiver TYPE REF TO lcl_event_receiver,
      g_grid_2000      TYPE REF TO lcl_method_call,
      g_grid_3000      TYPE REF TO lcl_method_call.

INITIALIZATION.
perform check_screen.

START-OF-SELECTION.
perform get_data&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program dumps when it tries to call the method get_filtered_entries above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you suggest where I am going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;RK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:17:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273672#M150963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-10T14:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273673#M150964</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;we don't see in the code where you have define the cl_gui_alv_grid and where you have create the grid object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgd&lt;/P&gt;&lt;P&gt;Frédéric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:19:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273673#M150964</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2006-03-10T14:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273674#M150965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajiv,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should call method g_grid_2000-&amp;gt;get_filtered_entries. (or g_grid_3000) depending on which grid you are actually using. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:20:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273674#M150965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-10T14:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273675#M150966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are not calling the method correctly.  You need to call the method of the instance(object) of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

      CALL METHOD &amp;lt;b&amp;gt;grid_0002-&amp;gt;get_filtered_entries&amp;lt;/b&amp;gt;                   
      IMPORTING
          et_filtered_entries = lt_entries.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use grid_0003, which ever grid you are working with at the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:25:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273675#M150966</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-03-10T14:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273676#M150967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this event reciever support both grids, or just one of them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273676#M150967</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-03-10T14:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273677#M150968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is lcl_method_call?   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:27:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273677#M150968</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-03-10T14:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273678#M150969</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;Infact I tried to cal the method from my GRID but its showing an syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching the code bit again with cl_gui_alv_grid implementation for your reference. Maybe you can tell me whats the mistake I am doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;gt; [code]
 [code]CLASS lcl_event_receiver DEFINITION .
 PUBLIC:
 METHODS:
         handle_user_command
 FOR EVENT after_user_command OF
 r_command OF cl_gui_alv_grid
                 IMPORTING e_ucomm e_not_processed.
 ENDCLASS.                    "lcl_event_receiver
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_event_receiver IMPLEMENTATION.
   METHOD handle_user_command.
 
 *    IF e_not_processed IS INITIAL.
 
 &amp;lt;b&amp;gt;  CALL METHOD
 g_custom_2000-&amp;gt;get_filtered_entries
                   
       IMPORTING
           et_filtered_entries = lt_entries.&amp;lt;/b&amp;gt;
 
 *    ENDIF.
 ENDMETHOD.
 D.
 
                          "handle_user_command&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; ENDCLASS.                    "lcl_event_receiver&lt;/P&gt;&lt;P&gt; IMPLEMENTATION&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: g_event_receiver TYPE REF TO
 lcl_event_receiver,
       g_grid_2000      TYPE REF TO lcl_method_call,
       g_grid_3000      TYPE REF TO lcl_method_call.
CLASS lcl_method_call DEFINITION INHERITING FROM cl_gui_alv_grid.
  PUBLIC SECTION.
    METHODS: get_row EXPORTING row TYPE lvc_s_row.


ENDCLASS.                    "lcl_method_call DEFINITION

*---------------------------------------------------------------------*
*       CLASS lcl_method_cal IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_method_call IMPLEMENTATION.
  METHOD get_row.
    CALL METHOD me-&amp;gt;get_current_cell_row_id
      IMPORTING
        row_id = row.
  ENDMETHOD.                    "get_row

ENDCLASS.                    "lcl_method_call IMPLEMENTATION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; INITIALIZATION.&lt;/P&gt;&lt;P&gt;&amp;gt; perform check_screen.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&amp;gt; perform get_data[/code][/code]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:32:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273678#M150969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-10T14:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273679#M150970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is g_custom_2000?   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD
 &amp;lt;b&amp;gt;g_custom_2000-&amp;gt;&amp;lt;/b&amp;gt;get_filtered_entries
                   
       IMPORTING
           et_filtered_entries = lt_entries.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the g_grid_2000 object is your alv_grid object since it inherits from cl_Gui_alv_grid.  You should be calling the method against that object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD
 &amp;lt;b&amp;gt;g_grid_2000-&amp;gt;&amp;lt;/b&amp;gt;get_filtered_entries
                   
       IMPORTING
           et_filtered_entries = lt_entries.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:36:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273679#M150970</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-03-10T14:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Call method within a Method in Class Implementation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273680#M150971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jhon and Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was calling the method from my ALV container and not the GRid as rightly pointed out by you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is sorted .&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciated &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;RK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2006 14:43:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-method-within-a-method-in-class-implementation/m-p/1273680#M150971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-10T14:43:13Z</dc:date>
    </item>
  </channel>
</rss>

