<?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: ALV  issue - capturing user changes in editable fields using custom button? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156522#M1194561</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;Thanks for the answers, I found the logic from documentation  and its working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank Tarun , I put almost same logic, its working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am having one more issue hear. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using  ALV tool bar Filter option if we do any filter ALV records and after user command  I am still seeing the complete records, not the filtered records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not refreshing  my internal table with new filtered records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get filtered records (what ever is showing in current ALV grid after user does his changes like modifying records or filtering with his own conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions. Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2009 18:12:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-06T18:12:06Z</dc:date>
    <item>
      <title>ALV  issue - capturing user changes in editable fields using custom button?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156517#M1194556</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 custom button in ALV tool bar.   And also in my ALV grid I have couple of fields Editable option. User can change values for these 2 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is - &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;After changing values for these editable fields(more than 1 record)  , user will click on custom button and then I have to update all the user changed values in to my internal table(lt_tab)  and then I have to process logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is when user click on Custom button in ALV tool bar it is not having the changed values in lt_tab table. &lt;/P&gt;&lt;P&gt;Only when user clicks  some thing on ALV grid records or fields then it is getting all the changed values in to lt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one tell me how I can get changed values when user clicks on custom button?&lt;/P&gt;&lt;P&gt;1. Can we place custom button in ALV Grid? instead of ALV tool bar?  &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;How I can capture user changes when they click on custom button?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;      T_OUTTAB                          = lt_tab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this logic- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE r_ucomm.&lt;/P&gt;&lt;P&gt;    WHEN '&amp;amp;IC1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- It_tab  having all changed field values &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WHEN 'custom button'.&lt;/P&gt;&lt;P&gt;      lt_tab  - not having any changed values - showing all initial lt_tab values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I highly appreciate your answers on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 18:11:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156517#M1194556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T18:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: ALV  issue - capturing user changes in editable fields using custom button?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156518#M1194557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to refresh the ALV list first using the refresh_table_display method, for instance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 19:17:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156518#M1194557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T19:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: ALV  issue - capturing user changes in editable fields using custom button?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156519#M1194558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check that you are not overriding any standard funcionallity. BTW are you using class or functinos? Also did you debug? That is the most easiest to understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 19:18:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156519#M1194558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T19:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: ALV  issue - capturing user changes in editable fields using custom button?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156520#M1194559</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;Please search in SCN for this. I am sure you will get lot of threads which already discuss about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 19:20:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156520#M1194559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T19:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: ALV  issue - capturing user changes in editable fields using custom button?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156521#M1194560</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;Use this code, its working:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ALV_DISPLAY
*&amp;amp;---------------------------------------------------------------------*
*       SUB-ROUTINE ALV_DISPLAY IS USED TO SET THE PARAMETERS
*       FOR THE FUNCTION MODULE REUSE_ALV_GRID_DISPLAY
*       AND PASS THE INTERNAL TABLE EXISTING THE RECORDS TO BE
*       DISPLAYED IN THE GRID FORMAT
*----------------------------------------------------------------------*
FORM alv_display .

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*     I_INTERFACE_CHECK                 = ' '
*     I_BYPASSING_BUFFER                = ' '
*     I_BUFFER_ACTIVE                   = ' '
     i_callback_program                = v_rep_id       " report id
     i_callback_pf_status_set          = 'PF'           " for PF-STATUS
     i_callback_user_command           = 'USER_COMMAND' " for User-Command
*     I_CALLBACK_TOP_OF_PAGE            = ' '
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*     I_CALLBACK_HTML_END_OF_LIST       = ' '
*     I_STRUCTURE_NAME                  =
*     I_BACKGROUND_ID                   = ' '
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
     is_layout                         = wa_layout      " for layout
     it_fieldcat                       = it_field       " field catalog
*     IT_EXCLUDING                      =
*     IT_SPECIAL_GROUPS                 =
     it_sort                           = it_sort        " sort info
*     IT_FILTER                         =
*     IS_SEL_HIDE                       =
*     I_DEFAULT                         = 'X'
     i_save                            = 'A'
     is_variant                        = wa_variant     " variant name
*     IT_EVENTS                         =
*     IT_EVENT_EXIT                     =
*     IS_PRINT                          =
*     IS_REPREP_ID                      =
*     I_SCREEN_START_COLUMN             = 0
*     I_SCREEN_START_LINE               = 0
*     I_SCREEN_END_COLUMN               = 0
*     I_SCREEN_END_LINE                 = 0
*     I_HTML_HEIGHT_TOP                 = 0
*     I_HTML_HEIGHT_END                 = 0
*     IT_ALV_GRAPHICS                   =
*     IT_HYPERLINK                      =
*     IT_ADD_FIELDCAT                   =
*     IT_EXCEPT_QINFO                   =
*     IR_SALV_FULLSCREEN_ADAPTER        =
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER           =
*     ES_EXIT_CAUSED_BY_USER            =
    TABLES
      t_outtab                          = it_final      " internal table
   EXCEPTIONS
     program_error                     = 1
     OTHERS                            = 2.

  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

ENDFORM.                    " ALV_DISPLAY
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  USER_COMMAND
*&amp;amp;---------------------------------------------------------------------*
*       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
*       AND EXECUTE THE APPROPIATE CODE
*----------------------------------------------------------------------*
*      --&amp;gt;LV_OKCODE   used to capture the function code
*                     of the user-defined push-buttons
*      --&amp;gt;L_SELFIELD   text
*----------------------------------------------------------------------*
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.

* assign the function code to variable v_okcode
  lv_okcode = sy-ucomm.

* handle the code execution based on the function code encountered
  CASE lv_okcode.

* when the function code is EXECUTE then process the selected records
    WHEN 'EXECUTE'. "user-defined button

* to reflect the data changed into internal table
      DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new

      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.

      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid-&amp;gt;check_changed_data.
      ENDIF.

* refresh the ALV Grid output from internal table
      l_selfield-refresh = c_check.

  ENDCASE.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will reflect all the changes in the internal table. Now you can include your logic as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 03:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156521#M1194560</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-02-06T03:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: ALV  issue - capturing user changes in editable fields using custom button?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156522#M1194561</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;Thanks for the answers, I found the logic from documentation  and its working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank Tarun , I put almost same logic, its working now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am having one more issue hear. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using  ALV tool bar Filter option if we do any filter ALV records and after user command  I am still seeing the complete records, not the filtered records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not refreshing  my internal table with new filtered records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get filtered records (what ever is showing in current ALV grid after user does his changes like modifying records or filtering with his own conditions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions. Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 18:12:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-capturing-user-changes-in-editable-fields-using-custom-button/m-p/5156522#M1194561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T18:12:06Z</dc:date>
    </item>
  </channel>
</rss>

