How to make a entire column editable in an ALV grid

10-11  Source: Network gathering  Views:4 

Advertisement
Hi all,
         I am trying to make a column editable in an ALV grid. For that I wrote the following code. In the below code I have set the 'edit' field of ls_fcat to 'X'. But Iam getting Runtime error. Can anyone help in resolving this problem or suggest any method to make a column editable in an ALV grid.
form prepare_fc  changing go_fieldcat type lvc_t_fcat.
data: ls_fcat type lvc_s_fcat.
refresh: go_fieldcat.
clear: ls_fcat.
ls_fcat-reptext   = ' Safety Stock Figures'.
  ls_fcat-coltext    = 'Safety Stock Figures'.
  ls_fcat-fieldname  = 'EISBE'.
ls_fcat-ref_table  = 'IMAT'.
  ls_fcat-edit = 'X'.
modify go_fieldcat from ls_fcat.
  APPEND LS_FCAT TO GO_FIELDCAT.
endform.
Thanks & Regards,
Vishnu Priya.
ls_fcat-edit = 'X'.
is correct only.
have a look into this code
struct_grid_lset  TYPE lvc_s_layo,
i_grid_fcat    TYPE lvc_t_fcat
DATA ls_fcat TYPE lvc_s_fcat.
  CLEAR ls_fcat.
  ls_fcat-fieldname = 'MONTH'.
  ls_fcat-ref_table = 'TYPE'.
  ls_fcat-ref_field = 'C'.
<b>  ls_fcat-edit      = 'X'.</b>
  ls_fcat-coltext   = text-030."Month
  ls_fcat-seltext   = text-030.
  APPEND ls_fcat TO p_i_grid_fcat.
  CLEAR ls_fcat.
  ls_fcat-fieldname = 'YEAR'.
  ls_fcat-ref_table = 'TYPE'.
  ls_fcat-ref_field = 'C'.
  ls_fcat-coltext   = text-031."Year
  ls_fcat-seltext   = text-031.
  APPEND ls_fcat TO p_i_grid_fcat.
CALL METHOD o_grid->set_table_for_first_display
      EXPORTING
        i_bypassing_buffer    =  space
        is_variant            =  ws_f_grid_disvar
        i_save                =  ws_c_grid_save
        is_layout             =  struct_grid_lset
      CHANGING
        it_outtab             =  i_grid_outs[]
        <b>it_fieldcatalog       =  i_grid_fcat[]</b>
        it_sort               =  i_sort_fcat.      " Period
Also Check this code.Another way using field symbols.
i_fieldcat    TYPE lvc_t_fcat,
       w_layout TYPE lvc_s_layo ,
       w_variant TYPE disvariant.
FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.
*Default display
  LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.
    CASE <lfs_fieldcat>-fieldname.
      WHEN 'GL_ACCT'.
        <lfs_fieldcat>-coltext = text-050.
        <lfs_fieldcat>-no_out = ' '.
        <lfs_fieldcat>-scrtext_l = text-050.
       <b> <lfs_fieldcat>-edit    = 'X'.</b>
WHEN OTHERS.
    ENDCASE.
  ENDLOOP.
