07-17-2013 9:10 AM
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.
07-17-2013 9: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.
07-17-2013 9: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.
07-17-2013 10:20 AM
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.
07-17-2013 10:45 AM