Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Specific cell Editable , Cl_gui_alv_grid

Former Member
0 Kudos

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 ACCEPTED SOLUTION

Former Member
0 Kudos

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.


3 REPLIES 3

Former Member
0 Kudos

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.


0 Kudos

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.

Former Member
0 Kudos

THANKS