Hope this helps.
Related articles
  • How to make a entire column editable in an ALV grid 10-11

    Hi all,          I am trying to make a column editable in an ALV grid. For that I wrote the following code. In the below code I have set the 'edit' field of ls_fcat to 'X'. But Iam getting Runtime error. Can anyone help in resolving this problem or s

  • How to make the entire project in the project server 2013 reschedule؟ 10-11

    How to make the entire project in the project server 2013 reschedule ? Because item %compelet related to reschedule In this photo it is known there are no items update projectHi, In PWA, you do not have the feature to update the project plan in one c

  • HOW TO MAKE TABLE CONTROL NON EDITABLE 11-30

    hi all how to make table control non editable Thanks & Regards harshaHi, Try this code in the PBO inside the module in the LOOP...ENDLOOP.    IF SY-TCODE EQ 'ZEMPLDISPLAY'.     LOOP AT SCREEN.      if screen-name eq 'column1' or screen-name eq 'colum

  • How to make the vendor column have figure in GRIR line item with RE document type? 10-11

    Dear Experts,      Could you tell me how to make the vendor column have figure in GRIR line item whose document type is RE?      Thanks! Xinling ZhangHi , You are using FAGLL03 . FAGLL03 report vendor code is blank vendor number in new FAGLL03 tcode

  • How to make Mvt allowed indicator editable in CJ20N transection ? 10-11

    Dear Experts, How to make Mvt allowed indicator editable in CJ20N transaction ,I want to control material issue by reservations,waiting for your suggestions. ThanksWhat is the object status? if the status is Started, you might have problems becouse t

  • How to make every break column on the top of the rows in the same subgroup 11-30

    hi, guys: I was wondering if anyone could help me on this problem: I need to set up a break column on a classic report (I ma required to use classic report only), and it works, but I do not know how to make every break column on the top of the rows i

  • How to keep track of the changes done in ALV GRID Report 11-30

    Hi Experts, how to keep track of the changed record in ALV GRID Report. how to set the field to be editable even for the entire row also. Can anybody guide along with code also?... Valuable answers will be rewarded. Thanks, Satish.Hi, Access the tabl

  • How to change a color for a row in ALV grid display 10-11

    Hi,    how to change a color for a row in ALV grid display based on a condition.Any sample code plzHello Ramya, Did you check in [SCN|How to color a row of  alv grid] Thanks!Read other 2 answers

  • How to add F1 help for a field on ALV grid 11-30

    Hi All, When we execute a program, the output is displayed using ALV grid. on the ALV grid, if we press F1 on a field, it should popup the help document. How to add F1 help for a field on ALV grid. Thank you all in advance.fill field LVC_S_FCAT-ROLLN

  • How to make column editable in Normal ALV report 11-30

    Hi experts,                    I Have one push button In ALV tool bar like Fields to be change..when i click this..i need to get one pop up with all fields which is having in Filedcatalog..so i need to doule click on any field which i want to be midi

  • How to make the editable col. in alv grid scrollable? 10-11

    friends,     i have made the last col. in my alv grid editable..even though i have declared it as char of length 255, it's showing only 50 characters in the grid..but when i try to type beyond 50 characters, it's not allowing...how to make it scrolla

  • How to set a particular column editable in adf? 10-11

    Hi, I have a table which has 3 columns. While inserting new row, two column values are auto populated. One column should be editable. But in my case I am not able to edit the third column. How to make only the third column editable? I am using 11.1.2

  • How to make the text_field to editable in the adobe document? 10-11

    Hi, expert, I meet a problem when I develop a WDA. I hope to get your help. Thanks a lot. The following is my action: Action: 1. I am using "Text Field" control rather "Text" Control in the pfd form by transfer code "sfp". I

  • How to make a field un editable in one screen 10-11

    Dear Experts, I want to know how to make one field as un editable in one screen.I will explain in detail. I want to make "Reconciliation account" field as un editable in XD02 t-code. Regards, Surendra babu.Hi Surendra, Use this path in spro: Fin

  • How to make a particular field editable in a Form/Empty View 11-30

    Hi All, I want make a particular field editable in a Form View. Means i have 5 fields in the Form View and out of 5 fields i want to make one field editable or input field. Can you plz tell me how to do that? thanks & regards MadhusudanHi, You can ac

  • How to make newly added columns appear In IR report 11-30

    Hi. I am using APEX 4.0.1. I've created an IR report and then, subsequently, needed to add several column sto the underlying SQL query. When I save the changes, APEX tells me that it will add the new columns and that I need to run the IR report and e

  • How to make Double Click To Edit work instead of ClickToEdit for Af:Table 11-30

    Hi All, We use AF:Table in clickToEdit mode and most of the time the users use this table for selecting a master record then work on the detail records. To avoid the cost of rendering the selected row as editable we would like to change the behavior

  • How to make report output non editable 11-30

    Hi can any body give me sample code on how to make the report output non editable. thanks in advance kpHi What are you meaning? U don't want to allow to change the data in the selection-screen? If it's so: AT SELECTION-SCREEN OUTPUT.    LOOP AT SCREE

  • How to Hide a entire column in a Table Control? 10-11

    Can we hide an entire column in a Table control? Plz give some hints in doing the same...Here is a sample, if you wish to do it programattically.   If you used the table control wizard, then you should have a module which is listed in the flow logic

  • How to make a particular column bold in alv? 11-30

    Dear  Experts, I have searched many threads on this. I have used control break events to get the subotals and totals. The requirement is to make the text and the figure of subtotal and total bold. I am still not able to find the thread to make a part