10-05-2005 1:15 PM
Is it possible to alter the standard toolbar in the generated alv grid, e.g. removing/disable buttons using REUSE_ALV_GRID_DISPLAY?
Thanks!
10-05-2005 1:59 PM
Hi Rune,
U have to declare in this way
DATA:I_EXCLUDE TYPE SLIS_T_EXTAB.
wa_exclude type slis_extab. "ALV EXCLUDE WORK AREA
clear wa_exclude.
wa_exclude-fcode = '&VEXCEL'.
append wa_exclude to i_exclude.
clear wa_exclude.
wa_exclude-fcode = '&ETA'.
append wa_exclude to i_exclude.
all function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = ws_program
i_callback_user_command = 'USER_COMMAND'
is_layout = i_layout
it_fieldcat = i_fieldcat
<b> it_excluding = i_exclude</b>
it_sort = i_sort
i_save = 'A'
IS_VARIANT =
it_events = i_events
tables
t_outtab = final_itab.
Thanks&Regards,
Ruthra
10-05-2005 1:19 PM
Hi,
yes u can do it.
In order modify PF_STATUS of ALV grid report you need to perform the following steps:
1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:
i_callback_pf_status_set = 'SET_PF_STATUS' statement.
2. Create 'SET_PF_STATUS' FORM
3. Create pf_status (i.e. 'ZNEWSTATUS').
- It is recommend that you copy standard status'STANDARD' from function group SALV
and modify it accordingly. ALV standard function codes always start with '&'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
<b> i_callback_pf_status_set = 'SET_PF_STATUS'</b> "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
----
FORM SET_PF_STATUS *
----
<b>FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZNEWSTATUS'.</b> "Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.
Hope it helps u.
Kindly reward points if u find it useful.
Thanks&Regards,
Ruthra
10-05-2005 1:20 PM
Hi Rune,
You can use the parameter I_CALLBACK_PF_STATUS_SET for this. Please see the documentation of the function module. For more info pls refer this.
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
Cheers
Vinod
10-05-2005 1:26 PM
hi,
Another option fill the fcodes you want to exclude in internaltable and pass it in FM call.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
....
IT_EXCLUDING = lt_excludes
...
regards,
suresh
10-05-2005 1:52 PM
Thanks for all answers.
How should the internal table it_excludes look like?
I try this:
DATA: it_excludes TYPE TABLE OF string.
APPEND '&F3' TO it_excludes.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
....
IT_EXCLUDING = lt_excludes
...
and get runtime error:
"The line types of the tables are incombatible"
"The table keys of the tables are not identical"
Thanks!
10-05-2005 2:00 PM
Hi,
The IT_EXCLUDING table is type of SLIS_T_EXTAB,
Define work area 'LIKE LINE of SLIS_T_EXTAB'.
Move your fcode to this workarea and append it itab.
regards,
suresh
10-05-2005 1:31 PM
Hi Rune,
It is possible.
DATA: BEGIN OF i_functions OCCURS 0.
INCLUDE STRUCTURE rseul_fun.
DATA: END OF i_functions.
DATA: BEGIN OF i_function_list OCCURS 0.
INCLUDE STRUCTURE rsmpe_funl.
DATA: END OF i_function_list.
DATA: BEGIN OF it_exclude OCCURS 0,
fcode LIKE rsmpe-func.
DATA: END OF it_exclude.
CALL FUNCTION 'RS_CUA_GET_STATUS_FUNCTIONS'
EXPORTING language = sy-langu
program = 'SAPLKKBL'
status = 'STANDARD'
IMPORTING
MASTER_LANGUAGE =
TABLES functions = i_functions
function_list = i_function_list
EXCEPTIONS menu_not_found = 1
program_not_found = 2
status_not_found = 3
OTHERS = 4.
DELETE i_function_list WHERE fcode = '&UMC' OR fcode = '&SUM'.
LOOP AT i_function_list.
MOVE i_function_list-fcode TO it_exclude.
APPEND it_exclude.
CLEAR it_exclude.ENDLOOP.
Kindly award points if you got satisfactory output.
Regards,
Dilip
10-05-2005 1:43 PM
Hi,
I think you need to combine both pf-status and user_command to make it happen.
Kindly reward points by clicking the star on the left of reply,if it helps.
10-05-2005 1:59 PM
Hi Rune,
U have to declare in this way
DATA:I_EXCLUDE TYPE SLIS_T_EXTAB.
wa_exclude type slis_extab. "ALV EXCLUDE WORK AREA
clear wa_exclude.
wa_exclude-fcode = '&VEXCEL'.
append wa_exclude to i_exclude.
clear wa_exclude.
wa_exclude-fcode = '&ETA'.
append wa_exclude to i_exclude.
all function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = ws_program
i_callback_user_command = 'USER_COMMAND'
is_layout = i_layout
it_fieldcat = i_fieldcat
<b> it_excluding = i_exclude</b>
it_sort = i_sort
i_save = 'A'
IS_VARIANT =
it_events = i_events
tables
t_outtab = final_itab.
Thanks&Regards,
Ruthra
10-05-2005 2:35 PM
Thanks for answer.
I followed your example but get a syntax error:
"WA_EXCLUDE" cannot be converted to the line type of "IT_EXCLUDES".
This is my code now:
FORM call_list_viewer.
<b>DATA: it_excludes TYPE TABLE OF slis_t_extab,
wa_exclude TYPE slis_extab</b>.
CLEAR wa_exclude.
wa_exclude-fcode = '&VEXCEL'.
APPEND wa_exclude TO it_excludes.
CLEAR wa_exclude.
wa_exclude-fcode = '&ETA'.
APPEND wa_exclude TO i_exclude.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = i_layout
<b>it_excluding = it_excludes</b>
it_fieldcat = i_fieldcat[]
i_save = w_save
is_variant = w_variant
it_events = f_lv_events
TABLES
t_outtab = i_item
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " call_list_viewer
Thanks for answers!
10-05-2005 2:46 PM
Hi,
Try With this option.
<b>DATA it_excludes TYPE TABLE OF slis_t_extab.
DATA wa_exclude LIKE LINE OF it_excludes.</b>
10-06-2005 8:16 AM
Thanks for all answers. I had to write it this way to make it work:
DATA it_excludes TYPE TABLE OF <b>slis_extab</b>.
DATA wa_exclude LIKE LINE OF it_excludes.