Application Development 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: 

In ALV O/p , need Editable Checkbox for particular based on signal lights..

Former Member
0 Kudos

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.

2 REPLIES 2

former_member188685
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

it is answered