2007 Mar 15 12:47 PM
How we will exclude some buttons from alv out put list display. it give some buttons by default. how we will avoid it
Regards
Ramana
2007 Mar 15 1:39 PM
HI Ramana ..
To exculde some the buttons from ALV just follow the steps below .
Go to SE80 T-code
Select Package in first combo
give BALV_ADDON in secod combo give Enter.
u will get list below ..
From that list select PROGRAMS->R_ALV_LIST_TOOLBAR_MANAGER.
in that u can see on tool bar named STANDARD....
This is the standard one which ALV is useing ..
Just right click and select COPY ...
it will ask from pogram and to program ..
u give ur program name in to program
and ZSTANDARD for tool bar ...
Now u can go to u r program and edit that toolbar
i.e delete the buttons that u dont need ..
thanks
JK
2007 Mar 15 12:58 PM
Do something like this...
DATA: IT_EXTAB TYPE SLIS_T_EXTAB.
DATA: WA_EXTAB LIKE LINE OF IT_EXTAB.
WA_EXTAB-FCODE = 'APEN'.
APPEND WA_EXTAB TO IT_EXTAB.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_EXCLUDING = IT_EXTAB
Of course....You need to complete the FM parameters....
Greetings,
Blag.
2007 Mar 15 1:04 PM
Hi,
If you want to remove the buttons from application toolbar, You can have your own GUI status.
If you want to have those buttons too. You can copy the alv standats status and modify it.
Regards
Rusidar
2007 Mar 15 1:06 PM
Hi,
Please check the code below:
data: it_exclude TYPE ui_functions.
Exclude toolbar buttons which are not required
CLEAR : it_exclude, it_exclude[].
PERFORM exclude_tb_functions CHANGING it_exclude.
CLEAR : it_exclude, it_exclude[].
&----
*& Form EXCLUDE_TB_FUNCTIONS
&----
text
----
<--P_IT_EXCLUDE text
----
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_check.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_refresh.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_print.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_sum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_subtot.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_info.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
APPEND ls_exclude TO pt_exclude.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
regards
Kannaiah
2007 Mar 15 1:18 PM
hi,
we can remove standard buttons and we can also add our own buttons to alv list
go through the sample code......
TYPE-POOLS SLIS.
TABLES:
SPFLI,
SFLIGHT,
SBOOK.
DATA: BEGIN OF FS_SPFLI,
CHECK(1),
ROWCOLOR(4).
INCLUDE STRUCTURE SPFLI.
DATA: END OF FS_SPFLI.
DATA: BEGIN OF FS_SFLIGHT,
CHECK(1),
ROWCOLOR(4).
INCLUDE STRUCTURE SFLIGHT.
DATA: END OF FS_SFLIGHT.
DATA:
T_SPFLI LIKE
STANDARD TABLE
OF FS_SPFLI.
DATA:
T_SFLIGHT LIKE
STANDARD TABLE
OF FS_SFLIGHT.
DATA:
FS_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA:
T_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTS LIKE LINE OF T_EVENTS,
T_SPFLI TYPE STANDARD TABLE OF SPFLI,
FS_SPFLI LIKE LINE OF T_SPFLI,
T_SFLIGHT TYPE STANDARD TABLE OF SFLIGHT,
FS_SFLIGHT LIKE LINE OF T_SFLIGHT,
T_SBOOK TYPE STANDARD TABLE OF SBOOK,
FS_SBOOK LIKE LINE OF T_SBOOK.
SELECT *
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.
FS_LAYOUT-BOX_FIELDNAME = 'CHECK'.
FS_LAYOUT-INFO_FIELDNAME = 'ROWCOLOR'.
CLEAR FS_EVENTS.
FS_EVENTS-NAME = 'USER_COMMAND'.
FS_EVENTS-FORM = 'AT_USERCOMMAND'.
APPEND FS_EVENTS TO T_EVENTS.
CLEAR FS_EVENTS.
FS_EVENTS-NAME = 'PF_STATUS_SET'.
FS_EVENTS-FORM = 'SET_PFSTATUS'.
APPEND FS_EVENTS TO T_EVENTS.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'SPFLI'
IS_LAYOUT = FS_LAYOUT
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = T_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = T_SPFLI
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.
&----
*& Form SET_PFSTATUS
&----
FORM SET_PFSTATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
DATA:
FS_EXTAB LIKE LINE OF RT_EXTAB.
FS_EXTAB-FCODE = '&ALL'.
APPEND FS_EXTAB TO RT_EXTAB.
FS_EXTAB-FCODE = '&SAL'.
APPEND FS_EXTAB TO RT_EXTAB.
SET PF-STATUS 'TEST' EXCLUDING RT_EXTAB.
ENDFORM. "SET_PFSTATUS
in the SET_PFSTATUS form , some of standard functions are excluded by the statement SET PF-STATUS 'TEST' EXCLUDING RT_EXTAB.
RT_EXTAB contains the function codes which needs to be removed
2007 Mar 15 1:20 PM
Hi Ramana,
If you want to display list using alv as a list you can use function module 'REUSE_ALV_LIST_DISPLAY' .In this you can exclude some buttons using it_excluding .The optional IMPORTING parameter IT_EXCLUDING is an internal table. It is only needed if the caller uses the list tool standard interface but wants to deactivate interface functions which you does not want .In this case the function codes of these standard functions are entered in the table.
if you want to display list as a grid you can use function module 'REUSE_ALV_GRID_DISPLAY'.You can use above procedure to exclude some of buttons.
If you want to display list as grid in object oriented procedures . To exclude those buttons, you fill a table of type UI_FUNCTIONS and pass it to the parameter IT_TOOLBAR_EXCLUDING of the method set_table_for_first_display. The function codes for the buttons may be acquired by inspecting the constant attributes of the class cl_gui_alv_grid or putting a break point into a method, like the event-handling method of the event after_user_command, which deals with the ALV command.
To hide the entire toolbar, you can set the field NO_TOOLBAR of the layout structure to X.
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_maximum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_minimum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_subtot .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_average .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_sum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_subtot .
2007 Mar 15 1:28 PM
Hi,
There are two differeny ways to do this.
<b>[1].</b> Copy current GUI status. Add/ remove whatever button and function code you want. User this status when you call the ALV function module:
*--------------------------------------------------
DATA: gc_status_grid TYPE slis_formname
VALUE 'ALV_GRID_SET_STATUS'.
* define all other parametrs too in this FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = gc_status_grid " GUI STATUS
*---------------------------------------------------------------------*
* FORM ALV_GRID_SET_STATUS
*---------------------------------------------------------------------*
FORM alv_grid_set_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
ENDFORM.
<b>[2].</b> Keep only one GUI status and exclulde button as you want.
Let's say when the report is running in test run mode you do not want to display "subtotal" button. You can write your code like this.
DATA: gt_extab TYPE slis_t_extab.
DATA: gc_status_grid TYPE slis_formname
VALUE 'ALV_GRID_SET_STATUS'.
PERFORM alv_pfstatus_define TABLES gt_extab.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = gc_status_grid " GUI STATUS
it_excluding = gt_extab[] "Table to exclude buttons
*&---------------------------------------------------------------------*
* FORM alv_pfstatus_define
*&---------------------------------------------------------------------*
FORM alv_pfstatus_define TABLES pt_extab TYPE slis_t_extab.
* report is running in test mode
IF p_trun = 'X'
pt_extab-fcode = '&SUM'..
APPEND pt_extab.
ENDIF.
ENDFORM. " alv_pfstatus_define
*---------------------------------------------------------------------*
* FORM ALV_GRID_SET_STATUS
*---------------------------------------------------------------------*
FORM alv_grid_set_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
ENDFORM.
Let me know if you have any question.
Regards,
RS
2007 Mar 15 1:39 PM
HI Ramana ..
To exculde some the buttons from ALV just follow the steps below .
Go to SE80 T-code
Select Package in first combo
give BALV_ADDON in secod combo give Enter.
u will get list below ..
From that list select PROGRAMS->R_ALV_LIST_TOOLBAR_MANAGER.
in that u can see on tool bar named STANDARD....
This is the standard one which ALV is useing ..
Just right click and select COPY ...
it will ask from pogram and to program ..
u give ur program name in to program
and ZSTANDARD for tool bar ...
Now u can go to u r program and edit that toolbar
i.e delete the buttons that u dont need ..
thanks
JK
2007 Mar 15 1:49 PM
Hi,
U have to Define the PF-status and set it as ur wish
using Set PF-Status.
Hope helpful.
Regards,
Ravi
2007 Mar 16 11:22 AM
hi
set ur own pfstatus.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = '100' "set ur own pfstatus
i_callback_user_command = 'USER_COMMAND '
=
it_fieldcat = it_fcat
TABLES
t_outtab = it_sflight
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.
regards
shinu