Skip to Content
-2

question on editing specific rows in alv output

Hi Experts,

I am using check boxes in ALV output , when ever user selects specific rows using the check boxes than only those specific rows need to be editable .

Please suggest how to do that I know we can use row_pos and edit in field catlog prep . just want to know when we need to pass these value to field catalog.

Thanks,

rg

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    May 11, 2017 at 07:11 AM

    Hi,

    The field catalog cannot help with this as such.

    Make the entire grid editable. In your layout structure, provide an internal table name which is part of the data record which is defined as type LVC_T_STYL.

    When the grid is refreshed, or prior to first display, populate this table for each record with a list of fields that you do not wish to be editable, and specify the style as cl_Gui_Alv_Grid=>Mc_Style_Disabled.

    When the checkbox is clicked, it should react and redisplay the grid during which time you modify the style table for the particular row checked and either remove the field names or add fieldnames (if the box is checked).

    Rich

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2017 at 04:25 AM

    Please refer the sample program 'BCALV_EDIT_02', which would slove your problem.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 08, 2017 at 11:15 AM

    create PF status for select & deselect and then write you code at 'Handle user command' routine.

    call function 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = sy-repid

    i_callback_pf_status_set = 'SET_PF_STATUS'

    i_callback_user_command = 'HANDLE_USER_COMMAND'

    is_layout = i_layout

    it_fieldcat = i_fieldcatalog

    i_save = 'X'

    it_events = i_event

    TABLES t_outtab = i_final

    EXCEPTIONS program_error = 1 others = 2.

    at you can write your code as follows.

    form handle_user_command using r_ucomm like sy-ucomm p_selfield type slis_selfield.

    case sy-ucomm.

    when 'SELECT'

    write your code to edit alv.

    endcase.

    endform.

    Add comment
    10|10000 characters needed characters exceeded

  • May 08, 2017 at 03:13 PM

    Yes I am doing the same way .. when the particular check box is selected I am modifying the field catalog with the row_pos and edit for each field at the output .. but the row is not coming for edit.

    Add comment
    10|10000 characters needed characters exceeded

  • May 10, 2017 at 02:22 PM

    Hi,

    Have you used used refresh parameter on selected rows?

    l_selfield TYPE slis_selfield.
    l_selfield-refresh = 'X'.

    Write this statement after selecting the row to be edited. It will refresh currently displayed ALV.

    Regards,

    Mangesh

    Add comment
    10|10000 characters needed characters exceeded