<?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: modifying database table in ALV Grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891147#M373065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes thanks, it is really unnecessary, but the button is still not displayed on the toolbar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jan 2007 15:45:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-30T15:45:25Z</dc:date>
    <item>
      <title>modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891144#M373062</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;I need to be able to modify the database table in ALV Grid. Here's the code. The database table, that is displayed is 'zng_so_head', it's internal table is 'res_tab'. In the program i tried to create a button 'CHANGE' on the ALV-toolbar, but when executing the program there's no such button (why?). What code, screens, screen elements, etc. should be added to this program to provide a possibility of changing data of the database table 'zng_so_head' (i mean changing existing data, adding new lines and saving changes)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CODE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp; Report  ZNG_ALV_TC_EDIT_SIMP&lt;/STRONG&gt;&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZNG_ALV_TC_EDIT_SIMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- GLOBAL DATA DECLARATIONS FOR ALV&lt;/P&gt;&lt;P&gt;DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.&lt;/P&gt;&lt;P&gt;DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;DATA gt_fieldcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;DATA gs_layout TYPE lvc_s_layo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: zng_so_head, zng_cust, zng_vendors.&lt;/P&gt;&lt;P&gt;*-- STRUCTURE OF INTERNAL TABLE&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF in_tab,&lt;/P&gt;&lt;P&gt;        so_num TYPE zng_so_head-so_num,          "type numc&lt;/P&gt;&lt;P&gt;        vend_num TYPE zng_so_head-vend_num,      "type numc&lt;/P&gt;&lt;P&gt;        cust_num TYPE zng_so_head-cust_num,      "type numc&lt;/P&gt;&lt;P&gt;        so_date TYPE zng_so_head-so_date,        "type dats&lt;/P&gt;&lt;P&gt;       END OF in_tab.&lt;/P&gt;&lt;P&gt;*-- INTERNAL TABLE HOLDING LIST DATA&lt;/P&gt;&lt;P&gt;DATA res_tab TYPE TABLE OF in_tab WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;*-- FILLING IN INTERNAL TABLE&lt;/P&gt;&lt;P&gt;SELECT h&lt;SUB&gt;so_num h&lt;/SUB&gt;vend_num h&lt;SUB&gt;cust_num h&lt;/SUB&gt;so_date&lt;/P&gt;&lt;P&gt;INTO TABLE res_tab FROM zng_so_head AS h.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  prepare_field_catalog&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;  DATA ls_fcat TYPE lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_fcat-fieldname = 'SO_NUM'.&lt;/P&gt;&lt;P&gt;  ls_fcat-inttype = 'N'.&lt;/P&gt;&lt;P&gt;  ls_fcat-ref_table = 'zng_so_head'.&lt;/P&gt;&lt;P&gt;  ls_fcat-outputlen = '12'.&lt;/P&gt;&lt;P&gt;  ls_fcat-coltext = 'SO_NUM'.&lt;/P&gt;&lt;P&gt;  ls_fcat-seltext = 'SO_NUM'.&lt;/P&gt;&lt;P&gt;  APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;  ls_fcat-fieldname = 'VEND_NUM'.&lt;/P&gt;&lt;P&gt;  ls_fcat-inttype = 'N'.&lt;/P&gt;&lt;P&gt;  ls_fcat-ref_table = 'zng_so_head'.&lt;/P&gt;&lt;P&gt;  ls_fcat-outputlen = '12'.&lt;/P&gt;&lt;P&gt;  ls_fcat-coltext = 'VEND_NUM'.&lt;/P&gt;&lt;P&gt;  ls_fcat-seltext = 'VEND_NUM'.&lt;/P&gt;&lt;P&gt;  APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;  ls_fcat-fieldname = 'CUST_NUM'.&lt;/P&gt;&lt;P&gt;  ls_fcat-inttype = 'N'.&lt;/P&gt;&lt;P&gt;  ls_fcat-ref_table = 'zng_so_head'.&lt;/P&gt;&lt;P&gt;  ls_fcat-outputlen = '12'.&lt;/P&gt;&lt;P&gt;  ls_fcat-coltext = 'CUST_NUM'.&lt;/P&gt;&lt;P&gt;  ls_fcat-seltext = 'CUST_NUM'.&lt;/P&gt;&lt;P&gt;  APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;  ls_fcat-fieldname = 'SO_DATE'.&lt;/P&gt;&lt;P&gt;  ls_fcat-inttype = 'D'.&lt;/P&gt;&lt;P&gt;  ls_fcat-ref_table = 'zng_so_head'.&lt;/P&gt;&lt;P&gt;  ls_fcat-outputlen = '12'.&lt;/P&gt;&lt;P&gt;  ls_fcat-coltext = 'SO_DATE'.&lt;/P&gt;&lt;P&gt;  ls_fcat-seltext = 'SO_DATE'.&lt;/P&gt;&lt;P&gt;  APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "prepare_field_catalog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  display_alv&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_alv.&lt;/P&gt;&lt;P&gt;  IF gr_alvgrid IS INITIAL.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT gr_ccontainer&lt;/P&gt;&lt;P&gt;    EXPORTING container_name = gc_custom_control_name.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT gr_alvgrid&lt;/P&gt;&lt;P&gt;    EXPORTING i_parent = gr_ccontainer.&lt;/P&gt;&lt;P&gt;    PERFORM prepare_field_catalog CHANGING gt_fieldcat.&lt;/P&gt;&lt;P&gt;    CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        is_layout       = gs_layout&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        it_outtab       = res_tab[]&lt;/P&gt;&lt;P&gt;        it_fieldcatalog = gt_fieldcat.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    CALL METHOD gr_alvgrid-&amp;gt;refresh_table_display.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "display_alv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_event_handler DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_handler DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    METHODS:&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&lt;/P&gt;&lt;P&gt;                  e_interactive.&lt;/P&gt;&lt;P&gt;ENDCLASS.             "lcl_event_handler DEFINITION&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_event_handler IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&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: ls_toolbar TYPE stb_button.&lt;/P&gt;&lt;P&gt;    MOVE 3 TO ls_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;    CLEAR ls_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'CHANGE' TO ls_toolbar-function.&lt;/P&gt;&lt;P&gt;    MOVE icon_change TO ls_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'change' TO ls_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    MOVE 'change' TO ls_toolbar-text.&lt;/P&gt;&lt;P&gt;    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_toolbar&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_event_handler IMPLEMENTATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA object_ref TYPE REF TO lcl_event_handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  CALL SCREEN 100.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; MODULE STATUS_0100 OUTPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE display_alv OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'SCREEN_100'.&lt;/P&gt;&lt;P&gt;  PERFORM display_alv.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT object_ref.&lt;/P&gt;&lt;P&gt;  SET HANDLER object_ref-&amp;gt;handle_toolbar FOR gr_alvgrid.&lt;/P&gt;&lt;P&gt;ENDMODULE.                    "display_alv OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; MODULE USER_COMMAND_0100 INPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  IF sy-ucomm = 'BACK' OR&lt;/P&gt;&lt;P&gt;     sy-ucomm = 'EXIT' OR&lt;/P&gt;&lt;P&gt;     sy-ucomm = 'CANCEL'.&lt;/P&gt;&lt;P&gt;    LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    CALL METHOD object_ref-&amp;gt;handle_toolbar.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                    "status_0100 INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;END OF CODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 15:29:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891144#M373062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T15:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891145#M373063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the implementation of the event handler class, one line is un-necessary:&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: ls_toolbar TYPE stb_button.&lt;/P&gt;&lt;P&gt;MOVE 3 TO ls_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;CLEAR ls_toolbar.&lt;/P&gt;&lt;P&gt;MOVE 'CHANGE' TO ls_toolbar-function.&lt;/P&gt;&lt;P&gt;MOVE icon_change TO ls_toolbar-icon.&lt;/P&gt;&lt;P&gt;MOVE 'change' TO ls_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;MOVE 'change' TO ls_toolbar-text.&lt;/P&gt;&lt;P&gt;APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;ENDMETHOD. "handle_toolbar&lt;/P&gt;&lt;P&gt;ENDCLASS. "lcl_event_handler IMPLEMENTATION&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 15:35:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891145#M373063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T15:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891146#M373064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Implement an event handler method for the event user_command of cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;( Also SET HANDLER for this event ).&lt;/P&gt;&lt;P&gt;This event handler method imports e_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implement this method as a CASE e_ucomm. ( it will contain the value of the function code of the button pressed ). [ In your case , you have given CHANGE as the function code for your toolbar button ]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the appropriate WHEN, implement the logic to update your itab or the transparent table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Arpit Sud&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 15:39:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891146#M373064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891147#M373065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes thanks, it is really unnecessary, but the button is still not displayed on the toolbar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 15:45:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891147#M373065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T15:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891148#M373066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;To modify database from the ALV grid,you need to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---You have to modify the field Catalog fields (fields that you want to make editable).Set the field EDIT as 'X'.For example if you want to make the field below editable:&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'SO_NUM'.&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'N'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'zng_so_head'.&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '12'.&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'SO_NUM'.&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'SO_NUM'.&lt;/P&gt;&lt;P&gt;ls_fcat-edit = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---Call the method below before you call the refresh_table_display method.&lt;/P&gt;&lt;P&gt;CALL METHOD ALV_GRID_INSTANCE-&amp;gt;set_ready_for_input&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_ready_for_input = 0. ( For Display ) and ('1' for Edit )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After  this put the refresh_table_display method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if the ALV data has changed,and you want to change the database as well...you need an extra button.I assume that the CHANGE button that you have added is for that purpose.In the event handler method,e_ucomm is imported.You need to write the following methods in the case e_ucomm.(WHEN 'CHANGE').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--- If you want to check if the user has entered any value on the grid, use the Method : CALL METHOD gr_alvgrid-&amp;gt;check_changed_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will reflect as a change in your existiing data table to new data added on the editable grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example,you can use it at user-command 'CHANGE':&lt;/P&gt;&lt;P&gt;WHEN 'CHANGE'.&lt;/P&gt;&lt;P&gt;call method gr_alvgrid-&amp;gt;check_changed_data&lt;/P&gt;&lt;P&gt;importing e_valid = l_valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if l_valid = 'X'.&lt;/P&gt;&lt;P&gt;MODIFY zng_so_head FROM TABLE res_tab.&lt;/P&gt;&lt;P&gt;endif.&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;Beejal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Reward if this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Beejal Rawal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 15:59:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891148#M373066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T15:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891149#M373067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For the button on the toolbar,here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_eh IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;*METHOD:      HANDLE_TOOLBAR&lt;/P&gt;&lt;P&gt;*DESCRIPTION: This method provides the necessary detail required to&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             create an extra button in the toolbar.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_toolbar.&lt;/P&gt;&lt;P&gt;    CLEAR ls_toolbar.&lt;/P&gt;&lt;P&gt;    MOVE 'CHANGE' TO ls_toolbar-function.&lt;/P&gt;&lt;P&gt;    MOVE 0 TO ls_toolbar-butn_type.&lt;/P&gt;&lt;P&gt;    MOVE CHANGETO ls_toolbar-text.&lt;/P&gt;&lt;P&gt;    MOVE 'ICON_DETAIL' TO ls_toolbar-icon.&lt;/P&gt;&lt;P&gt;    MOVE 'CHANGE' TO ls_toolbar-quickinfo.&lt;/P&gt;&lt;P&gt;    APPEND ls_toolbar TO e_object-&amp;gt;mt_toolbar.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_toolbar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,if you are using the CHANGE button to record changes in the DB,then in the local class that you have defined,you should use the following method and then write the logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;*METHOD:      HANDLE_USER_COMMAND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_user_command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CASE e_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN 'CHANGE'.&lt;/P&gt;&lt;P&gt;CHECK_CHANGED_DATA&lt;/P&gt;&lt;P&gt;REFRESH_TABLE_DISPLAY&lt;/P&gt;&lt;P&gt;Now call the methods that i have given in my previous post.This function code will be checked at the event you click the button 'CHANGE'.I think you have done this in an ELSE condition in the PAI of the screen.Not too sure if it works in the PAI.&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;Beejal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Reward if this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 16:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891149#M373067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T16:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891150#M373068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Beejal.&lt;/P&gt;&lt;P&gt;Your posts were really very helpful. But how should I define  """""l_valid"""""&lt;/P&gt;&lt;P&gt;in the following code:&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 'CHANGE'.&lt;/P&gt;&lt;P&gt;        call method gr_alvgrid-&amp;gt;check_changed_data&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;            e_valid = l_valid.&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;        if l_valid = 'X'.&lt;/P&gt;&lt;P&gt;          MODIFY zng_so_head FROM TABLE res_tab.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "handle_user_command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards, Nikolai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 16:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891150#M373068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T16:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: modifying database table in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891151#M373069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nikolai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define l_valid in your class definition as a character:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA:l_valid type c.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only acts as a flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Beejal&lt;/P&gt;&lt;P&gt;**Please reward if my posts are helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Beejal Rawal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jan 2007 17:19:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-database-table-in-alv-grid/m-p/1891151#M373069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-30T17:19:45Z</dc:date>
    </item>
  </channel>
</rss>

