05-26-2010 2:55 PM
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
05-26-2010 4:09 PM
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
05-26-2010 4:09 PM
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
06-06-2010 8:10 PM
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.