Making some rows non-editable in ALV grid

hi
I am using reuse_alv _grid _display to display the output. I want to make some of the rows non-editable based on some conditions. please help.

Hi Vijay / Manisha / Murugan
Is this question answered? The link is presently not working.
I have a same requirement. I am using reuse_alv _grid _display to display the output. After click on 'Add row'
button, the alv should add a row in edit mode and remaining all other rows in display mode. Is that possible using reuse_alv _grid _display?
Any kind of inputs regarding this will be damn damn helpful. Thanks.

Similar Messages

  • Not able to get which row is edited in alv grid

    Hi,
    I have created a Editable alv grid .
    My grid does not contain line selection cloumn so How can I get to know which row is to be changed.
    I am using get_selected_rows method but not able to get which row is changed. please help on this.
    Thanks in advance.

    Hi,
      check this ..
      it_ekko1[] = it_ekko[].
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                it_events               = i_events
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    In user command you need to write logic to know which all records have changed.
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
         loop at it_ekko into wa_ekko.
           read table it_ekko1 into wa_ekko1 index sy-tabix.
           if wa_ekko <> wa_ekko1.
    write your logic further
           endif.
         endloop.    
      endcase.
    Regards,
    Srini.

  • Make rows as non editable in ALV

    Hi Experts,
    I have a standard ALV table where records are fetched from backend table. Here I have a field Approved as check box.
    My requirement is I need to make all the rows as non editable, if the Approved checkbox is checked. How can I achieve this.
    I went through the below discussion, but still am not clear of how to achieve it.
    How to set some rows in ALV to be editable or some non editable.
    I know to set a field as non editable in WD, but don't know how to set some specific rows as non editable in alv.
    Please help me.
    With Regards,
    Ramakrishnan M

    Hi,
    Create an Attribute in the Context say READ_ONLY of type wdy_boolean and bind the read only of cell editor to that attribute using set_read_only_fieldname( ) method. Then set the value of attribute READ_ONLY to abap_true/abap_false based on check box value.
    check this wiki for reference: How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki
    Hope this helps u,
    Regards,
    Kiran

  • Disabling certain rows in editable oo alv ?

    Hello Experts ,
                             I am having internal table of type z table. i am using oo alv to display data using this internal table. I am making my alv editable using field catalog. I want to keep  entire row non editable on the basis of one fields value. so how to do this? i dont want to define seperate 'types' in my program. is it possible?

    Hi Bhushan,
    there is no other way.
    1, Define structure ZTABLE_ALV is SE11 with fields
    field           type
    .INCLUDE        ZTABLE
    STYLES          LVC_T_STYL
    2. Define ALV data table and update table in your program with workareas
    data: xt_data   type table of ztable_alv.
    data: xt_updat  type table of ztable.
    data: xs_data   type ztable_alv.
    data: xs_updat  type ztable.
    3. Data selection directly into  data table
    SELECT * FROM ZTABLE
             INTO CORRESPONDING FIELDS OF TABLE xt_data
    WHERE...
    4. Loop at ALV data table and update STYLES table
    5. Show ALV DATA table in editable Grid
    6. Update (after button or something else).
    * Build update table
    loop     at  xt_data
           into  xs_data.
      move-corresponding xs_data to xs_updat.
      append xs_updat            to xt_updat.
    endloop.
    update ztable from  table xt_updat.
    That's alle

  • How to make a row non-editable depending on a db column value

    HI,
    I've an editable report region and the requirement is to make the row non-editable according to the value in one of the column. Like if the value for that column is null the row should be editable else non-editable. Any option to do this in Oracle APEX.
    Regards,
    Prasanth

    I assume you are using a tabular form. In that case, you would have to run a loop in Javascript to read all the rows in the Form. The example is given below. You can use Firebug in Firefox to identify your field names and replace f02, f03 and f04 with your field names.
    <script language="JavaScript" type="text/javascript">
    function f_readonly_items(){
    for (i=0;i<document.wwv_flow.length;i++)
    if (document.wwv_flow.f02.value) != Null
    document.wwv_flow.f02[i].readOnly = true;
    document.wwv_flow.f03[i].readOnly = true;
    document.wwv_flow.f04[i].readOnly = true;
    </script>
    Hope this helps.

  • Action on selected row in Web dynpro ALV grid

    Hello,
    i'm pretty new on web dynpro development, and i need some help.
    I have a working grid alv and i would like to create an event when i select a row (not editable).
    I have looked around and didn't find anything interesting.
    Do you have a solution?
    Thanks a lot.
    Cedric

    Hi.,
    U have to use onLeadSelection  Event Handler.,
    Check this tutorial.,: [ALV onLead Selection another ALV|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7020c76f-c40e-2e10-a795-d88e67740ee4?quicklink=index&overridelayout=true]
    hope this helps u.,
    Thanks & Regards
    Kiran.

  • How can i choose row to edit in alv report

    hello ,
    i done alv report with one coloumne that can be edit  ,
    in this coloumne i want to choose which rows can be edit
    and which will be close according to event  .
    i saw example program "BCALV_EDIT_02" that show this case
    but stile , i don't understand what is the action that
    do it .
    this is the  part
    IF p_mode EQ 'RW'.
    *§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
       to status "editable".
        l_mode = cl_gui_alv_grid=>mc_style_enabled.
      ELSE. "p_mode eq 'RO'
    *§2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
       to status "non-editable".
        l_mode = cl_gui_alv_grid=>mc_style_disabled.
      ENDIF.
    so what is the part that will close the row for edit ?
    when i add this part in my report all the row is deleted.
    thanks.

    Dakota,
    You can change the settings at runtime.
    What you need to do is to have another column as part of the internal table, that has the data. This column, say, STYLE will refer to LVC_T_STYL. So, this becomes a nested internal table.
    Set the editable flga switched off at Fieldcat and layout level.
    Now, while filling the data in the table, or looping it separately, fill the Styles table for each row accordingly depending on the conditions. So, if you want the entire row to be enabled for editing, there will so many rows as the no. of columns in the inner internal table which is a column of that row.
    col1  col2   Col3  Style
    1     1      2     Col1 -- Style_Disabled
    ___________________Col2 -- Style_Disabled
    ___________________Col3 -- Style_Disabled
    This should solve your problem.
    Regards,
    Ravi
    note : Please reward the posts that help you.
    Message was edited by: Ravikumar Allampallam

  • Editing An ALV Grid and saving finally.

    Hİ !
    former Abap programmer I have modified CN47N as ZCN47N and made the some of the fields of the grid Editable.
    The user changes some of the fields and then press Enter occasionally. When he wants to save he clicks a Save button.
    If I use 
    call method g_d_grid->set_ready_for_input
        exporting
          i_ready_for_input = 1.
      call method g_d_grid->register_edit_event
        exporting
          i_event_id = cl_gui_alv_grid=>mc_evt_enter
        exceptions
          error      = 1
          others     = 2.
    the "data_changed " event of the ALV grid is fired every time the user press Enter BUT CAPTURES ONLY THE LAST EDITS.
    But I can update the neighboring cells of the editable cells immediately by this way.
    If I disable the mc_evt_enter event , The user can save ALL of the changes with the firing of gr_grid->checked_changed_data which fires the data_changed event.
    But by this way I can not update the neighboring cells of the editable cells with the explanation of the editable cells.
    My Question:
    1) Will data_changed_finished event suit better than data_changed_?
    2) Is there a moderate way in which I can use the enter key and capture all the changes that have been made in the grid ?
    thanks.
    erkan.

    DATA_CHANGED triggers as soon as you enter the value and move away to different cell. Parameter ER_DATA_CHANGED of the handler method of DATA_CHANGED would have MT_GOOD_CELLS and MT_BED_CELLS. Based on this you can validate the values and update the Protocol table using the method ADD_PROTOCOL_ENTRY.
    If you have to modify other cells based on the entered cells, you need to use this DATA_CHANGED method, because here you can get / change the data of the cell using the method GET_CELL_VALUE & MODIFY_CELL. in this method, the entered data is not yet visible in your ALV data table.
    DATA_CHANGED_FINISHED triggers after the data has been updated in the ALV data table. So, if you wish to change the other cells it too late. You need to modify the table and call the refresh method to actually refresh the data.
    Regards,
    Naimesh Patel

  • Selective edit in ALV grid

    Hi,
    I am using the REUSE_ALV_GRID_DISPLAY_LVC function to display a grid. In this grid I have some columns containing checkboxes that are editable. But, depending on some data in de records that I show, some of these checkboxes should be non-editable. Does anyone of you have an idea how to do this?
    regards,
    Henk

    Hi,
    add the field to the table declaration.
    DATA cellstyles TYPE lvc_t_styl .
    now tell the layout about this styling field.
    ps_layout-stylefname = ‘CELLSTYLES’.
    DATA ls_listrow LIKE LINE OF pt_list(the displayed table) .
    DATA ls_stylerow TYPE lvc_s_styl .
    DATA lt_styletab TYPE lvc_t_styl .
    here the seatmax(carrid) is not editable if the value is'XY' and planetype(connid) is editable if the value is '02'
    LOOP AT pt_list INTO ls_listrow .
    IF ls_listrow-carrid = 'XY' .
    ls_stylerow-fieldname = 'SEATSMAX' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled .
    APPEND ls_stylerow TO lt_styletab .
    ENDIF .
    IF ls_listrow-connid = '02' .
    ls_stylerow-fieldname = 'PLANETYPE' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled .
    APPEND ls_stylerow TO lt_styletab .
    ENDIF .
    INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles .
    MODIFY pt_list FROM ls_listrow .
    ENDLOOP .
    hope this helps.
    regards,
    vidya.

  • Display 2 rows per entry with ALV Grid

    Hi Experts,
    I need to display the results of a report with ALV Grid. The Problem is: I need to display the resultdata (some numbers etc..) in one row and then add a second row with the longtext.
    The ALV should look somthing like this:
    resultdata1 resultdata2 resultdata3
    longtext1
    resultdata1 resultdata2 resultdata3
    longtext1
    resultdata1 resultdata2 resultdata3
    longtext1
    Can anyone of you give me hint on how to do that?
    (The row_pos and col_pos ind the fieldcat do not do the trick )
    Thanx
    Felix

    hi ,
    You can do this
    resultdata1 resultdata2 resultdata3
    longtext1
    resultdata1 resultdata2 resultdata3
    longtext1
    resultdata1 resultdata2 resultdata3
    longtext1
    Create two internal table  .
    one for : resultdata1 resultdata2 resultdata3
    second for   longtext1
    see that both tables have matching primary key   .
    then can  match the data and  append in another third table   .
    regards
    Deepak.

  • Regarding column editing in alv grid

    hi experts,
    i m using alv grid display for my report layout what i want that after the output dispaly when the user will select my customized button "change the amount column" then after pressing this my amount column will become editable and user can put there new aount for this i have used this codes but it is not working plz help me to sort out this,
    for u here is my code.
    FORM DISPLAY_LIST .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
          is_layout                = i_layout
          it_fieldcat              = i_fieldtab
          i_grid_title             = 'Production Incentive Details'
          I_CALLBACK_PF_STATUS_SET = 'SET_PFSTATUS'
          I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
          it_events                = global_events
        TABLES
          t_outtab                 = itab_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " DISPLAY_LIST
    *&      Form  SET_PFSTATUS
          text
         -->RT_EXTAB   text
    FORM SET_PFSTATUS USING rt_extab TYPE slis_t_extab..
      SET PF-STATUS 'ZPINCENTIVE' .
    EXCLUDING rt_extab..
    ENDFORM.                    " CREATE_PFSTATUS
    *&      Form  user_command
          text
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    form user_command using r_ucomm like sy-ucomm
                                         rs_selfield type slis_selfield.
      case r_ucomm.
    *BREAK-POINT.
        when  '&CHANGED'.        "for change the amount button.
          read table i_fieldtab into s_fieldtab with key FIELDNAME = 'AMOUNT'.
          if sy-subrc = 0.
            move:sy-tabix to index,
                 'X' to s_fieldtab-edit.
            modify:i_fieldtab index index from s_fieldtab.
            clear:s_fieldtab.
          endif.

    solved by own

  • Editing in ALV grid

    Hi,
    I have designed a ALV grid and have the following requirement.
    When the user adds a new row and enters data in that row,
    and presses SAVE, the data has to get stored in the database.
    I require a method to get the selected row id, and to read the text from that row id.
    Kindly help me.

    Hi,
    check this link............
    [http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm]
    rs_selfield has the selected line..
    Cheers,
    jose.

  • Row seperator in the ALV grid display after the various highest level prod.

    Hi,
      I have a requirement like user wants a row seperator against the various high level products (Each parent material)in ALV Grid display.We made this change but quantity and pricey fields  showing the zero's in the blank line.i know that if we use NO-ZERO
    in the ALV field catalog , we can remove the zero's from blank line. But other  zerou2019s will remove from rest of the line items. User want's the zero's in other line items, but not in the blank line.
    We can convert packed fileds into character format, but this will effect to the summing the quantity, price coumns.
    If any body have idea on above mentioned.
    Regards,
    SK.

    Hi Suresh,
    There is no short cut for this requirement. You have to do following steps.
    1. Change the data type of column to char.
    2. Programatically  find the totals.
    Reagards,
    Anversha

  • Make the output of the BI report rtf file some fields non editable

    Hello All,
    I want to make some fields in the output of the BI report as editable and some non editable. Any output format is fine (PDF, RTF or HTML) Please let me know if anyone knows how to do it.
    Thanks in advance..
    Anu

    You can add RTF to active allowed output type list (provided that your reporting system supports it) by going to CustomerReportExtensions.xml file and adding the following node right after ParameterTypes node:
    <ActiveReportOutputTypes configChildKey="key">
    <ActiveReportOutputType key="RTF" value="RTF" extension=".rtf"/>
    </ActiveReportOutputTypes>

  • How to change the selected row color in an alv grid display ?

    Hello ,
    I WANT TO CHANGE THE COLOR OF THE SELECTED RECORDS  IN AN ALV GRID DISPLAY ?
    ITS URGENT..
    WILL BE REWARDED...

    hai   Ssnagh Samala 
    EXicut This report >
    Hope It Will  Meet U r Requirement.
    If Found Helpfull Reward.
    REPORT zcuitest_alv_07.
    Use of colours in ALV grid (cell, line and column) *
    Table
    TABLES : mara.
    Type
    TYPES : BEGIN OF ty_mara,
    matnr LIKE mara-matnr,
    matkl LIKE mara-matkl,
    counter(4) TYPE n,
    free_text(15) TYPE c,
    color_line(4) TYPE c, " Line color
    color_cell TYPE lvc_t_scol, " Cell color
    END OF ty_mara.
    Structures
    DATA : wa_mara TYPE ty_mara,
    wa_fieldcat TYPE lvc_s_fcat,
    is_layout TYPE lvc_s_layo,
    wa_color TYPE lvc_s_scol.
    Internal table
    DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
    it_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
    it_color TYPE TABLE OF lvc_s_scol.
    Variables
    DATA : okcode LIKE sy-ucomm,
    w_alv_grid TYPE REF TO cl_gui_alv_grid,
    w_docking_container TYPE REF TO cl_gui_docking_container.
    PARAMETERS : p_column AS CHECKBOX,
    p_line AS CHECKBOX,
    p_cell AS CHECKBOX.
    START-OF-SELECTION.
    PERFORM get_data.
    END-OF-SELECTION.
    PERFORM fill_catalog.
    PERFORM fill_layout.
    CALL SCREEN 2000.
    *& Module status_2000 OUTPUT
    text
    MODULE status_2000 OUTPUT.
    SET PF-STATUS '2000'.
    ENDMODULE. " status_2000 OUTPUT
    *& Module user_command_2000 INPUT
    text
    MODULE user_command_2000 INPUT.
    DATA : w_okcode LIKE sy-ucomm.
    MOVE okcode TO w_okcode.
    CLEAR okcode.
    CASE w_okcode.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " user_command_2000 INPUT
    *& Module alv_grid OUTPUT
    text
    MODULE alv_grid OUTPUT.
    IF w_docking_container IS INITIAL.
    PERFORM create_objects.
    PERFORM display_alv_grid.
    ENDIF.
    ENDMODULE. " alv_grid OUTPUT
    *& Form create_objects
    text
    --> p1 text
    <-- p2 text
    FORM create_objects.
    Ratio must be included in http://5..95
    CREATE OBJECT w_docking_container
    EXPORTING
    ratio = 95
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    others = 6.
    CREATE OBJECT w_alv_grid
    EXPORTING
    i_parent = w_docking_container.
    ENDFORM. " create_objects
    *& Form display_alv_grid
    text
    --> p1 text
    <-- p2 text
    FORM display_alv_grid.
    CALL METHOD w_alv_grid->set_table_for_first_display
    EXPORTING
    is_layout = is_layout
    CHANGING
    it_outtab = it_mara
    it_fieldcatalog = it_fieldcat
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4.
    ENDFORM. " display_alv_grid
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    FORM get_data.
    SELECT * FROM mara UP TO 5 ROWS.
    CLEAR : wa_mara-color_line, wa_mara-color_cell.
    MOVE-CORRESPONDING mara TO wa_mara.
    ADD 1 TO wa_mara-counter.
    MOVE 'Blabla' TO wa_mara-free_text.
    IF wa_mara-counter = '0002'
    AND p_line = 'X'.
    Color line
    MOVE 'C410' TO wa_mara-color_line.
    ELSEIF wa_mara-counter = '0004'
    AND p_cell = 'X'.
    Color cell
    MOVE 'FREE_TEXT' TO wa_color-fname.
    MOVE '5' TO wa_color-color-col.
    MOVE '1' TO wa_color-color-int.
    MOVE '1' TO wa_color-color-inv.
    APPEND wa_color TO it_color.
    wa_mara-color_cell] = it_color[.
    ENDIF.
    APPEND wa_mara TO it_mara.
    ENDSELECT.
    ENDFORM. " get_data
    *& Form fill_catalog
    text
    --> p1 text
    <-- p2 text
    FORM fill_catalog.
    Colour code : *
    Colour is a 4-char field where : *
    - 1st char = C (color property) *
    - 2nd char = color code (from 0 to 7) *
    0 = background color *
    1 = blue *
    2 = gray *
    3 = yellow *
    4 = blue/gray *
    5 = green *
    6 = red *
    7 = orange *
    - 3rd char = intensified (0=off, 1=on) *
    - 4th char = inverse display (0=off, 1=on) *
    Colour overwriting priority : *
    1. Line *
    2. Cell *
    3. Column *
    DATA : w_position TYPE i VALUE '1'.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'MATNR' TO wa_fieldcat-fieldname.
    MOVE 'MARA' TO wa_fieldcat-ref_table.
    MOVE 'MATNR' TO wa_fieldcat-ref_field.
    APPEND wa_fieldcat TO it_fieldcat.
    ADD 1 TO w_position.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'MATKL' TO wa_fieldcat-fieldname.
    MOVE 'MARA' TO wa_fieldcat-ref_table.
    MOVE 'MATKL' TO wa_fieldcat-ref_field.
    Color column
    IF p_column = 'X'.
    MOVE 'C610' TO wa_fieldcat-emphasize.
    ENDIF.
    APPEND wa_fieldcat TO it_fieldcat.
    ADD 1 TO w_position.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'COUNTER' TO wa_fieldcat-fieldname.
    MOVE 'N' TO wa_fieldcat-inttype.
    MOVE '4' TO wa_fieldcat-intlen.
    MOVE 'Counter' TO wa_fieldcat-coltext.
    APPEND wa_fieldcat TO it_fieldcat.
    ADD 1 TO w_position.
    CLEAR wa_fieldcat.
    MOVE w_position TO wa_fieldcat-col_pos.
    MOVE 'FREE_TEXT' TO wa_fieldcat-fieldname.
    MOVE 'C' TO wa_fieldcat-inttype.
    MOVE '20' TO wa_fieldcat-intlen.
    MOVE 'Text' TO wa_fieldcat-coltext.
    APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM. " fill_catalog
    *& Form fill_layout
    text
    --> p1 text
    <-- p2 text
    FORM fill_layout.
    Field that identify color line in internal table
    MOVE 'COLOR_LINE' TO is_layout-info_fname.
    Field that identify cell color in inetrnal table
    MOVE 'COLOR_CELL' TO is_layout-ctab_fname.
    ENDFORM. " fill_layout
    Regards.
    Eshwar.

Maybe you are looking for

  • External HD (WD Passport) disappeared from Mac - shows up on PC

    I have a 2tb Passport Ultra we've been using on our Macbook. All of a sudden it stopped appearing yesterday. The light still comes on and the drive runs. I bought a new one to double check and the new one (with new cable) also does not appear (on dis

  • Clean up queue in SUN Messaging Server 6.3

    I have a couple of SUN Messaging servers with each about a 1'000'000 e-mail messages in their queues. The reason is one of our customers being infected with some trojan, and a firewall misconfiguration which allowed direct access to the SUN messaging

  • Exporting with Keywords

    I scanned a bunch of documents and put them into iPhoto and meticulously tagged them. Now I've decided I'd rather have them as PDFs so I can run OCR on them) I do not want to lose my keywords. I can export the images from iPhoto and preserve the keyw

  • Best Wireless Auth. methods ACS 3.2(3) and AD

    I am new with ACS and wirless authentication. Have just deployed my ACS 3.2 for Windows, and am trying to select the best methods of authentication for my invironment. I have determined my risk level to be low to medium. I would consider MAC based Au

  • Retreiving spreadsheets from numbers

    I recently updated IOS 6, and then updated numbers and pages, now all my docs in my icloud and my spreadsheets are ALL gone. What the heck happened????? I opened numbers on my ipad, I saw my files briefly, then they all disappeared as if deleted in f