2011 Dec 03 11:29 AM
Hi,
my challenge is the following. I have an ALV-grid (cl_gui_alv_grid) with 2 columns, the first column contains a description and the second column serves for data entry. BUT the way of data entry depends on the description, means that for one kind of desciption i need a checkbox, for the other kind i need an character input field. I didn't found a method in the cl_gui_alv_grid class for this, but in the cl_salc - class family. But i don't know how to get a connection from the cl_gui_alv_grid object to a cl_salv- object.
Can anyone help me with this?
Tia
Günter
2011 Dec 05 2:34 PM
You should be able to control the behavior of the column by using STYLES. You need to create a field with TYPE LVC_T_STYL in your output table. For each row where you want a specific behavior, you need to fill the type to this table.
Check the program BCALV_TEST_GRID_FIELDS on how to use styles.
Regards,
Naimesh Patel
Hi,
my challenge is the following. I have an ALV-grid (cl_gui_alv_grid) with 2 columns, the first column contains a description and the second column serves for data entry. BUT the way of data entry depends on the description, means that for one kind of desciption i need a checkbox, for the other kind i need an character input field. I didn't found a method in the cl_gui_alv_grid class for this, but in the cl_salc - class family. But i don't know how to get a connection from the cl_gui_alv_grid object to a cl_salv- object.
Can anyone help me with this?
Tia
Günter
2011 Dec 05 5:47 AM
Hi ,
why do you make sure of styles , check sample code for ALV styles...[http://www.saptechnical.com/Tutorials/ALV/Styles/demo.htm]
and you need to use include
<CL_ALV_CONTROL>
regards
Prabhu
2011 Dec 05 2:34 PM
You should be able to control the behavior of the column by using STYLES. You need to create a field with TYPE LVC_T_STYL in your output table. For each row where you want a specific behavior, you need to fill the type to this table.
Check the program BCALV_TEST_GRID_FIELDS on how to use styles.
Regards,
Naimesh Patel
2011 Dec 05 7:28 PM
Hi,
thanks for your answers - they solved my problem!
One following question: Can you tell me, what the meaning of field style2, style 3, style 4 and maxlen are? And add. is it possible to give the button something like a caption?
Kind regards
Günter
2011 Dec 05 7:37 PM
You can multiple Styles on the Cell. One combination could be: Like Editable + F4. So, in this case
wa_celltab-style = cl_gui_alv_grid=>mc_style_enabled."Edit cell
wa_celltab-style2 = cl_gui_alv_grid=>mc_style_f4. " F4 help
Maximum length MAXLEN would be used when you want to set the length of the button, dropdown, etc.
ls_button-fieldname = space.
ls_button-style = cl_gui_alv_grid=>mc_style_button.
ls_button-maxlen = 8.
Regards,
Naimesh Patel