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: 

Visibility of standard sum buttons in custom application toolbar in FM ALV

Former Member
0 Kudos

Hi,

I needed to add a custom button to the application toolber in a report using FM REUSE_ALV_GRID_DISPLAY, so I copied the status STANDARD_FULLSCREEN from program SAPLKKBL to my program, modified accordingly and set the GUI status in the ALV using parameter I_CALLBACK_PF_STATUS_SET. Everything works fine; the standard buttons and my custom button all work as expected.

However, in my custom status, all the standard buttons are visible. Calling REUSE_ALV_GRID_DISPLAY with the standard status, i.e. no status explicity set by me, only some of the buttons are visible. I don't need all the standard buttons, so I removed the ones I don't need using the following code and parameter I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS':

FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.

DATA: FCODE TYPE TABLE OF SY-UCOMM.

APPEND '&EB9' TO FCODE.

APPEND '&REFRESH' TO FCODE.

APPEND '&ALL' TO FCODE.

APPEND '&SAL' TO FCODE.

APPEND '&INFO' TO FCODE.

SET PF-STATUS 'ZSTANDARD_FULLSCREEN' EXCLUDING FCODE.

FREE: FCODE.

ENDFORM.

The issue is that both the standard Totals (&UMC) and Subtotals (&SUM) buttons are now visible simultaneously. The standard application toolbar behaviour is that the Subtotals button only becomes visible when the Totals button is used to calculate the sum of a column containing totalizable values. The Subtotals button becomes invisible again if the summation is removed.

I would like to reproduce this behaviour in my program. How can this be achieved? Is there a parameter / FM to set visibilty of individual pushbuttons on the application toolbar? Or alternatively, is there a way to set the visibilty of my custom toolbar to the same as the standard toolbar + my custom button?

Help is appreciated, thanks.

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can (in i_callback_user_command) execute the "set pf-status excluding". The internal tables of excluded button must comes from the subtotal strucuture (lookin for what fields have sum = 'X').

Best regards,

Leandro Mengue

2 REPLIES 2

Former Member
0 Kudos

Hi,

You can (in i_callback_user_command) execute the "set pf-status excluding". The internal tables of excluded button must comes from the subtotal strucuture (lookin for what fields have sum = 'X').

Best regards,

Leandro Mengue

0 Kudos

Solved.

Replaced the above code with:

FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'ZSTANDARD_FULLSCREEN' EXCLUDING RT_EXTAB.

ENDFORM.