<?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 BEFORE_USER_COMMAND problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462659#M218204</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;i am using BEFORE_USER_COMMAND event of CL_GUI_ALV_GRID class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there are standard button that can't be captured in that event. The buttons are:&lt;/P&gt;&lt;P&gt;1. MC_FC_LOC_COPY_ROW (duplicate row button)&lt;/P&gt;&lt;P&gt;2. MC_FC_LOC_DELETE_ROW (delete row button)&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you help me how to capture this button before executed ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance. &lt;/P&gt;&lt;P&gt;Sandi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jun 2006 09:11:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-16T09:11:20Z</dc:date>
    <item>
      <title>BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462659#M218204</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;i am using BEFORE_USER_COMMAND event of CL_GUI_ALV_GRID class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there are standard button that can't be captured in that event. The buttons are:&lt;/P&gt;&lt;P&gt;1. MC_FC_LOC_COPY_ROW (duplicate row button)&lt;/P&gt;&lt;P&gt;2. MC_FC_LOC_DELETE_ROW (delete row button)&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you help me how to capture this button before executed ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance. &lt;/P&gt;&lt;P&gt;Sandi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2006 09:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462659#M218204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-16T09:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462660#M218205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandi,&lt;/P&gt;&lt;P&gt;I'm not sure but the before_user_command event doesn't work with standard buttons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I solved this problem making a custom button with the some fcode of the standard one; i.e you can create two button with fcode&lt;/P&gt;&lt;P&gt;1. MC_FC_LOC_COPY_ROW (duplicate row button)&lt;/P&gt;&lt;P&gt;2. MC_FC_LOC_DELETE_ROW (delete row button)&lt;/P&gt;&lt;P&gt;and try to catch now they with the event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;enzo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2006 09:21:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462660#M218205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-16T09:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462661#M218206</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;COPY button, and Delete row , append row these buttons they don't link to BEFORE_USER_COMMAND .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;they are used to make the changes to the Grid so using the below things you can trigger the DATA_CHANGES event, but not the BEFORE_USER_COMMAND event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD G_GRID-&amp;gt;REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = cl_gui_alv_grid=&amp;gt;mc_evt_modified.

CALL METHOD G_GRID-&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;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2006 09:38:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462661#M218206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-16T09:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462662#M218207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we put DATA_CHANGES, all the last cursor position &amp;amp; last scroll position has been changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to save the cursor &amp;amp; scroll position before process of double row is executed. Actually I want to override CLICK_ROW_COL in CL_GUI_ALV_GRID class that I have inherited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how to do that ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2006 09:47:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462662#M218207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-16T09:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462663#M218208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the event data_changes you can get the row position and column position.&lt;/P&gt;&lt;P&gt;for reference you can see the Program &amp;lt;b&amp;gt;BCALV_EDIT_04&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is for delete and append rows.&lt;/P&gt;&lt;P&gt;check this ..&lt;/P&gt;&lt;P&gt;line#161&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  method handle_data_changed.
*
    data: ls_good type lvc_s_modi,
          l_price type s_price,
          ls_new type lvc_s_moce.

    error_in_data = space.

* check if there exist double entries
    call method check_double_entries( er_data_changed ).

* remember new or deleted lines for saving
    call method update_delta_tables( er_data_changed ).

* check mt_good_cells semantically
    call method perform_semantic_checks( er_data_changed ).

    if error_in_data = 'X'.
      call method er_data_changed-&amp;gt;display_protocol.
    endif.

  endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2006 10:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462663#M218208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-16T10:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462664#M218209</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 created a nice work around...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;    handle_toolbar&lt;/P&gt;&lt;P&gt;        FOR EVENT toolbar OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_object e_interactive,&lt;/P&gt;&lt;P&gt;    handle_user_command&lt;/P&gt;&lt;P&gt;        FOR EVENT user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;            IMPORTING e_ucomm.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_handler DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD handle_toolbar.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      l_toolbar              TYPE stb_button.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Here I replace SAP standard functions with own functions&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    READ TABLE e_object-&amp;gt;mt_toolbar INTO l_toolbar&lt;/P&gt;&lt;P&gt;                                    WITH KEY function = '&amp;amp;LOCAL&amp;amp;APPEND'.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      l_toolbar-function = 'OWN_APPEND'.&lt;/P&gt;&lt;P&gt;      MODIFY e_object-&amp;gt;mt_toolbar FROM l_toolbar INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE e_object-&amp;gt;mt_toolbar INTO l_toolbar&lt;/P&gt;&lt;P&gt;                                    WITH KEY function = '&amp;amp;LOCAL&amp;amp;COPY_ROW'.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      l_toolbar-function = 'OWN_COPY_ROW'.&lt;/P&gt;&lt;P&gt;      MODIFY e_object-&amp;gt;mt_toolbar FROM l_toolbar INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_toolbar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_user_command.&lt;/P&gt;&lt;P&gt;    CASE e_ucomm.&lt;/P&gt;&lt;P&gt;      WHEN 'OWN_APPEND'.&lt;/P&gt;&lt;P&gt;        CALL METHOD ref_alv-&amp;gt;check_changed_data&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          e_valid   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        CHANGING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          c_refresh = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CREATE YOUR OWN CODE HERE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL METHOD ref_alv-&amp;gt;refresh_table_display&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            is_stable      = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_soft_refresh =  &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           finished       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           others         = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                .&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_user_command&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_handler IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Keld Gregersen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 12:24:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462664#M218209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-21T12:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: BEFORE_USER_COMMAND problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462665#M218210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How smart you are!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2008 00:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/before-user-command-problem/m-p/1462665#M218210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-09T00:16:00Z</dc:date>
    </item>
  </channel>
</rss>

