<?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: Edit alv grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653104#M611663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2007 08:19:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-09T08:19:54Z</dc:date>
    <item>
      <title>Edit alv grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653100#M611659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have request for ALV grid that can be edited . Basically , the end user want to have  list on the screen with possibility to change  and save the changes of  content  , and some fields want to present as check boxes.&lt;/P&gt;&lt;P&gt;I did  list  , with field catalog  but I have problem to make this list editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 06:05:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653100#M611659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T06:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Edit alv grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653101#M611660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the field catalog if u maintain edit = 'x'. then the field come editable mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for all helpful ans,&lt;/P&gt;&lt;P&gt;kiran.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 06:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653101#M611660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T06:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Edit alv grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653102#M611661</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;If you look at BC_ALV* in se38 you will find the example Programs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at the below link&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm&lt;/A&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 06:21:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653102#M611661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T06:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Edit alv grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653103#M611662</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;&lt;/P&gt;&lt;P&gt;If you want it to be done with REUSE_ALV_GRID_DISPLAY&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1. Add one more field to final internal table of length 1 as first field&lt;/P&gt;&lt;P&gt;    CHK(1).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;2. in fieldcatalog&lt;/P&gt;&lt;P&gt;     wa_fieldcat-fieldname = 'CHK'.&lt;/P&gt;&lt;P&gt;     wa_fieldcat-checkbox = 'X'.&lt;/P&gt;&lt;P&gt;     wa_fielcat-edit = 'X'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;3. in layout &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    wa_layout-box_fname = 'CHK'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;4.     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;P&gt;    I_CALLBACK_PROGRAM                = W_REPID&lt;/P&gt;&lt;P&gt;    I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'&lt;/P&gt;&lt;P&gt;   &amp;lt;b&amp;gt; I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;5.  FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM&lt;/P&gt;&lt;P&gt;                        P_SELFLD TYPE SLIS_SELFIELD.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;     Data ref1 type ref to cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;E_GRID = ref1.&lt;/P&gt;&lt;P&gt;call method ref1-&amp;gt;check_changed_data &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   CASE P_UCOMM.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;    ENDFORM.&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;&lt;/P&gt;&lt;P&gt;If you want it to be done with REUSE_ALV_GRID_DISPLAY_LVC , chk my blog&lt;/P&gt;&lt;P&gt;/people/community.user/blog/2007/01/10/displaychange-mode-of-editable-fields-in-alv-using-function-modules-but-not-custom-containers &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Check this sample report&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES:     ekko.

TYPE-POOLS: slis.                                 "ALV Declarations
*Data Declaration
*----------------
TYPES: BEGIN OF t_ekko,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  statu TYPE ekpo-statu,
  aedat TYPE ekpo-aedat,
  matnr TYPE ekpo-matnr,
  menge TYPE ekpo-menge,
  meins TYPE ekpo-meins,
  netpr TYPE ekpo-netpr,
  peinh TYPE ekpo-peinh,
  field_style  TYPE lvc_t_styl, "FOR DISABLE
 END OF t_ekko.

DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko TYPE t_ekko.

*ALV data declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER LINE,
      wa_fieldcat TYPE lvc_s_fcat,

      gd_tab_group TYPE slis_t_sp_group_alv,
      gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
      gd_repid     LIKE sy-repid.


************************************************************************
*Start-of-selection.
START-OF-SELECTION.

  PERFORM data_retrieval.
  PERFORM set_specific_field_attributes.
  PERFORM build_fieldcatalog.
  PERFORM build_layout.
  PERFORM display_alv_report.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_FIELDCATALOG
