09-24-2008 10:20 AM
Hi,
I have requiremnt liek this in my ALV
There are 4 records in the output consisting of fields checkbox , traffic lights. here, 2 are Red and 2 are Green.
now Green light checkboxes should be (Enabled mode)checked with Edit mode. Red light check boxes should be diabled mode with unchecked. how to do this..
I had wriiteen the following code but it is giving me the dump.
DATA : ls_listrow LIKE LINE OF i_final,
ls_stylerow TYPE lvc_s_styl,
ls_styletab TYPE lvc_t_styl.
LOOP AT i_final INTO wa_final.
IF wa_final-light = '1'. "Disabled
ls_stylerow-fieldname = 'CHK'.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
ELSEIF wa_final-light = '3'. "Enabled
ls_stylerow-fieldname = 'CHK'.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
APPEND ls_stylerow TO ls_styletab.
INSERT LINES OF ls_styletab INTO TABLE ls_listrow-cellstyles.
MODIFY i_final FROM ls_listrow.
ENDLOOP.
Iam getting DUMP at INSERT line stmt.
Awaiting for ur reply.
Regards,
Deepthi.
09-24-2008 10:46 AM
I modified your code at modify statement , just check it once,.
DATA : ls_listrow LIKE LINE OF i_final,
ls_stylerow TYPE lvc_s_styl,
ls_styletab TYPE lvc_t_styl.
LOOP AT i_final INTO wa_final.
IF wa_final-light = '1'. "Disabled
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
ELSEIF wa_final-light = '3'. "Enabled
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
ls_stylerow-fieldname = 'CHK'.
APPEND ls_stylerow TO ls_styletab.
INSERT LINES OF ls_styletab INTO TABLE ls_listrow-cellstyles.
"Modify statement need some changes here...
MODIFY i_final INDEX sy-tabix FROM ls_list row TRANSPORTING cellstyles.
CLEAR: ls_listrow, ls_styletab.
ENDLOOP.
05-04-2010 4:37 PM