<?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: Editable ALV problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707003#M1105903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi priyaranjan,&lt;/P&gt;&lt;P&gt;please refer the link below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6303" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6303&lt;/A&gt;. &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul Sinha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Oct 2008 08:43:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-29T08:43:58Z</dc:date>
    <item>
      <title>Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707000#M1105900</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 display the recors in alv grid. When the user wants to change the data he can change the data on clicking on the change button which is there on the application toolbar. Similar for delete also. But when the user wants to insert the record, i am not able to find the solution for that. how to add newly inserted row into the alv , Please reply me asap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Renjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 08:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707000#M1105900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T08:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707001#M1105901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Renjan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using normal ALV Grid, along with Change and Delete buttons, there is a button for Inserting new rows (a PLUE sign) int he tool bar for ALV......kindly check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 08:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707001#M1105901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T08:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707002#M1105902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check program &lt;STRONG&gt;BCALV_EDIT_04&lt;/STRONG&gt; if you are coding using the CL_GUI_ALV_GRID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else you have to append an empty row at the end. and proceed accordingly. for Insert you need to capture the position accordingly you need to add the empty row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 08:43:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707002#M1105902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T08:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707003#M1105903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi priyaranjan,&lt;/P&gt;&lt;P&gt;please refer the link below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6303" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6303&lt;/A&gt;. &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul Sinha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 08:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707003#M1105903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T08:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707004#M1105904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answer. i can see the inset button there. But when i click on that button i need to save the data in ztable. How do i capture this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 08:45:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707004#M1105904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T08:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707005#M1105905</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;You can use the method, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;check_changed_data&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This method helpes to replicate the data changed in ALV back to Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2008 08:48:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707005#M1105905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-29T08:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707006#M1105906</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;My requiremnt is almost completed. Now i am able to display the record  in alv grid in noneditable mode. When i user press the delete button the record will be deleted. When user inserted the record the record eill be inserted and alv will be refreshed. But am facing problem when the user press the change button the record wis changing, but in that moment i want the key field of the ztable in disable mode. But this is not happening in my case. Initially i set EDIT = 'X' for all the field while filling catelog. then before displaying into alv i call the method * set substate of editable cells to deactivated&lt;/P&gt;&lt;P&gt;    CALL METHOD gr_alvgrid1-&amp;gt;set_ready_for_input&lt;/P&gt;&lt;P&gt;          EXPORTING i_ready_for_input = 0.&lt;/P&gt;&lt;P&gt;for noneditable. When the user press the inserte button the record will be added and all field will be in editable mode. But when the user press change button the key field should be noneditable mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me asap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2008 05:50:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707006#M1105906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-30T05:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Editable ALV problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707007#M1105907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priyeranjan,&lt;/P&gt;&lt;P&gt;Please check the Below sample code for the editable field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
aREPORT  ZDEMO_ALVGRID_EDIT                 .

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;Thanks,&lt;/P&gt;&lt;P&gt;Chidanand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2008 05:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-alv-problem/m-p/4707007#M1105907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-30T05:52:44Z</dc:date>
    </item>
  </channel>
</rss>

