‎2009 May 07 11:27 PM
Hello all,
Method "set_table_for_first_display" of class "cl_gui_alv_grid" is displaying the SUBTOTAL icon grayed out. Initially I was excluding the button. But after commenting out the exclude logic, the button displayed but is not active.
What do i need to changed to allow that button to be pressed?
Thanks
Bruce
w_grid TYPE REF TO cl_gui_alv_grid, " ALV grid object
DATA ls_exclude TYPE ui_func.
prevent display of the following icons on the ALV toolbar
*
ls_exclude = cl_gui_alv_grid=>mc_mb_subtot. " SUBTOTAL
append ls_exclude to pt_exclude.
*
CALL METHOD w_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = 'X'
is_layout = l_layout
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = il_fieldcat
it_outtab = il_outtab.
‎2009 May 08 8:27 AM
1) Create a Table of Type LVC_T_SORT -->T_sort
2) Field string of type LVC_S_SORT--->Fs_sort
Pass:
FS_sort-Fieldname = <Numceric Field>.
FS_SORT-SUBTOT = 'X'.
Append fs_sort to t_sort.
3) Pass the table to CALL METHOD w_grid->set_table_for_first_display
Regards,
Gurpreet
‎2009 May 08 5:33 AM
remove the below passing parameter
it_toolbar_excluding = lt_exclude to the call of the method..set_for)first_diaply..
and check...
Edited by: Sravan Kumar on May 8, 2009 6:33 AM
‎2009 May 08 5:41 PM
Sravan,
Removing exclude table from the method did not change the SUBTOTAL icon. It is still grayed out.
Thanks
Bruce
‎2009 May 08 8:27 AM
1) Create a Table of Type LVC_T_SORT -->T_sort
2) Field string of type LVC_S_SORT--->Fs_sort
Pass:
FS_sort-Fieldname = <Numceric Field>.
FS_SORT-SUBTOT = 'X'.
Append fs_sort to t_sort.
3) Pass the table to CALL METHOD w_grid->set_table_for_first_display
Regards,
Gurpreet
‎2009 May 08 5:42 PM
Gurpreet,
After adding your code suggestion, the SUBTOTAL icon is still grayed out.
Thanks
Bruce
‎2009 May 08 6:05 PM
‎2009 May 08 6:08 PM
BTW, to set the totaling for a column use the DO_SUM field in the field catalog.
clear: ls_fcat.
ls_fcat-reptext = 'Est. Hrs'.
ls_fcat-coltext = 'Est. Hrs'.
ls_fcat-fieldname = 'ESHRS'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-datatype = 'QUAN'.
ls_fcat-do_sum = 'X'. "<--- SEt this flag
ls_fcat-just = 'R'.
ls_fcat-outputlen = '10'.
ls_fcat-col_pos = 7.
append ls_fcat to fieldcat.Regards,
Rich Heilman
‎2009 May 08 9:34 PM
Rich,
Your two suggestions worked flawlessly.
I have another related question.
When the subtotal dialog displays, three options are displayed, sort ascending, sort descending, and subtotal.
When executing tcode FS10N, a fourth option, countrol break also displays.
How do I get the control break option to display in my program when the subtotal dialog displays?
Thanks
Bruce
‎2009 May 08 9:45 PM
The question was answered correctly, but I wanted to ask a follow-up question. I thought my follow-up question would be more likely to be looked at and answered if the question was still marked as unanswered.
Bruce