11-02-2010 2:41 PM
Hi i use the above part of code. the output is an alv and the user can select more than one line which is wrong. Only one line to be selected.
* Data for ALV grid...
data: w_repid like sy-repid,
my_layout type slis_layout_alv,
g_save type c value 'X', "Use all ALV variant types
it_fieldcatalog type slis_t_fieldcat_alv,
wa_fieldcatalog like line of it_fieldcatalog,
it_sort type slis_t_sortinfo_alv,
wa_sort like line of it_sort.
w_repid = sy-repid.
data: lc_glay type lvc_s_glay.
my_layout-box_fieldname = 'SEL'.
lc_glay-edt_cll_cb = 'X'.
my_layout-colwidth_optimize = 'X'.
my_layout-cell_merge = 'X'.
my_layout-zebra = 'X'.
*my_layout-sel_mode = ''.
****
** The follwing function module determine
** what fields are to be shown on screen
** Here you should change only the internal table
** name that is to be output.
** Care to put the name in CAPITAL.
****
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = w_repid
i_internal_tabname = 'ITAB' " need to be changed
* I_STRUCTURE_NAME =
i_inclname = w_repid
changing
ct_fieldcat = it_fieldcatalog
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
11-02-2010 2:58 PM
my_layout-sel_mode - you may have to assign value to this. I have never done this way
Easy work around is you can display an option button as icon and do it .
You can refer this wiki link:[http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT]
11-02-2010 2:58 PM
my_layout-sel_mode - you may have to assign value to this. I have never done this way
Easy work around is you can display an option button as icon and do it .
You can refer this wiki link:[http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT]
11-02-2010 3:01 PM
i tried this but sel_mode is unknown in 4.6c . i wiil try with the 'radiobutton' idea.
11-02-2010 3:04 PM
This link says how to use sel_mode
link:[Properties of the ALV Grid Control |http://help.sap.com/saphelp_nw70/helpdata/EN/ef/a2e9eff88311d2b48d006094192fe3/frameset.htm]
11-02-2010 3:05 PM
11-02-2010 4:15 PM