‎2009 Dec 07 10:46 PM
Hello all,
I am trying to create a button in each cell for one row of an ALV
Grid.
[http://help.sap.com/saphelp_erp2004/helpdata/en/88/387f380c2f2e3ce10000009b38f8cf/content.htm]
However I have problem with the part:
'If you want to display all cells of a row as pushbuttons, assign
the attribute cl_gui_alv_grid=>mc_style_button to the field style . In this case,
field fieldname remains empty'
I am not so skilled in this part, so please can anyone advice me how
to assign this attribute to the field of the deep structure??
Thanks a lot.
‎2009 Dec 08 12:44 AM
Hi John,
To fill the Deep structure, you need write a code like this. Change it according to your requirement.
Data: begin of gt_outtab occurs 0,
<your fields>
ct type lvc_t_styl.
Data: end of gt_outtab.
Fill your data to this outtab.
****You need to write a code like this to fill the last field CT.
Data: ls_s_layo TYPE lvc_s_layo,
lt_t_layo TYPE lvc_t_layo.
As per your requirement we don't need to fill the field. Because all field are to be displayed as pushbuttons. So i commented.
*ls_s_layo-fieldname
ls_s_layo-style = cl_gui_alv_grid=>mc_style_button.
Append ls_s_layo to lt_t_layo.
Now loop thru the output table.
LOOP AT gt_outtab ASSIGNING <fs_outtab>.
<fs_outtab>-ct[] = lt_t_layo.
ENDLOOP.
Regards,
Sampath.