GUI-status disable button?

Hi,
How to disable an button on my gui-status MAIN?
tnx.

Hi,
You can use the following command:
DATA: it_buttons TYPE STANDARD TABLE OF sy-ucomm,
          wa_buttons TYPE sy-ucomm.
wa_buttons = 'SAVE'.
APPEND wa_buttons TO it_buttons.
SET PF-STATUS 'ABC' EXCLUDING it_buttons.
Screen will have the button disabled having F-CODE 'SAVE'.
Regards,
Kunjal

Similar Messages

  • How to get GUI Status(Push Buttons) in ALV Report

    Hi Friends
    I have a requirement in a way that:
    Once selection-screen was processed,an ALV report has to come and above the ALV List,I need a custom GUI Status(4 Push Button) with Push Buttons Logic.
    Once I had clicks on thesse push button,I need to display one more ALV List and above this List,again I need a custom GUI Status(2 Push Buttons) with Push Buttons Logic.
    Can anyone throw some light how we can achieve this.
    Thanks for your cooperation!
    Regards,
    Madisetty

    data: rt_extab type slis_t_extab,
            g_ucomm like sy-ucomm ,
            g_selfield type slis_selfield.
    form alv_display .
      call function 'REUSE_ALV_LIST_DISPLAY'
         exporting
         i_callback_program             = g_repid
         i_callback_pf_status_set       = 'PF_STATUS'
         i_callback_user_command        = 'USER_COMM'
           it_fieldcat                    = it_fldcat
          tables
            t_outtab                       = it_final1
      perform pf_status using rt_extab.
      perform user_comm using g_ucomm g_selfield .
    endform.  
    form pf_status  using    p_rt_extab.
      set pf-status 'PF_STATUS' excluding p_rt_extab.
    endform.
    form user_comm  using    p_ucomm like sy-ucomm
                             p_selfield type slis_selfield.
      data: l_row type i.
      case  p_ucomm.
        when 'DISPLAY_PO'.
          loop at it_final1 into wa_final1.
            if wa_final1-sel eq 'X' .
              l_row = l_row + 1.
            endif.
            if l_row gt 1.
              message e004.
            endif.
            clear wa_final1.
          endloop.
          p_selfield-fieldname = 'SEL'.
          read table it_final1 into wa_final1 index p_selfield-tabindex .
          set parameter id 'BES' field wa_final1-ebeln.
          call transaction 'ME23N'.
      endcase.
    endform.
    *create user interface for gui status by double clicking on 'PF_STATUS'.
    *Check the above sample code .

  • Desactivate standard buttons in GUI Status

    We are looking to desactivate these standard buttons in the gui status.
    Button 1: Creates new session
    Button 2: Generates a shortcut on the desktop
    Button 3: Help
    Button 4: Customizing of local layout
    We thing that these buttons are set automaticaly by SAP. Is there a way to desactivate them. (SAP version 4.6C)
    Help Required,
    Best regards.

    Hello Daniel,
    It is not possible to do that. The reason is that these buttons are a part of the SAPGUI. They don't come from the application server - i.e., they don't have any function codes as such. So you wouldn't be able to disable them.
    Regards,
    Anand Mandalika.

  • DISABLE button(FCODE) from the GUI-Status

    Hi people,
    Can anyone help me out with this... I need to manipulate the PF-STATUS and 'DISABLE' some of the buttons. I am already using the
    'SET PF-STATUS 'STATUS_100' EXCLUDING lt_off_commands.' but instead of hiding the buttons I would rather diable them so that they are visible on the toolbar but could not be used.
    TIA,
    ZAM

    Hello ZAM,
    There's a standard way to do that. When you Create / Edit a GUI status in the Menu Painter, you can choose whether you want the disabled function codes to be hidden or to be displayed as grayed out.
    Follow the menu path <i><b>Goto>Attributes>Pushbutton Assignment</b></i>. You will get a pop-up with three options. The default option is <i><b>Hide all</b></i>. Just choose <i><b>Display all</b></i> on this pop-up and activate the GUI status. Your functionality is achieved.
    If this helps, please reward the points and close the thread. Otherwise, please get back with the problem you might be facing in doing so.
    Regards,
    Anand Mandalika.

  • Disabling Gui status buttons

    Hello,
    I made some researchs and asked some colleagues but I have a problem. I would like to disable a gui status button (to grey it out),
    I used this:
    SET PF-STATUS 'STATUS_0200' EXCLUDING lt_fcode.
    adding the name of my button but the only thing it does is making it disappeared (It is a toggle button between modify and display).
    Is there any suggestions to just grey out the button and not removing it?
    Thank you!

    Nabheet: I want the toggle button to be disabled on the screen.
    anurodh_t: I want to disable it on specific occasions because I am giving access, by authority check, to some people only to use it. The reason why I want to keep the button shown is because I want people to know that, yes, it is indeed possible to modify the fields in my screen but no, they can't do it because they don't have access. Making it disappear would only show, to my opinion, that the possibility might not even exist. Though, someone with the access will have that same button enabled, of course. That is why I want it grey out when not having access. To answer your second questions, I unfortunately haven't seen it yet. Though, I thought it was because of my young experience in SAP (I started at beginning of september).
    Thank you for giving me some feedback and I'm sorry if my explanation wasn't clear enough. If I forgot to give important details, please, let me know. Like I said, I am still young on SAP so sometimes, I am not always sure what is important to know or not
    Take care!

  • Add Button to GUI STATUS Application toolbar

    Hi,
    I have to add a button in the application toolbar of a gui status. I have done that many times before, but I never got into trouble like this time....
    When I open the Gui status and the tree for the application toolbar, I can see already set buttons. When I now click on change (a modification warning comes) and press the plus-icon, it is possible to enter a new item. But everything I´m typing, I get the message Function code XXXX has not been assigned to a function key. I have never got this before....
    When I now go to SE41 and enter a new function key, I can´t use it either afterwards as a button in the application toolbar.
    In the tree of the function keys, I can´t change anything...
    What can I do here? The program name is SAPMZLCG, so it has been modified sometimes. But how can I change the GUI STATUS now to add a new button?
    Thank you!

    You need to goto the application toolbar and the add your text to the items and click below the text you will get one popup which will ask for static text and dynamic text. select statictext and then add all the information like text name and if you want to add an icon you can do it aswell. the there will be another popup for fuction attributes where you will be able to find some options loke fuction types and reaction need to select all that and then click on the ok button and save check and activate the same and after that activate and check whether the button is visible or not. once the button is visible then you need to check for the ok_code and sy_ucomm and then insert the fuctionality of the button.
    I hope this might solve your problem.

  • Disable Head Menu In GUI STATUS

    Hello everyone,
    i have a gui-status that has a menu (with several options within it) and application toolbar.
    Im looking for a way to disable/remove the menu only , I know that the options within it can be disabled using EXCLUDE fcode but the menu header (The name we press  is not assigned to an fcode apparently and thus cannot be disabled using the exclude option.
    thanks in advance,
    Eli Erenburg, Israeli Navy

    Hi,
        Actually there is no need to SET PF-STATUS in PAI in WHEN 'SWITCH' code as once it goes to PBO module it will again set PF-STATUS EXCLUDING 'SAVE' all the time.
    So you have to change the PBO Module logic as follows,
    MODULE PBO OUTPUT.
    IF <your condition>.
    SET PF-STATUS 'GS_100'.
    ELSE.
    SET PF-STATUS 'GS_100' EXCLUDING 'SAVE'.
    ENDIF.
    ENDMODULE.
    and then remove the SET PF-STATUS statements from
    SWITCH_EDIT_MODE subroutine..
    Best way is to set a flag (a global variable) in SWITCH_EDIT_MODE and use it in PBO instead of go_grid->is_ready_for_input..
    Some thing like the following,
    in your SWITCH_EDIT_MODE routine,
    IF gv_edit EQ 'X'.
    CLEAR gv_edit.
    ****other code here to disable grid
    ELSE.
    gv_edit = 'X'.
    ****other code here to enable grid
    ENDIF.
    In your PBO module,
    MODULE PBO OUTPUT.
    IF gv_edit EQ space.
    SET PF-STATUS 'GS_100'.
    ELSE.
    SET PF-STATUS 'GS_100' EXCLUDING 'SAVE'.
    ENDIF.
    ENDMODULE.
    Hope this helps..
    Regards

  • Gui status standard - new button

    Hi gurus,
    I have added a new button to a standard gui status: 0101 of function group CEI0. Everything seems ok, but when I start the transaction (CU50) I can't see the new button. Should I do some other operation to see the modification I have done?
    Thanks a lot
    Guido

    Hi
    It should be a gui for a popup, I don't believe It can deactive your new functions at runtime, but try to check what's happens as soon as that gui is set in PBO.
    Max

  • Hide all buttons in a GUI-STATUS ?

    I'd like to hide all functions from the toolbar of a GUI-STATUS except for one function.
    I could of course create a table with all the FCODE except for the one and then call
    SET PF-STATUS 'bla' EXCLUDING itab.
    But whenever I add a function to the GUI-Status then, I have to change that code. Is there a way to prevent this.

    Hello Daniel,
    Looking at the responses that your question has got, I wouldn't say that I had understood the question as well as
    the others have.
    I understand that you want to be able to dynamically add and delete the Functions from your toolbar. But what I did
    not quite understand is what exactly you had meant by "...I have to change that code....". If you want to perform an
    action, you would have to write some code anyways. So here's what I would do:
    1. Define a GUI-STATUS which has all the function codes you will ever need during the program.
    2. You can manipulate the Buttons on the toolbar with the EXCLUDING option.
    3. I don't believe that you need to use the FM RS_CUA_GET_STATUS_FUNCTIONS. Consider using instead the ABAP statement GET PF-STATUS. The Online Documentation has explained this statement wonderfully.
    4. I don't think that creating a database table to merely maintain the FCODEs of a program is a sensible option either.
    Instead consider using an internal table of constants, where you have all the FCODES required.
    I hope these points would clarify some of the things. If you need further assistance, please get back.
    Regards,
    Anand Mandalika.
    P.S. Two points that I would like to remind you:
    a). You can use the statement SET PF-STATUS SPACE to reset all the PF-STATUS.
    b). Once you set a PF-STATUS, it will be available till the moment you use the next SET PF-STATUS statement.

  • Disabling the function keys in GUI status

    Hi Experts,
                    I want to disable/hide the function keys in the gui status based on some condition in a module pool.Please tell me how to achieve that.
    Regds
    Abbhishek

    Hi Abhishek,
    Please check the follwoing links to enable/disable function keys in module pool.
    [http://www.saptechies.com/pf-status/|http://www.saptechies.com/pf-status/]
    [http://www.sap-img.com/abap/common-used-of-dialog-screen-for-display-change-delete.htm|http://www.sap-img.com/abap/common-used-of-dialog-screen-for-display-change-delete.htm]
    [http://sapabap.iespana.es/sap/tips/dinamically_set_pfstatus.htm|http://sapabap.iespana.es/sap/tips/dinamically_set_pfstatus.htm]

  • Creating a cascading menu button an a GUI status

    I have a GUI status on a normal screen (NOT on an ALV grid).  On this status I have added 3 function buttons (SEARCH, CREATE, MANAGE).  I want to add a 4th button that appears and acts like a cascading menu button. An example of what I want the button to look like is similar to what you would see on the standard 'Change Layout' button on an ALV Grid.  I am not using an ALV grid, though - but I'm trying to get a button on the GUI status to act like that - where you click on it and you see multiple options such as Display, Edit, Copy.
    I don't want to add this to my MENU bar.  I'm trying to add it to my APPLICATION bar.  If anyone has ever done this, please let me know how you did it.
    Thank you for any helpful information.
    -P. Foley

    I think that is done with the "toolbar" control so it will be in the screen, not on the application bar... have a look at SAPTOOLBAR_DEMO1, and the CTMENU_* programs, plus
    http://help.sap.com/saphelp_sm32/helpdata/en/8f/bcc23657ad0730e10000009b38f839/frameset.htm
    for more info on this, if it is the style you want.
    Or perhaps look at Generic Object Services to add a button between the application bar and below the menu (as in ME23N, FB03 etc)
    Jonathan

  • GUI update problem: button take time to be disabled

    I have a Stop button. In the actionPerformed() method for the button, I disable the button and also some other buttons (using setEnabled(false)) then there are some other codes that include Thread.sleep() method. Then again I enable some other buttons. Problem is the Stop button take time to be disabled. The time exactly equals sec provided in the sleep() method. I tried by puting the button disabling buttons' code in another thread that is called from SwingUtilies.invokeLater() method just before the sleep() method. It is very important to disable some buttons before Thread.sleep() is called. And only after the sleep() method I can enable some other buttons.
    Please help me.

    Hello Experts! I can't hear you. 1) Swing related questions should be posted in the Swing forum
    2) Quit bumping your question, you only posted it 30 minutes ago. People will answer when they have the time.
    Your code in the actionListener needs to be executed in a separate Thread, so that when you invoke the "sleep" method the separate Thread sleeps, not the Event Thread.

  • Any ideas for GUI status manipulation?

    Hi All,
    I have a requirement with me, which I'm not able to figure out how to achieve. Here goes:
    There's a transaction in ERP system (CO11N) which was originally not designed (it seems) to be used with CALL TRANSACTION kind of way. But now a requirement is to call it that way... I guess I can do that anyway by passing the SET PARAMETER for the key input fields...
    But there's also another requirement that when calling the transaction this way, make sure two of the application toolbar buttons should be disabled. And they should be enabled when the transaction is called directly from the command bar (as /nCO11N).
    I don't have any set/get parameters to check for and disable/enable the GUI status Fcodes with it...
    Can someone please give me some pointers as to how this can be achieved?
    Thanks in advance!
    Mithun.

    Hello Jonathan,
    Thanks a lot for the quick tip.
    I thought of this technique as well... But then figured that using this 'export to memory' technique is not a very recommended way...
    Thus I want to keep this way as a last resort for the time being... But would like to know if there is any better way to achieve the same effect without using the shared memory sort of technique.

  • Can anyone tell me how to use GUI status in ALV report.

    Can anyone tell me how to use GUI status in ALV report. I want to use  buttons in ALV report.

    Juheb,
    see the link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    Adding a button on the ALV grid using OOPs
    check these sites.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
    chk this.
    alv-pfstatus:
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
    then how to capture that button click.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
    REPORT ZTESTALV.
    TYPE-POOLS: SLIS.
    *- Fieldcatalog
    DATA: IT_FIELDCAT  TYPE LVC_T_FCAT,
          IT_FIELDCAT1  TYPE SLIS_T_FIELDCAT_ALV..
    *- For Events
    DATA:IT_EVENTS TYPE SLIS_T_EVENT.
    DATA:  X_FIELDCAT  TYPE LVC_S_FCAT,
            X_FIELDCAT1  TYPE SLIS_FIELDCAT_ALV.
    DATA:X_LAYOUT TYPE LVC_S_LAYO.
    "{ FOR DISABLE
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    "} FOR DISABLE
    DATA: BEGIN OF IT_VBAP OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
       <b>   BUTTON(10),</b>
         END OF IT_VBAP.
    DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
    SELECT VBELN
           POSNR
           UP TO 10 ROWS
          INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
          FROM VBAP.
    DATA:L_POS TYPE I VALUE 1.
    CLEAR: L_POS.
    L_POS = L_POS + 1.
    <b>X_FIELDCAT-SELTEXT = 'Button'.
    x_fieldcat-fieldname = 'BUTTON'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-OUTPUTLEN = '10'.
    X_FIELDCAT-style = X_FIELDCAT-style bit-xor
                      cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
                      cl_gui_alv_grid=>MC_STYLE_ENABLEd.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.</b>
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'VBELN'.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '10'.
    x_fieldcat-ref_field = 'VBELN'.
    x_fieldcat-ref_table = 'VBAK'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'POSNR'.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '5'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    "{FOR DISABLE HERE 6ROW IS DISABLED
    SY-TABIX = 6.
    LS_EDIT-FIELDNAME = 'VBELN'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 10.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    *LS_EDIT-FIELDNAME = 'POSNR'.
    *LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    *LS_EDIT-STYLE2 = SPACE.
    *LS_EDIT-STYLE3 = SPACE.
    *LS_EDIT-STYLE4 = SPACE.
    *LS_EDIT-MAXLEN = 6.
    *INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE .
    X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
    "} UP TO HERE
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
        I_CALLBACK_PROGRAM = SY-REPID
        IS_LAYOUT_LVC      = X_LAYOUT
        IT_FIELDCAT_LVC    = IT_FIELDCAT
      TABLES
        T_OUTTAB           = IT_VBAP[]
      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.
    Don't forget to reward if useful....

  • GUI status in OOPS in ALV

    Hi Gurus,
      Am developing the ALV report in OOPS. In that report am displaying 2 grids one after the other. My problem here is am getting the tool bar separately for the 2 grids. So i disabled the tool bar for two grids in layout. And i copied the standard gui status SLVC_FULLSCREEN into that report. Now am getting the tool bar. But i did nt get the button events. The buttons are clickable but the functionality is not doing. How to get the functionalites for the ZSLVC_FULLSCREEN. Please guide me some suggestions how to copy the functionalites for those.
    Points will be awarded
    Thanks
    Ravi

    check the all function codes of the buttons in ZSLVC_FULLSCREEN GUi status
    and write u r functionality in your progrm in at user-command subroutine.
    case sy-ucomm.
         when 'xxx'
               do something.
         when 'yyy'
               do something.
    endcase.

Maybe you are looking for