Skip to Content
author's profile photo
Former Member

Specific cell Editable , Cl_gui_alv_grid

i have created a alv grid.

to display the confirmations of operations in prod order.

i have selected cells which are to be marked as non editable.

becoz these operations does not exist in routing of

that prod order material.


1.PNG (48.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Jul 17, 2013 at 08:37 AM

    Hi Abhishek,

    You mean conditional editing.

    Create an extra field in your internal table.

    DATA: celltab TYPE lvc_t_styl.


    Now declare a table.

    DATA: lt_celltab TYPE lvc_t_styl,

    ls_celltab TYPE line of lvc_t_styl.


    Now Loop on your itab and make the value of this field based on condition.

    ls_celltab-fieldname = 'FIELDNAME of field to be disbaled'.

    IF prd_status EQ 'CONFIRMED'.

    ls_celltab-mode = cl_gui_alv_grid=>mc_style_enabled. "to enable the required fields

    ELSE.

    ls_celltab-mode = cl_gui_alv_grid=>mc_style_disabled.

    ENDIF.

    INSERT ls_celltab INTO TABLE lt_celltab.

    Continue this for all the fields

    Finally

    INSERT LINES OF lt_celltab INTO TABLE wa_tab-celltab.

    MODIFY itab FROM wa_tab INDEX l_index.

    clear lt_celltab.


    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      May I add that you need to add the field name "CELLTAB"

      in the layout parameter:

      DATA: ob_gui_alv_grid_1 TYPE REF TO cl_gui_alv_grid .


      CONSTANTS: gc_styl_fname TYPE lvc_ctfnm VALUE 'CELLTAB' ,

      DATA: st_layout TYPE lvc_s_layo .

      st_layout-stylefname = gc_styl_fname .

      CALL METHOD ob_gui_alv_grid_1->set_table_for_first_display
      EXPORTING
      is_layout = st_layout


      Regards.

  • author's profile photo
    Former Member
    Jul 17, 2013 at 09:45 AM

    THANKS 😊

    Add comment
    10|10000 characters needed characters exceeded