2008 Feb 05 10:24 AM
Hallo,
I want the user to be able to input data in some columns of my ALV Grid, but not in all. How can I disable some columns for input, when the ALV Grid is in Input/Edit mode?
Thank you,
Manuel
2008 Feb 05 11:06 AM
Hi,
Step 1.
Add this feild in ur Internal table.
field_style TYPE lvc_t_styl, "FOR DISABLE
FORM build_layout.
Set layout field for field attributes(i.e. input/output)
gd_layout-no_input = 'X'.
gd_layout-cwidth_opt = 'X'.
gd_layout-stylefname = 'FIELD_STYLE'.
gd_layout-zebra = 'X'.
gd_layout-info_fname = 'LINE_COL'.
ENDFORM. " BUILD_LAYOUT
*step-2 * Call this Subroutine before Fieldcatalog........
FORM set_specific_field_attributes .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
clear : ls_stylerow.
clear : wa_final-field_style.
refresh WA_FINAL-FIELD_STYLE[].
Populate style variable (FIELD_STYLE) with style properties
The following code sets it to be disabled(display only)
if child deal Ticket Number Approved or rejected.
LOOP AT it_final INTO wa_final.
IF wa_final-apprd = 'X' or wa_final-rejct = 'X'.
ls_stylerow-fieldname = 'APPRD' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
APPEND ls_stylerow TO wa_final-field_style.
MODIFY it_final FROM wa_final. "my Internal table, Replace ur internal table.
ls_stylerow-fieldname = 'REJCT' . " ur field name
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
APPEND ls_stylerow TO wa_final-field_style.
MODIFY it_final FROM wa_final.
endif.
like this u have to add for all colunms in ur report which u
want to disable.
Note the stylerow appending should be in Alphabetic order
ENDLOOP.
ENDFORM. " set_specific_field_attributes
Thanx
bgan.
Hallo,
I want the user to be able to input data in some columns of my ALV Grid, but not in all. How can I disable some columns for input, when the ALV Grid is in Input/Edit mode?
Thank you,
Manuel
2008 Feb 05 10:27 AM
Hello,
In the fieldcatalog of the fields u want to the user to edit do like this.
IF u want to change field1 then in the field catalog of field1
IT_FIELDCAT-EDIT = 'X'
Cheers,
Vasanth
2008 Feb 05 11:03 AM
HI ,
try like this
l_r_fieldcat-tabname = 'G_T_ITAB'.
l_r_fieldcat-edit = 'X'.
l_r_fieldcat-outputlen = 10.
l_r_fieldcat-col_pos = 1.
l_r_fieldcat-seltext_m = 'Sales Order'.
APPEND l_r_fieldcat TO g_t_fieldcat.
CLEAR l_r_fieldcat.
reward if usefull....
2008 Feb 05 11:06 AM
Hi,
Step 1.
Add this feild in ur Internal table.
field_style TYPE lvc_t_styl, "FOR DISABLE
FORM build_layout.
Set layout field for field attributes(i.e. input/output)
gd_layout-no_input = 'X'.
gd_layout-cwidth_opt = 'X'.
gd_layout-stylefname = 'FIELD_STYLE'.
gd_layout-zebra = 'X'.
gd_layout-info_fname = 'LINE_COL'.
ENDFORM. " BUILD_LAYOUT
*step-2 * Call this Subroutine before Fieldcatalog........
FORM set_specific_field_attributes .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
clear : ls_stylerow.
clear : wa_final-field_style.
refresh WA_FINAL-FIELD_STYLE[].
Populate style variable (FIELD_STYLE) with style properties
The following code sets it to be disabled(display only)
if child deal Ticket Number Approved or rejected.
LOOP AT it_final INTO wa_final.
IF wa_final-apprd = 'X' or wa_final-rejct = 'X'.
ls_stylerow-fieldname = 'APPRD' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
APPEND ls_stylerow TO wa_final-field_style.
MODIFY it_final FROM wa_final. "my Internal table, Replace ur internal table.
ls_stylerow-fieldname = 'REJCT' . " ur field name
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
APPEND ls_stylerow TO wa_final-field_style.
MODIFY it_final FROM wa_final.
endif.
like this u have to add for all colunms in ur report which u
want to disable.
Note the stylerow appending should be in Alphabetic order
ENDLOOP.
ENDFORM. " set_specific_field_attributes
Thanx
bgan.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |