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: 

SALV How to activate DIRECTLY button subtotal u03A3/u03A3 ?

Former Member
0 Kudos

Hi,

I would like the button u03A3/u03A3 displayed directly just besides the button "Total' u03A3

I copied standard gui status SALV_TABLE_STANDARD from standard function group SALV_METADATA_STATUS .

The function "subtotal" is there foreseen.

Then I apply this gui status to my program by calling method :

  • Put the standard buttons on the application toolbar :

call method o_table->set_screen_status

exporting

report = sy-repid

pfstatus = c_pfstatus

set_functions = o_table->c_functions_default.

but even if I use o_table->c_functions_all, all the functions doesn't appear on the screen and the one I want to activate is the subtotal is one of them...)

Do you know how I can activate it ?

Thanks for your help ...

Here the standard documentation from class CL_SALV_FUNCTIONS_LIST :

Activate All Subtotal Group Functions

Functionality

The user finds the functions for subtotals by default as a pushbutton (Subtotals) and in the Settings menu (Define totals drilldown).

Note:

The user can only use the Subtotals function if he or she has first executed the Totals function over an aggregatable column. Ensure that you have also activated the Totals function.

You have the following options for making subtotals functions available:

You use the SET_GROUP_SUBTOTALS method to add all functions simultaneously.

You use one or more of the following methods to activate the corresponding functions individually:

SET_SUBTOTALS

SET_SUBTOTALS_OUTLINE

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Don't know if it will help (I assume that you have some numeric columns?)...but I've done:

* SALV toolbar & GUI functions
  gr_f_list     = gr_alv->get_functions( ).
  lt_func_list  = gr_f_list->get_functions( ).
  gr_f_list->set_all( abap_true ).          "All On

and

gr_alv->set_screen_status(
              pfstatus      = 'SALV_STANDARD'
              report        = sy-repid
              set_functions = gr_alv->c_functions_all ).

See Rich Heilman's excellent tutorials on SALV...also programs named SALV* for more examples.

2 REPLIES 2

Former Member
0 Kudos

Don't know if it will help (I assume that you have some numeric columns?)...but I've done:

* SALV toolbar & GUI functions
  gr_f_list     = gr_alv->get_functions( ).
  lt_func_list  = gr_f_list->get_functions( ).
  gr_f_list->set_all( abap_true ).          "All On

and

gr_alv->set_screen_status(
              pfstatus      = 'SALV_STANDARD'
              report        = sy-repid
              set_functions = gr_alv->c_functions_all ).

See Rich Heilman's excellent tutorials on SALV...also programs named SALV* for more examples.

Former Member
0 Kudos

Create subtotals in the sort of you ALV:

CALL METHOD grid1->set_table_for_first_display

EXPORTING

is_layout = gs_layout

is_variant = vgs_layout

i_default = 'X'

i_save = 'A'

CHANGING

it_outtab = i_c[]

it_fieldcatalog = gt_fieldcat

it_sort = gt_sort. <----


CREATE OBJECT event_receiver.

____________________________________________________

gs_sort-fieldname = 'VONKT'.

gs_sort-tabname = 'I_C'.

gs_sort-spos = 1.

gs_sort-up = 'X'.

gs_sort-subtot = 'X'. <----


APPEND gs_sort TO gt_sort.

And in you field catalog set the column attribute "wa_fieldcat-do_sum = 'X'." for the one you need to get the subtotal.