2007 May 23 11:04 AM
how can i assign a checkbox beside each row in a table using alv grid display.how can i get without using field catalog.
2007 May 23 11:15 AM
hi,
use this function module
reuse_alv_grid_display
and define an internal table of your own and in that select one field as type c
and while filling your field catalog
just make the value as 'X'
itab-checkbox = 'X.
you wil get the check boxes.
for more information just go through these links..
hope this will solve your problem and don't forget to reward points.
regards,
2007 May 23 11:13 AM
use the layout as shown below and u will get the checkbox
*--ALV layout Settings
wa_alv_layout-box_fieldname = 'CHECKBOX'.
wa_alv_layout-zebra = 'X'.
wa_alv_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = t_fieldcat
i_callback_program = w_repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = wa_alv_layout
it_events = t_alv_events[]
TABLES
t_outtab = t_output_data[].
IF sy-subrc <> 0.
ENDIF.
Reward if useful
2007 May 23 11:15 AM
hi,
use this function module
reuse_alv_grid_display
and define an internal table of your own and in that select one field as type c
and while filling your field catalog
just make the value as 'X'
itab-checkbox = 'X.
you wil get the check boxes.
for more information just go through these links..
hope this will solve your problem and don't forget to reward points.
regards,
2007 May 23 11:18 AM
Hi Mahesh,
in the internal table declaration add one more field of type c and length 1, say the name of the field is check.
DATA : BEGIN OF T_MARA occurs 0,
MATNR LIKE MARA-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
check,
END OF T_MARA.
mention this field name in the layout..
s_layout-box_fieldname = 'CHECK'.
now use this in the
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
<b>is_layout = s_layout</b>
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = t_fcat
TABLES
t_outtab = t_mara.
if you are using grid display then you need to sepcify it in the field catalog.
wa_fcat-fieldname = 'CHECK'.
wa_fcat-tabname = 'T_MARA'.
wa_fcat-checkbox = 'X'.
wa_fcat-colpos = 1.
append wa_fcat to t_fcat.
then no need to specify in the s_layout..
Regards,
Vidya.
2007 May 23 11:20 AM
Hi,
Specify your field name which you have been using for check box in layout and pass the layout to FM.
Cheers,
Bujji
2008 Jul 03 7:38 AM
Hi , just a follow on from what was said before, I had the same issue to resolve and my main sticking point was the field as a checkbox was not editable. In the examples in the thread they have assigned as field as a checkbox:
fieldcat-checkbox = 'X'.
What they have neglected is the needed entry:
fieldcat-edit = 'X'
Without edit you have a checkbox that you can work with but the user cannot manually change 'tick'.
Ian