Application Development and Automation 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: 
Read only

set cell type for CL_GUI_ALV_GRID object

Former Member
0 Likes
4,619

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

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
2,252

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

4 REPLIES 4
Read only

Former Member
0 Likes
2,252

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

Read only

naimesh_patel
Active Contributor
0 Likes
2,253

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

Read only

Former Member
0 Likes
2,252

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

Read only

0 Likes
2,252

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