2005 Nov 15 9:08 AM
Hi,
How to implement in an ALV list, a column with checkboxes, but only some of the checkboxes to be enable ( if a field in that row meet a condititon)?
Thks
Bogdan
Message was edited by: Bogdan Cojocaru
2005 Dec 21 8:57 AM
hI,
I want to get the checkbox displayed but am unable to do so.I have done what is suggested as in code below:
" For checkbox
insert initial line into table ch_fieldcat assigning <wa_catalogue>.
<wa_catalogue>-col_pos = lines( ch_fieldcat ).
<wa_catalogue>-row_pos = 0.
<wa_catalogue>-fieldname = 'CHECKBOX'.
<wa_catalogue>-inttype = 'C'.
<wa_catalogue>-edit = 'X'.
<wa_catalogue>-seltext =
<wa_catalogue>-coltext = 'Choose test class for tagging'.
<wa_catalogue>-checkbox = abap_true.
<wa_catalogue>-outputlen = 10.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = im_structure_name
changing
ct_fieldcat = ch_fieldcat
exceptions
others = 1.
if sy-subrc <> 0.
raise exception type cx_pak_gui_error.
endif.
describe table ch_fieldcat lines l_lin.
loop at ch_fieldcat assigning <lfs_field>.
case <lfs_field>-fieldname.
when 'SOBJ_NAME'.
<lfs_field>-coltext = 'Test Class'(002).
<lfs_field>-outputlen = 30.
<lfs_field>-key = 'X'.
when 'CHECKBOX'.
<lfs_field>-coltext = 'Choose TestClass for Tagging'(003).
<lfs_field>-outputlen = 30.
<lfs_field>-row_pos = 0.
<lfs_field>-key = 'X'.
when l_fieldname. " ICON*
<lfs_field>-icon = abap_true.
<lfs_field>-no_out = 'X'.
when others.
<lfs_field>-key = 'X'.
<lfs_field>-no_out = 'X'.
endcase.
endloop.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = im_structure_name
changing
ct_fieldcat = ch_fieldcat
exceptions
others = 1.
Please advise.
Regards,
VG
hI,
I want to get the checkbox displayed but am unable to do so.I have done what is suggested as in code below:
" For checkbox
insert initial line into table ch_fieldcat assigning <wa_catalogue>.
<wa_catalogue>-col_pos = lines( ch_fieldcat ).
<wa_catalogue>-row_pos = 0.
<wa_catalogue>-fieldname = 'CHECKBOX'.
<wa_catalogue>-inttype = 'C'.
<wa_catalogue>-edit = 'X'.
<wa_catalogue>-seltext =
<wa_catalogue>-coltext = 'Choose test class for tagging'.
<wa_catalogue>-checkbox = abap_true.
<wa_catalogue>-outputlen = 10.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = im_structure_name
changing
ct_fieldcat = ch_fieldcat
exceptions
others = 1.
if sy-subrc <> 0.
raise exception type cx_pak_gui_error.
endif.
describe table ch_fieldcat lines l_lin.
loop at ch_fieldcat assigning <lfs_field>.
case <lfs_field>-fieldname.
when 'SOBJ_NAME'.
<lfs_field>-coltext = 'Test Class'(002).
<lfs_field>-outputlen = 30.
<lfs_field>-key = 'X'.
when 'CHECKBOX'.
<lfs_field>-coltext = 'Choose TestClass for Tagging'(003).
<lfs_field>-outputlen = 30.
<lfs_field>-row_pos = 0.
<lfs_field>-key = 'X'.
when l_fieldname. " ICON*
<lfs_field>-icon = abap_true.
<lfs_field>-no_out = 'X'.
when others.
<lfs_field>-key = 'X'.
<lfs_field>-no_out = 'X'.
endcase.
endloop.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = im_structure_name
changing
ct_fieldcat = ch_fieldcat
exceptions
others = 1.
Please advise.
Regards,
VG
2005 Nov 15 9:24 AM
2005 Nov 15 10:27 AM
Hi,
To output a column with checkbox,you need to code like below in fieldcat.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: line_fieldcat TYPE slis_fieldcat_alv.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'CHK'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_l = 'Checkbox'.
line_fieldcat-checkbox = 'X'. " Display this field as a checkbox
line_fieldcat-edit = 'X'. " This option ensures that you can
" edit the checkbox. Else it will
" be protected.
APPEND line_fieldcat TO i_fieldcat.
But I don't think you can selectively enable some rows to check the checkbox.
Kindly reward points if it helps.
2005 Dec 21 8:57 AM
hI,
I want to get the checkbox displayed but am unable to do so.I have done what is suggested as in code below:
" For checkbox
insert initial line into table ch_fieldcat assigning <wa_catalogue>.
<wa_catalogue>-col_pos = lines( ch_fieldcat ).
<wa_catalogue>-row_pos = 0.
<wa_catalogue>-fieldname = 'CHECKBOX'.
<wa_catalogue>-inttype = 'C'.
<wa_catalogue>-edit = 'X'.
<wa_catalogue>-seltext =
<wa_catalogue>-coltext = 'Choose test class for tagging'.
<wa_catalogue>-checkbox = abap_true.
<wa_catalogue>-outputlen = 10.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = im_structure_name
changing
ct_fieldcat = ch_fieldcat
exceptions
others = 1.
if sy-subrc <> 0.
raise exception type cx_pak_gui_error.
endif.
describe table ch_fieldcat lines l_lin.
loop at ch_fieldcat assigning <lfs_field>.
case <lfs_field>-fieldname.
when 'SOBJ_NAME'.
<lfs_field>-coltext = 'Test Class'(002).
<lfs_field>-outputlen = 30.
<lfs_field>-key = 'X'.
when 'CHECKBOX'.
<lfs_field>-coltext = 'Choose TestClass for Tagging'(003).
<lfs_field>-outputlen = 30.
<lfs_field>-row_pos = 0.
<lfs_field>-key = 'X'.
when l_fieldname. " ICON*
<lfs_field>-icon = abap_true.
<lfs_field>-no_out = 'X'.
when others.
<lfs_field>-key = 'X'.
<lfs_field>-no_out = 'X'.
endcase.
endloop.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = im_structure_name
changing
ct_fieldcat = ch_fieldcat
exceptions
others = 1.
Please advise.
Regards,
VG
2005 Dec 21 9:11 AM
are you using ALV GRID/ ALV LIST/ ALV Grid class..
if it is using classes let me know,...
vijay
Message was edited by: Vijay Babu Dudla
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |