‎2008 Apr 04 11:08 AM
HI,
Does anybody knows how to display layout management in the Application toolbar of an ALV?
Please help...
thank you...
regards,
mae
‎2008 Apr 04 11:36 AM
Mae,
You will need to create your own PF_STATUS for the ALV grid and add an Function Code/Icon for the Layout Management.
Here is some info for possibly doing that. I have not tested for actually going to the Layout Management, but I do show you the Function Code for it and where to use it.
This is from the Fuction Documenation for REUSE_ALV_GRID_DISPLAY under I_CALLBACK_PF_STATUS_SET.
If the caller wants to use a self-defined user interface (for example, in order to provide additional list functions or use
existing functions), we recommend that you copy standard status STANDARD from function group SALV and modify
it accordingly. ALV standard function codes always start with '&'.
See also the documentation on parameter I_CALLBACK_USER_COMMAND.
If a self-defined user interface is used that includes function codes of the standard user interface, the function codes
of the excluding table passed should be taken into account.
This means that the user status should generally be set as follows:
SET PF-STATUS user status EXCLUDING rt_extab.
Application functions can be added to excluding table rt_extab if they are to be disabled.
The routine is called whenever the standard user interface would be set with SET PF-STATUS.
Default
If no EXIT routine is specified, the ALV sets a status that corresponds to status STANDARD of function group SALV.
in your PF Status add one with the Function Code &ERW. This is the Function Code for Layout Management. Be Sure you Do this
Your ALV Call will look like this
* Call ABAP/4 List Viewer
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_pf_status_set = 'STAT_0100' " PF Status you create
is_layout = gs_layout
is_print = gt_print
it_sort = gt_sort[]
it_events = gt_events[]
it_fieldcat = gt_fieldcat[]
i_save = 'A'
TABLES
t_outtab = it_display.
ENDFORM. " detail_layout_build
*---------------------------------------------------------------------*
* FORM STAT_0100 *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM stat_0100 USING gt_exclude. " using the PF Status you made
*
SET PF-STATUS 'STAT_0100' EXCLUDING gt_exclude.
*
ENDFORM. "end custom PF Status
I believe you may be ok with it with just this. The ALV Function should intercept this Function Code and Process as normal.
Edited by: Paul Chapman on Apr 4, 2008 12:40 PM