‎2007 Feb 21 8:59 AM
i display the customcontrol i want to delete change layout icon i did using it-toolbar_excluding ,with the help of ms_layout type LVC_S_LAYO but error is coming
please suggest me how to delete this from SET_TABLE_FOR_FIRST_DISPLAY
using IT_TOOLBAR_EXCLUDING already i delete remaining icons i did not face any problem
Thanks & Regards
ramana
‎2007 Feb 21 9:58 AM
In PBO,
SET HANDLER o_eventreceiver->handle_toolbar FOR o_Alvgrid.
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
is_variant = w_variant
i_save = c_a
* I_DEFAULT = 'X'
is_layout = p_layout
* IS_PRINT =
it_special_groups = p_groups[]
it_toolbar_excluding = p_exclude[]
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
it_outtab = p_output[]
it_fieldcatalog = p_fieldcat[]
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i278.
LEAVE LIST-PROCESSING.
ENDIF.
INCLUDE <icon>.
* Predefine a local class for event handling to allow the
* declaration of a reference variable before the class is defined.
CLASS lcl_event_receiver DEFINITION DEFERRED.
CLASS cl_gui_container DEFINITION LOAD.
DATA : o_alvgrid TYPE REF TO cl_gui_alv_grid,
o_dockingcontainer TYPE REF TO cl_gui_docking_container,
o_eventreceiver TYPE REF TO lcl_event_receiver,
*---------------------------------------------------------------------*
* Internal Tables
*---------------------------------------------------------------------*
* Function button table definitions
i_exclude TYPE ui_functions,
* new function buttons definition
i_toolbar TYPE TABLE OF stb_button,
* special group definitions
i_groups TYPE lvc_t_sgrp,
* Field catalogue
i_fieldcat TYPE lvc_t_fcat,
* Selected rows on the grid
i_selected_rows TYPE lvc_t_row,
* Review materials
i_reviewed_mat TYPE STANDARD TABLE OF mara,
w_action(12) TYPE c,
* Define the layout structure
w_layout TYPE lvc_s_layo,
* Enable variant saving
w_variant TYPE disvariant,
* new function buttons definition
w_toolbar LIKE stb_button,
* selected rows in alv grid
w_row LIKE lvc_s_row-index,
CLASS lcl_event_receiver DEFINITION.
* event receiver definitions for ALV actions
PUBLIC SECTION.
CLASS-METHODS:
* Tool bar
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object
e_interactive,
ENDCLASS.
* Implementation
************************************************************************
* Every event handler that is specified below should also be set after
* the object has been created. This is done in the PBO processing.
* with the following command
* SET HANDLER oEventreceiver->handle_toolbar FOR o_Alvgrid.
************************************************************************
CLASS lcl_event_receiver IMPLEMENTATION.
* create the relevant buttons on the toolbars
METHOD handle_toolbar.
* This method handles the user interaction with the tool bar.
CASE w_action.
WHEN 'SELECT'.
*========================
REFRESH i_toolbar.
*Drilldown Totals Level '&AUF'
*Calculate Average '&AVERAGE'
*Back '&F03'
*ABC Analysis '&ABC'
*Call Sequence '&BEBN'
*Seagate Info Batch Processing '&CRBATCH'
*Seagate Info Web Processing '&CRWEB'
*Line Items '&BEB1'
*Master Data '&BEB2'
*More Calls '&BEB3'
*Call Report '&BEB9'
*Extended Storage of SAPQuery '&XINT'
*XXL '&XXL'
*Check Entries '&CHECK'
*Columns Invisible '&COL_INV'
*Optimize columns '&OPTIMIZE'
*Current Variant '&COL0'
*Save Data '&DATA_SAVE'
*Delete Filter '&DELETE_FILTER'
*Deselect All Rows '&SAL'
*Choose Detail '&DETAIL'
*Exclude all Grid Functions '&EXCLALLFC'
*CrystalReportsTM (Export with Data) '&CRDATA'
*Crystal Reports (TM) ( Start Designer) '&CRDESIG'
*Crystal ( Templ ). '&CRTEMPL'
*MicrosoftTM Database File '&MDB'
*Additional Query Functions '&EXT'
*F4 '&F4'
*Filters '&FILTER'
*Find '&FIND'
*Freeze to Column '&CFI'
*Graphic '&GRAPH'
*Help '&HELP'
*HTML download '&HTML'
*Information '&INFO'
*Read Variant '&LOAD'
*Local: Append Row '&LOCAL&APPEND'
*Local: Copy '&LOCAL©'
*Local: Copy Row '&LOCAL©_ROW'
*Local: Cut '&LOCAL&CUT'
*Local: Delete Row '&LOCAL&DELETE_ROW'
*Local: Insert Row '&LOCAL&INSERT_ROW'
*Local: Move Row '&LOCAL&MOVE_ROW'
*Local: Paste '&LOCAL&PASTE'
*Locally: Paste new Row '&LOCAL&PASTE_NEW_ROW'
*Undo '&LOCAL&UNDO'
*Maintain Variants '&MAINTAIN'
*Maximum '&MAXIMUM'
*Minimum '&MINIMUM'
*Export Local File '&PC'
*Print '&PRINT'
*Print Backend '&PRINT_BACK'
*Print Preview '&PRINT_BACK_PREVIEW'
*Refresh '&REFRESH'
*Report/Report Interface '&REPREP'
*Save Variant '&SAVE'
*Select All Rows '&ALL'
*Send '&SEND'
*Separator '&&SEP'
*Sort '&SORT'
*Sort in ascending order '&SORT_ASC'
*Sort in descending order '&SORT_DSC'
*Subtotals '&SUBTOT'
*Total '&SUMC'
*Export Office '&ML'
*Export Reporting Tree '&SERP'
*Unfreeze Columns '&CDF'
*View Change '&VIEW'
*Crystal Preview Inplace '&VCRYSTAL'
*Excel Inplace '&VEXCEL'
*Grid Control '&VGRID'
*Word processing '&AQW'
PERFORM f9801_toolbar_create USING: '3' '' '' '' '' '',
'0' 'FCODE' icon_modify
text-006 '' '',
'0' 'RFBACK' icon_arrow_left
text-007 '' ''.
LOOP AT i_toolbar INTO w_toolbar.
APPEND w_toolbar TO e_object->mt_toolbar.
ENDLOOP.
WHEN OTHERS.
REFRESH i_toolbar.
PERFORM f9801_toolbar_create USING: '3' '' '' '' '' '',
'0' 'FCODE' icon_checked
text-008 '' text-005.
LOOP AT i_toolbar INTO w_toolbar.
APPEND w_toolbar TO e_object->mt_toolbar.
ENDLOOP.
ENDCASE.
ENDMETHOD.
FORM f9801_toolbar_create USING value(pbuttontype)
value(pfunction)
value(picon)
value(pquickinfo)
value(pdisabled)
value(ptext).
* If the user clicks on the default button ALV raises
* directly event BEFORE_USER_COMMAND
* (then USER_COMMAND, AFTER_USER_COMMAND).
CLEAR w_toolbar.
MOVE : pfunction TO w_toolbar-function,
picon TO w_toolbar-icon,
pquickinfo TO w_toolbar-quickinfo,
pbuttontype TO w_toolbar-butn_type,
pdisabled TO w_toolbar-disabled,
ptext TO w_toolbar-text.
APPEND w_toolbar TO i_toolbar.
ENDFORM. " f9801_toolbar_create
‎2007 Feb 21 10:49 AM
i did not get your answer send me exct lines needed for that point only
‎2007 Feb 21 11:02 AM
U need to add these whole code u have to choose the function code from the list which I have provided pass the saem in the perform.
Reward if u find helpful.