<?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: Problem with flow control using ALV grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298707#M789505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;job_clicked is called from the event doubleclick of the ALV Class. The handler method then calls the FORM user_command with the "PICK" command. There is no double callinng of any module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jan 2008 15:29:25 GMT</pubDate>
    <dc:creator>jrgkraus</dc:creator>
    <dc:date>2008-01-31T15:29:25Z</dc:date>
    <item>
      <title>Problem with flow control using ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298705#M789503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i was writing a program to display batch job definitions in an ALV grid. The grid was placed in a docking container. After creating the ALV object, I registered two event handlers like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE OBJECT go_handler.

  CALL METHOD go_alv_list-&amp;gt;register_delayed_event
    EXPORTING
      i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_delayed_change_select.
  SET HANDLER go_handler-&amp;gt;job_clicked FOR go_alv_list.
  SET HANDLER go_handler-&amp;gt;angeklickt FOR go_alv_list.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The handler methods are defined like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    methods job_clicked for EVENT double_click of cl_gui_alv_grid
            IMPORTING E_ROW
                      E_COLUMN.


    methods angeklickt for event DELAYED_CHANGED_SEL_CALLBACK
            of cl_gui_alv_grid.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the coding of method double_click and called modules:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    perform usercomm using 'PICK' e_row-index e_column-fieldname.
-------------------------------------------------
FORM usercomm  USING r_ucomm LIKE sy-ucomm
                     iv_index iv_fieldname.

  DATA ls_list LIKE LINE OF gt_list.

  CASE r_ucomm.
(...)
     WHEN 'PICK'.
      READ TABLE gt_list INTO ls_list INDEX iv_index.
      CHECK sy-subrc = 0.
      CALL METHOD zcl_jobc_xbp=&amp;gt;job_sm37_zeigen
        EXPORTING
          jobname = ls_list-jobname.

     call method cl_gui_cfw=&amp;gt;flush.

  ENDCASE.

endform.
--------------------------------------------------
method JOB_SM37_ZEIGEN.


  submit z_jobc_show_sm37
         with jobname = jobname
         and return.


endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The called report contains a call of the function module "BP_JOB_MANAGEMENT" in order to display information about the double-clicked job in the SM37 way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What the problem is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when the user quits the SM37-like display, the event double_click is being fired immediately again. The function is called once again. This happens not every time, but in about 60% of all tries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get the program to exit the function module and return reliable to the main list?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 08:51:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298705#M789503</guid>
      <dc:creator>jrgkraus</dc:creator>
      <dc:date>2008-01-31T08:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with flow control using ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298706#M789504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We don't have all the coding but it seems that your program call two forms when double-click is performed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) the event double_click raise the method job_clicked&lt;/P&gt;&lt;P&gt;=&amp;gt; First call ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(2) user_command, 'PICK' raise the form&lt;/P&gt;&lt;P&gt;=&amp;gt; Second call ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Try to comment the OK_CODE = 'PICK' coding.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 09:32:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298706#M789504</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2008-01-31T09:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with flow control using ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298707#M789505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;job_clicked is called from the event doubleclick of the ALV Class. The handler method then calls the FORM user_command with the "PICK" command. There is no double callinng of any module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 15:29:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298707#M789505</guid>
      <dc:creator>jrgkraus</dc:creator>
      <dc:date>2008-01-31T15:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with flow control using ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298708#M789506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you in the double click method make a PERFORM (XXX) in PROGRAM (YYYY) if found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create  the calling program name an instance attribute in  your class.&lt;/P&gt;&lt;P&gt;Note don't pass this as SY-REPID but as a variable of type sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ON_DOUBLE_CLICK method call your OWN double click facility passing the required parameters.&lt;/P&gt;&lt;P&gt;In your Own double click method make a call to a form in the calling program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; My Display Grid method receives the program name as an import parameter so it's available for the double click method in my class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the application program you can easily see where the double click is coming from and react accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't shown the whole class -- I'm using my own reference to cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data definitions for using the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;z_object  type ref to zcl_alv_grid  (my grid handling class)&lt;/P&gt;&lt;P&gt;grid1 type ref to cl_gui_alv_grid (the standard SAP OO ALV grid)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

method constructor .
create object grid_container1
        exporting
*           container_name = 'CCONTAINER1'.
    container_name = cfname.
    create object  grid1
       exporting
          i_parent = grid_container1.
    set handler z_object-&amp;gt;on_user_command for grid1.
    set handler z_object-&amp;gt;on_toolbar for grid1.
    set handler z_object-&amp;gt;handle_data_changed for grid1.
    set handler z_object-&amp;gt;handle_data_changed_finished for grid1.
    set handler z_object-&amp;gt;on_dubbelklik for grid1.
    set handler z_object-&amp;gt;on_hotspot for grid1.
    call method grid1-&amp;gt;register_edit_event
        exporting
           i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter.
  endmethod.

method on_dubbelklik .
call method me-&amp;gt;dubbelklik
        exporting
           e_row  = e_row
           e_column =  e_column
           es_row_no = es_row_no.

* ...
endmethod.


method dubbelklik .
perform dubbelklik in program (caller)  if found

     using
      e_row
      e_column
      es_row_no.

* ...
endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the application program&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

create object z_object  "instantiate my GRID class
       exporting
                  z_object = z_object
                  cfname = 'CCONTAINER1'.
     assign z_object to &amp;lt;fs1&amp;gt;.

"........ code to buiild data table and field catalog
"......   code to display grid

form dubbelklik using
        e_row   type lvc_s_row
        e_column type lvc_s_col
        es_row_no type lvc_s_roid.
  read table &amp;lt;dyn_table&amp;gt; index e_row into wa_elements.

.......
endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can check in the application program what cell was actually double clicked and take the relevant action.&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>Fri, 01 Feb 2008 13:47:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298708#M789506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-01T13:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with flow control using ALV grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298709#M789507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem was the multiple registration of event handlers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 05:00:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-flow-control-using-alv-grid/m-p/3298709#M789507</guid>
      <dc:creator>jrgkraus</dc:creator>
      <dc:date>2011-04-04T05:00:49Z</dc:date>
    </item>
  </channel>
</rss>

