Handling the Standard Toolbar Button click of an ALV

Hi Experts,
I have created an ALV grid output using CL_GUI_ALV_GRID with standard buttons(default) on the toolbar. When I click on any of these standard buttons, say '+' button to insert records, my custom program is not hit.
I know there is a protected event 'TOOLBAR_BUTTON_CLICK' which I tried to handle in my program but it did not work. However, I am able to handle the public event 'DOUBLE_CLICK' of the same class 'CL_GUI_ALV_GRID'.
So..can anyone tell how to handle this protected event OR how to handle the STANDARD buttons on ALV toolbar so that they hit my custome code.
Thanks very much.
Regards,
Rudresh

Hello Rudresh
The point is to "re-define" the standard ok-codes of toolbar buttons:
" Make toolbar interactive
CALL METHO go_grid->set_toolbar_interactive( ).  " raises event TOOLBAR
" Event handler method
METHOD handle_toolbar.
* define local data
  DATA: ls_button    TYPE stb_button.
" Redefine function code
  LOOP AT e_object->mt_toolbar INTO ls_button
                  WHERE ( function = cl_gui_alv_grid=>MC_FC_LOC_INSERT_ROW ).
    ls_button-function = 'MY_FCODE'.  " triggers USER_COMMAND
    MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
  ENDLOOP.
ENDMETHOD.
Regards
  Uwe

