How to remove a Sort button from ALV List
Hi Experts,
How to remove sort button from ALV List.
I have requirement where I need to remove the sort button from ALV list.
Kindly give me useful clues.
Higher points will be awarded for the useful inputs.
Thanks in Advance,
Dharani
Hi dharani,
1. UP and Down Sort Button will get removed.
2. Important code is marked in bold
3. Just copy paste.
4.
report abc.
TYPE-POOLS : slis.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvfcwa TYPE slis_fieldcat_alv.
<b>data : excl type SLIS_T_EXTAB.
data : exclwa type SLIS_EXTAB.</b>
data : begin of itab occurs 0.
include structure usr02.
data : end of itab.
START-OF-SELECTION.
select * from usr02
into table itab.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
<b>*----
IMPORTANT
fcodes to remove
Up and Down Sort Button
exclwa-fcode = '&OUP'.
append exclwa to excl.
exclwa-fcode = '&ODN'.
append exclwa to excl.</b>
Display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
<b>IT_EXCLUDING = excl</b>
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
regards,
amit m.
Similar Messages
-
ALV . How to remove the sort buttons on toolbar in ALV report?
Hi,experts
As you know, in default case , the alv report will display two sort buttons(ascending ,descending) on its toolbar , So How to remove the sort buttons on toolbar in ALV report?
Thanks for your help .Hi guixin,
1. Before calling REUSE_ALV_LIST_DISPLAY
2. Write this code :
data : excl type SLIS_T_EXTAB.
data : exclwa type SLIS_EXTAB.
exclwa = '&OUP'.
append exclwa to excl.
exclwa = '&ODN'.
append exclwa to excl.
3. Then while calling the FM,
pass this parameter also .
IT_EXCLUDING = excl
It will work fantastic.
regards,
amit m. -
How to remove obsolete oss note from SPAU List
Dear All,
How to remove obsolete oss note from SPAU List. Bocz it having yellow trafic Signal and it is not allowing me to reset to orginal or adopt.
Please tell me how to reolve this problem.Hi,
Please mention the Netweaver release of your system.
Next, if you mention the note is obsolete - the traffic light should be grey.
If its yellow, that means semi-automatic adjustment needs to be made.
If you click on the obsolete greyed out note, you get a message saying the note correction was delivered with upgrade or support package and it could be reset.
If you click on the yellow note, the system would try to reapply the note via SNOTE.
Please try either or the above and let us know the system response.
Regards,
Srikishan -
How to remove the EDIT button from Overview Page
Hi,
I have a overview page for Service Request(SRQM_INCIDENT_H - component). Now, I want to remove the EDIT button from the overview page and want to place it for each assignment block.
I have seen the there is concept calles VIEW_GROUP_CONTEXT. However, I am not sure how exactly I need to apply that and what code and where I need to write.
Please help me.
Thanks,
SandeepHello Sandeep,
we removed in our system a lot of the standard buttons in this overview page like this:
METHOD in IMPL-Class: IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS
Coding example:
CALL METHOD super->if_bsp_wd_toolbar_callback~get_buttons
RECEIVING
rt_buttons = lt_buttons.
CLEAR rt_buttons.
* Alle Buttons außer die genannten werden an RT_Buttons angehängt und damit angezeigt.
LOOP AT lt_buttons INTO wa_buttons.
CASE wa_buttons-on_click.
WHEN 'NEW_FROM_TEMPLATE' OR 'DIV_CREATE_COPY' OR 'AUTO_COMPLETE' OR 'AUTO_SUGGEST_PROBLEM'
OR 'AUTO_SREACH_KNOWART' OR 'SENDEMAIL' OR 'PRINT_PREVIEW' OR 'OUTPUT' OR 'DISPLAY_OBJ_REL' .
* Do nothing
WHEN OTHERS.
APPEND wa_buttons TO rt_buttons.
ENDCASE.
ENDLOOP.
Kind regards
Manfred -
How to remove the select button from the alv grid
Hi,
I am using the Function modules for alv report,
My 1st field in the list is checkbox,
User can select the checkbox for further process.
My problem is I want to remove the standards select option from alv.
I have searched in slis_layout_alv for any option, but I could not.
Please help me.
Regards
RajanHI
Exclude process options from ALV
PERFORM alv_excl. ( g_r_excl TYPE ui_functions . )
FORM alv_excl.
APPEND cl_gui_alv_grid=>mc_mb_sum TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_mb_subtot TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_graph TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_info TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_print_back TO g_r_excl.
ENDFORM. " alv_excl
CALL METHOD g_r_grid->set_table_for_first_display
EXPORTING
is_layout = g_r_layo
is_variant = g_r_variant
it_toolbar_excluding = g_r_excl
i_save = 'X'
CHANGING
it_outtab = g_t_yetprint[]
it_fieldcatalog = g_t_fieldcat.
Options appended in g_r_excl, will be excluded from ALV
Praveen -
How to remove Sync login button from Firefox Start Menu
Tried Sync in the past and didn't like it.
The presence of the button adds to clutter I would rather do without.
So, is there a way to get rid of Sync login button from Firefox Start Menu ?
Regards, etc.If you use userChrome.css then you need to create and chrome folder and the userChrome.css within this folder.
* Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
* Use a plain text editor like Notepad to create a (new) userChrome.css file in this folder (the names are case sensitive)
* Paste the code in the userChrome.css file in the editor window and make sure that the userChrome.css file starts with the default @namespace line
*http://kb.mozillazine.org/Editing_configuration
See also:
*http://mxr.mozilla.org/mozilla-release/source/browser/components/customizableui/content/panelUI.inc.xul -
How to disable self defined button from ALV Toolbar when ok_code ='BACK'
here is the code
CLASS Z_CL_6_U_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLE_TOOLBAR
FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE,
HANDLE_USER_COMMAND
FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS.
CLASS Z_CL_6_U_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_TOOLBAR.
DATA: LS_TOOLBAR TYPE STB_BUTTON.
IF G_FLAG = 'X' and ok_code = space.
CLEAR LS_TOOLBAR.
MOVE 0 TO LS_TOOLBAR-BUTN_TYPE.
MOVE 'UPDATE' TO LS_TOOLBAR-FUNCTION.
MOVE ICON_MODIFY TO LS_TOOLBAR-ICON.
MOVE 'Update Records'(111) TO LS_TOOLBAR-QUICKINFO.
MOVE ''(112) TO LS_TOOLBAR-TEXT.
MOVE ' ' TO LS_TOOLBAR-DISABLED.
APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
elseif ok_code = 'BACK'.
CLEAR LS_TOOLBAR.
LS_TOOLBAR-function = 'UPDATE'.
LS_TOOLBAR-butn_type = 0.
LS_TOOLBAR-icon = ICON_MODIFY.
LS_TOOLBAR-quickinfo = 'Update Records'.
LS_TOOLBAR-disabled = 'X'.
append LS_TOOLBAR TO <i><b>E_OBJECT</b></i>->MT_TOOLBAR.
ENDIF.
ENDMETHOD.
<i><b>ERROR COMES when ok_code is 'BACK'.
at this point E_OBJECT has null reference instead of ref to Class cl_ALV_EVENT_TOOLBAR_SET.</b></i>
tell me why this error coming.
pls helpHello Neetu
To give you an example I have copied sample report BCALV_GRID_DEMO, added some code (search for <b>$Comment</b>) and modified the GUI-status <b>MAIN100</b> (replace function code EXIT with <b>BACK</b> for the F3 function).
Run the program and push several times the BACK button: one toolbar function after the other will be inactivated.
PROGRAM test.
DATA: ok_code LIKE sy-ucomm,
gt_sflight TYPE TABLE OF sflight,
g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
<b>----
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_cnt TYPE i.
CLASS-METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
e_interactive
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_toolbar.
DATA:
ls_button TYPE stb_button.
ADD 1 TO md_cnt. " a simple counter
LOOP AT e_object->mt_toolbar INTO ls_button FROM 1 TO md_cnt.
ls_button-disabled = 'X'.
MODIFY e_object->mt_toolbar FROM ls_button.
ENDLOOP.
ENDMETHOD. "handle_toolbar
ENDCLASS. "lcl_eventhandler IMPLEMENTATION</b>
START-OF-SELECTION.
* MAIN *
SELECT * FROM sflight INTO TABLE gt_sflight.
CALL SCREEN 100.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
* Instantiate ALV grid control
CREATE OBJECT grid1
EXPORTING i_parent = g_custom_container.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = gt_sflight.
<b>*$Comment: Set event handler for event TOOLBAR
SET HANDLER:
lcl_eventhandler=>handle_toolbar FOR grid1.
ENDIF.</b>
ENDMODULE. "PBO OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
* to react on oi_custom_events:
CALL METHOD cl_gui_cfw=>dispatch.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
<b> WHEN 'BACK'.
$Comment: Toolbar can be modified on-the-fly
grid1->set_toolbar_interactive( ).</b>
WHEN OTHERS.
* do nothing
ENDCASE.
CLEAR ok_code.
ENDMODULE. "PAI INPUT
* FORM EXIT_PROGRAM *
FORM exit_program.
* CALL METHOD G_CUSTOM_CONTAINER->FREE.
* CALL METHOD CL_GUI_CFW=>FLUSH.
LEAVE PROGRAM.
ENDFORM. "EXIT_PROGRAM
Regards
Uwe -
How can I remove the Star Button from the Address Bar?
How can I remove the Star Button from the Address Bar? There's no obvious way of doing it. Is there any about:config value related to it?
https://addons.mozilla.org/en-US/firefox/addon/no-star-button/
-
How can I remove Top Sites button from Favorites?
Hi!
How can I remove Top Sites button from Favorites bar?
There is no problem to remove it in previous Safari.
But I cant find how to remove it in Safari 7.0.>>Ok, but they dont have solution.
Correct - there's not been one found so far, that we've seen here, anyway. -
How do I remove old image buttons from Properties panel?
Hi,
I have been working out how to use Image Buttons in Captivate 6 and have created loads which now appear in the Properties Panel.
How do I remove unused image buttons from the Properties Panel?
ThanksHi there
When you look at the Properties panel, you see ALL available images for the buttons. (Assuming that you are referring to to the stock images supplied by Captivate)
Is this the list you are trying to clear?
If so, it's the same list you see with any project Captivate creates.
Cheers... Rick
Helpful and Handy Links
Captivate Wish Form/Bug Reporting Form
Adobe Certified Captivate Training
SorcerStone Blog
Captivate eBooks -
How to remove the time slider from my project and keep only buttons
How to remove the time slider from my project and keep only buttons to interact with my project .
If I understand you correctly, go to the skin editor (Project, Skin Editor in Captivate 4), select the Playback Control tab, uncheck the Progressbar check box. Leave checked the buttons for play/pause, rewind, forward, back, etc.
I hope this helps.
Mister C. -
How do i remove floating home button from iphone 5 please
how do i remove floating home button from iphone 5 please
On some iPhones, the Home button itself stopped working. Mostly on the 3GS and prior. This was due to the fact some customers "man handled" the button all too much.
The newer iPhones has some reinforcements for the button.
KOT -
How to create a radio button in ALV Reports
Hi all,
Best wishes to all..
Kindly reply me to this question... that is "How to create a radio button in ALV Report"
Thanks and Regards
AnjaliHI
here is an example :
PROGRAM ZUS_SDN_BCALV_GRID_DEMO_2.
Based on: BCALV_GRID_DEMO.
TYPE-POOLS: icon.
TYPES: BEGIN OF ty_s_sflight.
INCLUDE TYPE sflight.
TYPES: button1 TYPE lvc_emphsz.
TYPES: button2 TYPE lvc_emphsz.
TYPES: button3 TYPE lvc_emphsz.
TYPES: button4 TYPE lvc_emphsz.
TYPES: END OF ty_s_sflight.
DATA:
gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
gt_fcat TYPE lvc_t_fcat.
DATA: ok_code LIKE sy-ucomm,
gt_sflight TYPE TABLE OF sflight,
g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_cnt TYPE i.
CLASS-METHODS:
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING
e_row_id
e_column_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_hotspot_click.
define local data
FIELD-SYMBOLS:
<ls_entry> TYPE ty_s_sflight,
<ld_fld> TYPE ANY.
READ TABLE gt_sflight ASSIGNING <ls_entry> INDEX es_row_no-row_id.
CHECK ( <ls_entry> IS ASSIGNED ).
Set all radio buttons "unselected"
<ls_entry>-button1 = icon_wd_radio_button_empty.
<ls_entry>-button2 = icon_wd_radio_button_empty.
<ls_entry>-button3 = icon_wd_radio_button_empty.
<ls_entry>-button4 = icon_wd_radio_button_empty.
ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE <ls_entry>
TO <ld_fld>.
IF ( <ld_fld> IS ASSIGNED ).
Set selected radio button "selected".
<ld_fld> = icon_wd_radio_button.
ENDIF.
Force PAI followed by refresh of table display in PBO
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DUMMY'
IMPORTING
RC =
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
MAIN *
PERFORM select_data.
CALL SCREEN 100.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
CREATE OBJECT grid1
EXPORTING i_parent = g_custom_container.
PERFORM build_fieldcatalog.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_fieldcatalog = gt_fcat
it_outtab = gt_sflight.
Set event handler for event TOOLBAR
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR grid1.
else.
CALL METHOD grid1->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
FINISHED = 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.
ENDIF.
ENDMODULE. "PBO OUTPUT
MODULE PAI INPUT *
MODULE pai INPUT.
to react on oi_custom_events:
CALL METHOD cl_gui_cfw=>dispatch.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN OTHERS.
do nothing
ENDCASE.
CLEAR ok_code.
ENDMODULE. "PAI INPUT
FORM EXIT_PROGRAM *
FORM exit_program.
CALL METHOD G_CUSTOM_CONTAINER->FREE.
CALL METHOD CL_GUI_CFW=>FLUSH.
LEAVE PROGRAM.
ENDFORM. "EXIT_PROGRAM
*& Form BUILD_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM build_fieldcatalog .
define local data
DATA:
ls_fcat TYPE lvc_s_fcat,
ls_hype TYPE lvc_s_hype.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'LVC_S_FCAT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DELETE gt_fcat WHERE ( fieldname <> 'EMPHASIZE' ).
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE gt_fcat INTO ls_fcat
WITH KEY fieldname = 'EMPHASIZE'.
IF ( syst-subrc = 0 ).
DELETE gt_fcat INDEX syst-tabix.
ENDIF.
ls_fcat-fieldname = 'BUTTON4'.
ls_fcat-icon = 'X'.
ls_fcat-hotspot = 'X'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ls_fcat-fieldname = 'BUTTON3'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ls_fcat-fieldname = 'BUTTON2'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ls_fcat-fieldname = 'BUTTON1'.
INSERT ls_fcat INTO gt_fcat INDEX 4.
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG
*& Form SELECT_DATA
text
--> p1 text
<-- p2 text
FORM select_data .
define local data
DATA:
ls_sflight TYPE ty_s_sflight.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
ls_sflight-button1 = icon_wd_radio_button.
ls_sflight-button2 = icon_wd_radio_button_empty.
ls_sflight-button3 = icon_wd_radio_button_empty.
ls_sflight-button4 = icon_wd_radio_button_empty.
MODIFY gt_sflight FROM ls_sflight
TRANSPORTING button1 button2 button3 button4
WHERE ( carrid IS NOT INITIAL ).
ENDFORM. " SELECT_DATA
Regards,
Prasanth
Reward all helpful answers -
Hide 'Change Layout' button from alv toolbar
Hello All,
can anyone let me know how can we hide the change layout button or exclude the change layout button from the ALV tool bar using OOPS . what's the fcode for it.
Thank You !
RaviHi Ravi,
Please refer to this [Program|http://www.saptechies.com/disable-some-standard-buttons-from-alv-display/].
Hope this helps.
Regards,
Chandravadan -
Disable some standard buttons from ALV display
Hello All,
I am creating an ALV display using object oriented approach. I know how to exclude some of the standard function buttons from the list.
But suppose instead of deleting, the requirement is to disable (I mean grayed out)
some standard buttons from ALV. Could anyone please comment on how to do this.
Many thanks in advance.
Regards
IndrajitHello Indrajit
The following sample reports shows how to disable toolbar functions. Run the report and the push the ENTER button repeatedly.
*& Report ZUS_SDN_ALV_EVT_TOOLBAR
*& This sample report explains the handling of event TOOLBAR in order
*% to activate or inactive buttons of the ALV toolbar.
*& Based on: BCALV_GRID_DEMO
*& Procedure: Copy BCALV_GRID_DEMO and replace entire coding OR
copy screen '0100' and GUI status 'MAIN100' from
BCALV_GRID_DEMO to this report.
REPORT zus_sdn_alv_evt_toolbar.
TYPE-POOLS: abap, cntb, icon.
DATA:
ok_code TYPE ui_func,
gt_sflight TYPE TABLE OF sflight,
g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
g_grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
PARAMETERS:
p_inact RADIOBUTTON GROUP grp1 DEFAULT 'X', " delete buttons
p_dele RADIOBUTTON GROUP grp1. " inactivate buttons
PARAMETERS:
p_newbut AS CHECKBOX DEFAULT ' ', " add new button
p_newddm AS CHECKBOX DEFAULT 'X'. " add dropdown menu
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-DATA:
md_cnt TYPE i.
CLASS-METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
e_interactive
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_toolbar.
§ 2.In event handler method for event TOOLBAR: Append own functions
by using event parameter E_OBJECT.
DATA:
ls_toolbar TYPE stb_button,
ls_menu type STB_BTNMNU.
E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.
This class has got one attribute, namly MT_TOOLBAR, which
is a table of type TTB_BUTTON. One line of this table is
defined by the Structure STB_BUTTON (see data deklaration above).
A remark to the flag E_INTERACTIVE:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'e_interactive' is set, if this event is raised due to
the call of 'set_toolbar_interactive' by the user.
You can distinguish this way if the event was raised
by yourself or by ALV
(e.g. in method 'refresh_table_display').
An application of this feature is still unknown...
ADD 1 TO md_cnt. " a simple counter
(1.a) Inactivate toolbar buttons
IF ( p_inact = abap_true ).
LOOP AT e_object->mt_toolbar INTO ls_toolbar FROM 1 TO md_cnt.
ls_toolbar-disabled = 'X'.
MODIFY e_object->mt_toolbar FROM ls_toolbar.
ENDLOOP.
(1.b) Delete toolbar buttons
ELSE.
DO md_cnt TIMES.
DELETE e_object->mt_toolbar INDEX 1.
ENDDO.
ENDIF.
(2) Add new button
IF ( p_newbut = abap_true ).
Add separator to separate default and new buttons
CLEAR: ls_toolbar.
ls_toolbar-butn_type = cntb_btype_sep. " separator
APPEND ls_toolbar TO e_object->mt_toolbar.
Add new button "DETAIL"
CLEAR: ls_toolbar.
ls_toolbar-function = 'DETAIL'.
ls_toolbar-icon = icon_detail.
ls_toolbar-quickinfo = 'QuickInfo'.
ls_toolbar-butn_type = cntb_btype_button.
ls_toolbar-disabled = abap_false.
ls_toolbar-text = 'Details'.
ls_toolbar-checked = ' '.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDIF.
(3) Add new dropdown menu
IF ( p_newddm = abap_true ).
Add separator to separate default and new buttons
CLEAR: ls_toolbar.
ls_toolbar-butn_type = cntb_btype_sep. " separator
APPEND ls_toolbar TO e_object->mt_toolbar.
Add new dropdown menu "DETAIL"
CLEAR: ls_toolbar.
ls_toolbar-function = 'DDMENU'.
ls_toolbar-icon = icon_detail.
ls_toolbar-quickinfo = 'QuickInfo'.
ls_toolbar-butn_type = cntb_btype_dropdown.
ls_toolbar-disabled = abap_false.
ls_toolbar-text = 'DD-Menu'.
ls_toolbar-checked = ' '.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDIF.
ENDMETHOD. "handle_toolbar
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
MAIN *
SELECT * FROM sflight INTO TABLE gt_sflight.
CALL SCREEN 100.
END-OF-SELECTION.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
Instantiate ALV grid control
CREATE OBJECT g_grid1
EXPORTING i_parent = g_custom_container.
CALL METHOD g_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = gt_sflight.
Set event handler for event TOOLBAR
SET HANDLER:
lcl_eventhandler=>handle_toolbar FOR g_grid1.
ENDIF.
$Comment: Toolbar can be modified on-the-fly
g_grid1->set_toolbar_interactive( ).
ENDMODULE. "PBO OUTPUT
MODULE PAI INPUT *
MODULE pai INPUT.
to react on oi_custom_events:
CALL METHOD cl_gui_cfw=>dispatch.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN OTHERS.
do nothing
ENDCASE.
CLEAR ok_code.
ENDMODULE. "PAI INPUT
FORM EXIT_PROGRAM *
FORM exit_program.
CALL METHOD G_CUSTOM_CONTAINER->FREE.
CALL METHOD CL_GUI_CFW=>FLUSH.
LEAVE PROGRAM.
ENDFORM. "EXIT_PROGRAM[/code]
Regards
Uwe
Maybe you are looking for
-
Just wanted to know if its possible to password Protect IPhoto on iphone
Just wanted to know if its possible to password Protect IPhoto itself from someone just being able to click on my IPhoto Application and have it opened and be able to see all my photos etc etc or even to password Protect the Events also is this possi
-
Hi, I am having an issue with goods movements.when two people are trying to post goods at the same time one of them is getting an error saysing that the plant data info is blocked by XXXXXXX user. this is happening for the confirmation process. In
-
Is Business Objects and Crystal Reports are the same?
Hi all, What is the difference between crystal reports and business objects. And what is the advantage of business objects. Can anyone let me know the forums for Business objects in SAP. And what is the latest version for business objects. thanxs har
-
Cs4_deployment.pdf broken link
Hi Guys, I have contacted Adobe several times through online, trying to access the cs4_deployment.pdf file that they link to in several of their knowledgebase articles. They have not fixed the broken link and has been like that for over 3 weeks. Howe
-
Error in encoded stream: needed 4 valid base64 characters but only got 3 be
Folks, We are trying to copying a file in to temp directory. But we keep getting this error. Please help.. import java.io.FileOutputStream; myfile = File.createTempFile(atType, fName, new File(FileUtils.getTmpRootDir()));