*&amp;amp;---------------------------------------------------------------------*
*       Build Fieldcatalog for ALV Report
*----------------------------------------------------------------------*
FORM build_fieldcatalog.

  wa_fieldcat-fieldname   = 'EBELN'.
  wa_fieldcat-scrtext_m   = 'Purchase Order'.
  wa_fieldcat-col_pos     = 0.
  wa_fieldcat-outputlen   = 10.
  wa_fieldcat-emphasize   = 'X'.
  wa_fieldcat-key         = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'EBELP'.
  wa_fieldcat-scrtext_m   = 'PO Item'.
  wa_fieldcat-col_pos     = 1.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'STATU'.
  wa_fieldcat-scrtext_m   = 'Status'.
  wa_fieldcat-col_pos     = 2.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'AEDAT'.
  wa_fieldcat-scrtext_m   = 'Item change date'.
  wa_fieldcat-col_pos     = 3.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'MATNR'.
  wa_fieldcat-scrtext_m   = 'Material Number'.
  wa_fieldcat-col_pos     = 4.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'MENGE'.
  wa_fieldcat-scrtext_m   = 'PO quantity'.
  wa_fieldcat-col_pos     = 5.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'MEINS'.
  wa_fieldcat-scrtext_m   = 'Order Unit'.
  wa_fieldcat-col_pos     = 6.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'NETPR'.
  wa_fieldcat-scrtext_m   = 'Net Price'.
  wa_fieldcat-edit        = 'X'. "sets whole column to be editable
  wa_fieldcat-col_pos     = 7.
  wa_fieldcat-outputlen   = 15.
  wa_fieldcat-datatype     = 'CURR'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.

  wa_fieldcat-fieldname   = 'PEINH'.
  wa_fieldcat-scrtext_m   = 'Price Unit'.
  wa_fieldcat-col_pos     = 8.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
ENDFORM.                    " BUILD_FIELDCATALOG


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_LAYOUT
*&amp;amp;---------------------------------------------------------------------*
*       Build layout for ALV grid report
*----------------------------------------------------------------------*
FORM build_layout.
* Set layout field for field attributes(i.e. input/output)
  gd_layout-stylefname = 'FIELD_STYLE'.
  gd_layout-zebra             = 'X'.
ENDFORM.                    " BUILD_LAYOUT


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  DISPLAY_ALV_REPORT
*&amp;amp;---------------------------------------------------------------------*
*       Display report using ALV grid
*----------------------------------------------------------------------*
FORM display_alv_report.
  gd_repid = sy-repid.

*  call function 'REUSE_ALV_GRID_DISPLAY'
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
            i_callback_program      = gd_repid
*            i_callback_user_command = 'USER_COMMAND'
            is_layout_lvc               = gd_layout
            it_fieldcat_lvc             = it_fieldcat
            i_save                  = 'X'
       TABLES
            t_outtab                = it_ekko
       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.                    " DISPLAY_ALV_REPORT


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  DATA_RETRIEVAL
*&amp;amp;---------------------------------------------------------------------*
*       Retrieve data form EKPO table and populate itab it_ekko
*----------------------------------------------------------------------*
FORM data_retrieval.
  SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
   UP TO 10 ROWS
    FROM ekpo
    INTO  CORRESPONDING FIELDS OF TABLE it_ekko.

ENDFORM.                    " DATA_RETRIEVAL


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  set_specific_field_attributes
*&amp;amp;---------------------------------------------------------------------*
*       populate FIELD_STYLE table with specific field attributes
*----------------------------------------------------------------------*
form set_specific_field_attributes .
  DATA ls_stylerow TYPE lvc_s_styl .
  DATA lt_styletab TYPE lvc_t_styl .

* Populate style variable (FIELD_STYLE) with style properties
*
* The NETPR field/column has been set to editable in the fieldcatalog...
* The following code sets it to be disabled(display only) if 'NETPR'
* is gt than 10.
  LOOP AT it_ekko INTO wa_ekko.
    IF wa_ekko-netpr GT 10.
      ls_stylerow-fieldname = 'NETPR' .
      ls_stylerow-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled. 
                                             "set field to disabled
      APPEND ls_stylerow  TO wa_ekko-field_style.
      MODIFY it_ekko FROM wa_ekko.
    ENDIF.
  ENDLOOP.

endform.                    " set_specific_field_attributes
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&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;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 07:13:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653103#M611662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T07:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Edit alv grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653104#M611663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 08:19:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edit-alv-grid/m-p/2653104#M611663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T08:19:54Z</dc:date>
    </item>
  </channel>
</rss>