Similar Messages

  • MODIFYING THE STANDARD TOOLBAR

    HI,
    How can I modify the standard toolbar buttons? is this contained in the mmb or a different file?
    thanks

    Hello,
    <p>Download the corresponding .mmb files:<br>
    menudef.mmb<br>
    menudefs.mmb<br>
    Then you can open them in the menu editor and apply the changes needed.</p>
    Francois

  • How to code in the standard refresh button in ALV toolbar

    Hi Experts,
    My ALV includes some standard toolbar buttons like refresh, select all, sort, and etc. How can I put logic into the refresh button such that when user click on the refresh button, I want to run some logic on my own?
    THanks in advance.

    Hi again,
    1. Further to my previous reply
    2. This code will make it clear.
    3. just copy paste
    a. Before that, copy the SALV Standard Toolbar to ABCD as suggested before.
    <b>Important & Relevant code has been marked in bold.</b>
    4.
    report abc.
    type-pools : slis.
    Data
    data : itab like t001 occurs 0 with header line.
    DATA : fc type SLIS_T_FIELDCAT_ALV.
    Logic
    select * from t001 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            = fc
      EXCEPTIONS
        INCONSISTENT_INTERFACE = 1
        PROGRAM_ERROR          = 2
        OTHERS                 = 3.
    Display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             =  SY-REPID
    <b>   I_CALLBACK_PF_STATUS_SET       = 'MYSTATUS '</b>
    <b>   I_CALLBACK_USER_COMMAND        = 'MYFORM'</b>   IT_FIELDCAT                    = FC
      TABLES
        T_OUTTAB                       = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                  = 1
       OTHERS                         = 2
    <b>
    IMPORTANT
    This sets the PF Status on ALV Screen
    And not Selection screen
    FORM MYSTATUS USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ABCD'.
    ENDFORM.                    "MYSTATUS
    IMPORTANT
    When Fcode is pressed on ALV Toolbar
    FORM MYFORM USING r_ucomm LIKE sy-ucomm
                                       rs_selfield TYPE slis_selfield.
      IF R_UCOMM = 'ZREFRESH'.
    *----CODE
      ENDIF.
    ENDFORM.                    "MYFORM</b>
    regards,
    amit m.

  • How to deactivate the standard toolbar 'print' button

    Dear Expert,
    I want to deactivate the standard toolbar print's button in the smartform print preview screen.
    Could you explain and give me some sample code ?  Thanks !

    For details of how to restore it, see the [[menu bar is missing]] article.

  • How to hide the standard save button

    Hi gurus,
    I am using the javascript below in my BPS Web Ap to perform a check function on save.  The Javascript runs the check function and then simulates the pressing of the standard save button.  It works fine.
    My problem is that I now need to hide the standard Save button as I don't want users to press it, just my code.  But there is no option in the application builder to hide those standard buttons.
    Is there some other way I can hide it?  Or is there some way I can perform the save from JavaScript without having to have a Save button?
    Cheers,
    Tristan
    <script type="text/javascript">
        function CheckAndSave()
                if (bspSubmit('FunctionButtonPerformCheck'))
                        bspSubmit('SaveButton1')
    </script>
    <span>
        <a href="#1" class=urBtnStd onClick="javascript:CheckAndSave();"
            <nobr>
                New Save
            </nobr>
        </a>
    </span>

    Hi,
    If you have created your layout using transaction BPS_WB then you can hide the SAVE button.
    Cheers,
    Gimmo

  • How to restore the Standard Toolbar,that I deleted by mistake?

    I was trying to remove some toolbars, by accident I removed the standard toolbar(view,edit,etc) I can not bring it back, what can I do?
    Thanks.

    For details of how to restore it, see the [[menu bar is missing]] article.

  • Should  Standard Toolbar FIND work on an ALV within a custom container ?

    I have an ALV in a custom container on a screen.
    The FIND and FIND NEXT of the ALV toolbar work fine against the grid.
    Should the FIND and FIND NEXT of the standard toolbar also work against the ALV if they are "activate" in the GUI status?
    If so, what do I call/execute in response to the "FIND" ok-code?
    I've tried calling  the function ALV_POPUP_TO_SEARCH2 and the popup comes up, but it doesn't do anything.
    Please advise at your earliest convenience.
    Thanks
    djh

    Hi Rich,
    Absolutely.  Especially as they can paint the picture, and then blame the techies when their fiction is exposed.
    Similarly, we had a situation where the Expense Report WD was failing, and the functional person ensured that everyone knew it was a technical problem and therefore my fault (with SAP as the popular co-conspirator). 
    Sadly the message above the Java stack messages was "No entry in table T706Z  for argument ' '".  Had the functional check their config and all was well.  No one apologised though......
    Last week at a different site the same thing happened (this time with TA20C) but the funky took one look at it and reviewed their config to solve - so they're not ALL the same.
    Cheers
    Gareth

  • How  to add a button to the Standard Toolbar in ALV ?

    Hi All,
          If i add a button it should be displayed along with
          the  standard icons of the toolbar.
          Plz guide me.
          Thx in advance.

    Hi Albert.
    You need to do a few things for that :
    - Create your own GUI status by copying STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN.
    - Set your own PF-Status using the Exclude table because otherwise your exclude table would become meaningless.
    - define a subroutine to handle the user commands.
    Sample implementation :
    FORM pf_status USING extab TYPE slis_t_extab.
      extab = pf_exclude.   
      SET PF-STATUS 'STANDARD' EXCLUDING extab.       
    ENDFORM.                    "PF_STATUS
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'PF_STATUS'
          is_layout                = layout
          it_fieldcat              = fieldcat
          it_excluding             = pf_exclude
        TABLES
          t_outtab                 = itab
        EXCEPTIONS
          OTHERS                   = 0.
            FORM user_command  USING r_ucomm LIKE sy-ucomm
                                       rs_selfield TYPE slis_selfield.
    ENDFORM.
    Please reward points if found helpful.

  • Is there any way to default to the Bookmarks Toolbar when clicking on the Bookmarking star in the Address Bar?

    When adding a bookmark by clicking the star in the address bar, the bookmark automatically goes to the Unsorted Bookmarks folder, is there any way it can automatically go to the Bookmarks Toolbar? This is a minor inconvenience.

    Try:
    *Add Bookmark Here 2: https://addons.mozilla.org/firefox/addon/add-bookmark-here-2/

  • Activating and deactivating icons in the Standard toolbar

    Hi expects,
    I want to activate the printing icon on my standard toolbar cause it is greyed out. How can I achieve that?

    Hi
    U need to assign an OK-CODE to print icon in the toolbar, but if it's a standard one, it means to change a standard object.
    Then u should considere after activing it u need to implement the abap code to manage it
    Max

  • All the Google toolbar buttons(other then print) are not visible after installing Firefox 4

    Google toolbar buttons (other then print) are not visible after installing Firefox 4 for Mac.

    Yes - there is a fix... called IE9... http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages

  • POWL WD: No action has been triggered after toolbar button click

    Hi,
    I am using standard SAP Web dynpro application POWL for creating Service entry sheet from PO.
    On the toolbar we have buttons 'Create Service Entry Sheet', 'Display Service Package', 'Document tracing'.
    When I click on the row with the corresponding PO and then click on above mentioned buttons nothing happens, I can see at the taskbar : javascript:Void(0), which probably means that no action has been attached to that button.
    I have debugged the WD, seems to be OK, perhaps I am missing some configurations, because I've already traced my authorizations and they are OK
    What could be the problem ?
    Please advise !
    Thanks,
    Stefan
    Edited by: Stefan Kolev on Mar 6, 2012 2:56 PM

    Haven't gotten any response on this post and I really need to resolve this issue. Anyone can help??
    Eric.

  • All of a sudden, if I go to the Bookmarks Toolbar and click on a site, the sit appears in the Sidebar, not in a tab. How do I fix this?

    I was browsing today, and noticed that my Bookmarks Sidebar was missing. I got it to reappear, but now when I try to open a bookmarked site, the site will appear in the narrow space once where the bookmarks were. Any idea as to what happened and what I can do to fix it? I have an iMac, running OSX 10.5.8.

    Opening in the side bar is the default for bookmarks that are created via a link or button on a website.<br />
    You can check the Properties of a bookmark via the right-click context menu in the side bar (Ctrl+B; Cmd+B on Mac).<br />
    In the Bookmarks Manager (Bookmarks > Show All Bookmarks) you can click the More button in the Details pane at the bottom right.<br />
    Make sure that "Load this bookmark in the side bar" is not selected.<br />

  • How to close the browser on button click?

    Hi,
    On a HTML page, I have a button labeled as "Close". When user click the button, I want to close the browser. I am using Apex 4 with 10g.
    I created the following process which I call on pressing the close button:
    BEGIN
    htp.p('<body>');
    htp.p('<script type="text/javascript">');
    --htp.p('window.opener.doSubmit();');
    htp.p('window.close();');
    htp.p('</script>');
    htp.p('</body>');
    END;But it shows the below in the browser instead of closing it.
    Location: f?p=17638:9:3591448756041585::NO
    Any wayout?
    Thx

    For popup windows I use button code / javascript such as this.
    The self function refere to the correct window, while window.close my be connected to the wrong (parent) window.
    input type="button" value="Cancel" onclick="self.close();"  id="CANCEL"Edited by: Sven W. on May 26, 2011 2:46 PM

  • Close the Window on Button Click.

    please can someone help.
    I am trying to close the window in which my 'Exit'button is defined.
    For this I am using:
    button.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         //dispose();
    But the window still doesnt close,till I click on the 'X' icon.

    action{
    if(e.getSource() == myButton){
    jframe.setVisible(false)
    // possibly jframe.dispose() depending on what you are trying to do
    //if you are tying to exit the program all together
    System.exit(0);
    }http://mindprod.com/jgloss/close.html
    xpost
    http://forum.java.sun.com/thread.jspa?threadID=764106&tstart=0

Maybe you are looking for

  • Using text select tool in Preview--pasting into Word

    Hi, since the recent updates made Acrobat Pro 7 unusable (installer crashes, Acrobat crashes upon displaying title bars . . . I've posted on this elsewhere), I have been using Preview. I noticed that when I select and copy a piece of text in Preview

  • How do I submit a form to a LC process using the process fields component in LC Designer

    I have a PDF Form with the Process Fields component attached.<br /><br />In the FSSubmit component, I have set the URL to <br />http://localhost:8080/soap/services/SAPS_Submission?wsdl, <br />where SAPS_Submission is the name of my process.<br /><br

  • How to use Parameter from file in window env

    hi All, Please tell me the how I can get Parameter from Saved file and can use in other file. EX: I want to use Password file for each instance like ORCL-manager ORCL_1-tiger ORCL_2-***** how to call this file in other file. using pasword for instanc

  • Help with accessing MC within a  dynamically load MC

    I'm developing a website for school and in an effort to make it eaier to update i'm attempting to make it as dynamic as possible.  So far I've been able to load in MC's dynamically.  These MC's banners are made up of smaller MC's themselves.  When th

  • CAN 8473 Not working with Test Panel in Max

    Hello all.  I am working with a USB-8473s CAN unit.  I have it connected to the bus and can see the can traffic through the bus monitor. So everything is working properly there.  I am trying to send a certain message so I set up a message and channel