Display of push button in the application tool bar in an ALV report

Hello everyone,
Query:
Is it possible to display a custom push button in the application tool bar while displaying an ALV report(1st one)?
On pressing this custom push button will I be able to display another ALV report(2nd one) based on the selection made on the current ALV report(1st one)?

Hiii..
I have written a sample code for You
<b>"Call the below FunctionModule For Displaying The List
" And see the bolded line in the Below FunctionModule
" STANDARD_02 and USER_COMMAND are the subroutine Names</b>
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       = 'STANDARD_02'</b>
  <b> i_callback_user_command       = 'USER_COMMAND '</b>
   i_structure_name               =  'ZST_SCARR'
   is_layout                      = is_layout
   it_fieldcat                    = gt_fieldcat[]
  IT_EXCLUDING                   =
  IT_SPECIAL_GROUPS              =
  IT_SORT                        =
  IT_FILTER                      =
  is_sel_hide                    = is_sel_hide
  I_DEFAULT                      = 'X'
  I_SAVE                         = ' '
  IS_VARIANT                     =
   it_events                      = e03_lt_events[]
  IT_EVENT_EXIT                  =
  is_print                       = t
  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                       = it_scarr
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 PF_STATUS_SET
<b>" Here Set A Button In Application Toolbar Using PF- Status</b>
FORM standard_02 USING  extab TYPE slis_t_extab.
  SET PF-STATUS 'STANDA02' EXCLUDING extab.
ENDFORM.                    "STANDARD_02
*&      Form  USER_COMMAND
      text
     -->R_UCOMM    text
     -->RS_SELFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
<b> "menubutton with functioncode GOTO's Action</b>
    WHEN  'GOTO'.  
      READ TABLE it_scarr INDEX rs_selfield-tabindex. "cursorposit.
      IF sy-subrc = 0.
        WRITE:/ it_scarr-carrid,
              /  it_scarr-carrname.
      ENDCASE.
ENDFORM.                    "USER_COMMAND<b></b>
Hope it helps..
Regards,
Simy

Similar Messages

  • Push button in the application tool bar in the standard LDB PNP

    Hi ABAPERS,
    I have a  requirement that in the selction screen to use the standard LDB PNP beyond that I need to pass one push button in the selection screen 1000 ( in the application tool bar beside execute button) actually i  passes the push button in the gui status but its not refelcting in the output  and in the initilization event also i passed even then its noty working,
    initialization.
      move 'Cluster ID'(010) to sscrfields-functxt_01.
    Thanks and Regards,
    Deepthi.

    Pavan,
    write code like this
    TABLES: USR02,       "Logon data
            SSCRFIELDS.  "FIELDS ON SELECTION SCREENS
    STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT
    SELECTION-SCREEN: FUNCTION KEY 1.
    SELECTION-SCREEN begin of BLOCK b1.
      PARAMETERs p1 type i.
      SELECTION-SCREEN end of BLOCK b1.
    INITIALIZATION.
    SCREEN ICON LEFT AND RIGHT
      SSCRFIELDS-FUNCTXT_01 = 'Button'.
      start-OF-SELECTION.
    Thanks
    Bala Duvvuri

  • Displaying a Push button in the application toolbar for an ALV report

    Hello everyone,
    Query:
    Is it possible to display a custom push button in the application tool bar while displaying an ALV report(1st one)?
    On pressing this custom push button will I be able to display another ALV report(2nd one) based on the selection made on the current ALV report(1st one)?

    Yes u can have pushbutton on application toolbar.
    You just have to use the new pf status in your report program.
    You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.
    Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.
    Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.
    Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality.
    Have a look at below code for using the new status.
    TYPE-POOLS: slis.
    DATA: i_qmel LIKE qmel OCCURS 0.
    data v_repid type repid.
    SELECT * FROM qmel INTO TABLE i_qmel.
    v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = v_repid
    I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    i_structure_name = 'QMEL'
    TABLES
    t_outtab = i_qmel
    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_pf_status using rt_extab type slis_t_extab.
    set pf-status 'TEST'.
    endform.
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
    data lv_ucomm type sy-ucomm.
    lv_ucomm
    = sy-ucomm.
    CASE lv_ucomm.
    WHEN 'BUTTON'. "Double Click line Item
    **Write ur functinality here
    endcase.
    endform.
    Also have a look at below links.
    http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
    ALV report
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • How can i disable a button in the application tool bar of a standard trans?

    Hi Experts,
       I want to disable the create button in the application tool bar of the standard transaction cv03n. Is there any method?

    Hi,
    In the include 'LCV110F19', the GUI is being called for the screen.
    This is the actual code being called.
    WHEN c_dms_create.
          SET PF-STATUS 'D100CREATE'.
          SET TITLEBAR  'D100CREATE'.
    You can try to code something like below.
    DATA: itab TYPE TABLE OF sy-ucomm.
    APPEND 'CREATE' TO itab.
    SET PF-STATUS 'D100CREATE' EXCLUDING itab.
    Kindly reward points by clikcing the star on the left of reply,if it helps.

  • Push button on the alvgrid tool bar?

    how can u place push button on the ALV GRID TOOL BAR?

    Hi,
    1. create the local class and implement the Toolbar event.
    2. within the event to add the new button.
    see the below example code.
    CLASS LCL_EVENT_HANDLER DEFINITION.
      PUBLIC SECTION.
        METHODS:
        HANDLER_TOOLBAR      FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
                                 IMPORTING  E_OBJECT E_INTERACTIVE     ,
        HANDLER_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                                 IMPORTING E_UCOMM                     .
    ENDCLASS.                    "lcl_event_handler DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    Toolbar -----Create 'Add Issue' button
      METHOD HANDLER_TOOLBAR.
        DATA:  L_WA_TOOLBAR  TYPE  STB_BUTTON.                                          "  Toolbar
        CLEAR: L_WA_TOOLBAR.
    Button Type
        L_WA_TOOLBAR-BUTN_TYPE  =  C_BUTTON_TYPE   .            "  3.
        APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
    Add Issue Button.
        CLEAR: L_WA_TOOLBAR.
        L_WA_TOOLBAR-FUNCTION   =  'ADD_MI'   .                                         "  'ADD_MI'   .
        L_WA_TOOLBAR-ICON       =  'ICON_CREATE'.
        L_WA_TOOLBAR-QUICKINFO  =  'CREATE'   .                                         "  'Add Issue'.
        L_WA_TOOLBAR-TEXT       =  'CREATE'   .                                         "  'Add Issue'.
        L_WA_TOOLBAR-DISABLED   =  ''.
        APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
        CLEAR: L_WA_TOOLBAR.
      ENDMETHOD.                    "handler_toolbar
    User Actions Events-- Handle 'Add Issue' Button Click.
      METHOD HANDLER_USER_COMMAND.
        CASE E_UCOMM.
    Add Issue Button.
          WHEN C_ADD_MI.
            IF NOT G_MATNR IS INITIAL.
              FG_REFRESH  =  C_TRUE.
              PERFORM F_ADD_MEDIAISSUE.
            ENDIF.
        ENDCASE.
    Refresh Control
        CALL METHOD CL_GUI_CFW=>FLUSH
          EXCEPTIONS
            CNTL_SYSTEM_ERROR = 1
            CNTL_ERROR        = 2
            OTHERS            = 3.
    Handle Exceptions
        IF SY-SUBRC <> 0.
          CASE SY-SUBRC.
            WHEN 1.
              G_ERROR_TEXT = TEXT-026.                                        "  'Control System Error'.
            WHEN 2.
              G_ERROR_TEXT = TEXT-027.                                        "  'Control CL_GUI_CFW Has Raised Error'.
          ENDCASE.
            MESSAGE G_ERROR_TEXT TYPE 'E'.
        ENDIF.
    Refresh Alv Grid.
        PERFORM F_REFRESH_GRID.
      ENDMETHOD.                    "handler_user_command
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    Object Ref. Event Class.
    DATA: OBJ_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
    refer the sample program BCALV_GRID_05 in SE38
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • How to create print button in the Application tool bar in the Std.SAPscreen

    Hi,
        I want to create a print button in Production order display:header screen in  CO03 transaction.In that after Viewer button(i.e. in application tool bar) ,I have to create this print button. Can anyone suggest me How do i need to proceed further?

    hi,
    Use this code..
    REPORT  Z_TEST999                               .
    DATA itab TYPE TABLE OF sy-ucomm.
    PARAMETERS test(10) TYPE c.
    AT SELECTION-SCREEN OUTPUT.
      APPEND: 'E' TO itab.
      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
           EXPORTING
                p_status  = sy-pfkey
           TABLES
                p_exclude = itab.
    Regards,
    Sailaja.

  • Manually adding a Extra button in the application tool bar of the view cluster.

    hello Colleagues ,
    I have created a couple of maintenance view , and with this two maintenance view i have created a view cluster using the transaction SE54.
    Now, there is default Application toolbar gets generated when a view cluster is created. (screenshot attached.)
    Now i have a requirement where i can add another button (syntax Check button in the screenshot 2) in the same view cluster. (screenshot attached.)
    Want to know the feasibility of this requirement.
    Thanks in advance
    Shavneet Singh

    Hello,
    Not sure of your exact reqt
    But got some sample code to create a button on the toolbar which once clicked gives a new popup window with additional parameters
    TABLES:SSCRFIELDS.
    **Create the Additional Selection screen to input filename
    SELECTION-SCREEN: BEGIN OF SCREEN 10.
    PARAMETERS: P_FILE TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN: END OF SCREEN 10.
    **Create Application Toolbar Button on the Standard selection Screen
    SELECTION-SCREEN FUNCTION KEY 1. "Its fcode will be FC01
    PARAMETERS : P_WERKS TYPE MARC-WERKS.
    INITIALIZATION.
      SSCRFIELDS-FUNCTXT_01 = 'Enter File'. "Assign the Text to the Button
    AT SELECTION-SCREEN.
      CASE SSCRFIELDS-UCOMM. "Check the Fcode
        WHEN 'FC01'.
          CALL SELECTION-SCREEN 10 STARTING AT 5 8 ENDING AT 85 20.
      ENDCASE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'F4_FILENAME' "Local file browser
      EXPORTING
      PROGRAM_NAME = SYST-CPROG
      DYNPRO_NUMBER = SYST-DYNNR
      FIELD_NAME = 'P_FILE'
      IMPORTING
      FILE_NAME = P_FILE.
    START-OF-SELECTION.
    ***Your list processing.

  • To disable the Application tool bar button in ALV report

    Hi Everyone,
    Iam using REUSE_ALV_GRID_DISPLAY to display ALV report.
    Now my requirement is to disable(I mean grey out) a application tool bar button.
    Thanks in advance
    Moderator message: please search for available information and try yourself before asking.
    locked by: Thomas Zloch on Sep 23, 2010 11:38 AM

    We can disable the buttons on the application toolbar as below.
    *To Exclude a few buttons from the Application tool bar
    data: it_excluding type slis_t_extab.
    data: wa_excluding type slis_extab.
    wa_excluding-fcode = '&OUP'.
    append wa_excluding to it_excluding.
    wa_excluding-fcode = '&ILT'.
    append wa_excluding to it_excluding.
    wa_excluding-fcode = '&ODN'.
    append wa_excluding to it_excluding.
    and in the FM.....
    call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            i_callback_program      = sy-repid
            i_callback_pf_status_set = 'ZPICK'
            is_layout               = itlayout
            i_callback_user_command =  'LIST1'
            i_grid_title            = <fs>
    *       i_callback_top_of_page  = ' '
            it_fieldcat             = itfieldcat[]
            it_excluding            = it_excluding
    But,no idea on how to disable the  whole application tool bar itself ?
    K.Kiran.

  • Add bottons on the application tool bar of the standard selection screen

    Hi All,
    I am having the standard selection screen in module pool programing. I wnat to add the bottons on the application tool bar of the standard selection screen.and hide the existing bottons (like std. execute and i bottons.)instead of these i want to give my won bottons like create and display.
    pls help on this.

    Hi Sridhar,
      Try the Code below. It places two buttons on the selection-screen along with the execute button.
    TABLES sscrfields.
    PARAMETERS: p_carrid TYPE s_carr_id,
                p_cityfr TYPE s_from_cit.
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2.
    INITIALIZATION.
      sscrfields-functxt_01 = 'LH'.
      sscrfields-functxt_02 = 'UA'.
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
          WHEN'FC01'.
          p_carrid = 'LH'.
          p_cityfr = 'Frankfurt'.
        WHEN 'FC02'.
          p_carrid = 'UA'.
          p_cityfr = 'Chicago'.
      ENDCASE.
    START-OF-SELECTION.
      WRITE / 'START-OF-SELECTION'.
    Just go to the table sscrfields to knoe the fields in it. I think this clears the issue.
    Regards,
    Swapna.

  • How to disable ikons on the Application tool bar in module pool

    Hi Guys,
    I am working in module pool.
    I had three ikons on the Application tool bar .
    i am creating transactions for create,change and display.
    for display transaction i want to disable the ikons on the Application tool bar .
    Can any one help me in this regard.
    Regards
    Ram
    Message was edited by:
            ram kumar

    Hi
    go to layout
    double click on the button
    it will display button properties
    in that below u will find 3 tab strips
    like
    dict program  display
    click on display
    click on check box for invisible
    so that will become invisible
    reward if usefull

  • How to disable or redirect the back button on the browser tool bar

    I am creating a web help file for a web based software
    application. I am using context sensitive help, when I click on the
    help for a topic and close the window, when I click the Back button
    on the Internet Tool bar it goes back to the help instead of the
    software.

    Doubleposted: [http://forums.sun.com/thread.jspa?threadID=5379620&tstart=0]. Please continue over there.
    Please do not use the back button to edit a message. You're going to repost the message. Just use the message's edit button instead.

  • Creating a push button in the application toolbar-----vvvv urgent...

    Hi,
    I have already created in the program.
    The addl. requirement is to create a pushbutton after displaying the output .
    Can anybody tell the procedure on how to create a pushbutton in the application toolbar.
    Plz send the relevant code also to download the output in to the excel sheet.
    Regards,
    Sree
    Edited by: sree on Feb 18, 2008 10:09 AM
    Edited by: sree on Feb 18, 2008 10:13 AM

    Sree,
      If you are using ALV report:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
                  i_callback_program       = ws_repid
                  i_callback_pf_status_set = 'GUI_STAT1'
                  i_callback_user_command  = 'STAT'
                  is_layout                = gs_layout
                  it_fieldcat              = i_fieldcat[]
                  it_sort                  = wa_sort1
             TABLES
                  t_outtab                 = i_zaw_pol_plan.
    *--Setting Status of output screen
    FORM gui_stat1 USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'STANDARD1' EXCLUDING rt_extab.
      SET TITLEBAR text-005.
    ENDFORM.
    Double click on status 'STANDARD1'.
    Expand the Application toolbar-->press ctrl+f1 for change mode -
    >add your  buutton name --> double click on name add text name button icon  --> save it.
    In classiccal report also Add set pf status
    same like above

  • How to add the push button on the apllication tollbar of IL02 tcode

    Hi Friends,
    I have to add the push button on the application tool bar of the IL02.when that push button is pressed then some operation to be performed.Could you please suggest how to add.Is there any screen exit if yes what is that.
    With out screen exits if there is any way ?
    Thanks and regards,
    shyla

    HI Vicky ,
                      if u want an interactive ALV report , there are lot of forums already having the solution for that , but let me give u the solution anyway.
    In the function module "REUSE_ALV_GRID_DISPLAY" , import parameters
         I_CALLBACK_PF_STATUS_SET          = 'FLIGHT'
         I_CALLBACK_USER_COMMAND           = 'BUTTON_CLICK'
    has to be supplied to this function module . The PF status is where u hav created the two buttons , that PF status has to be given here .If the user clicks on the button then it is handled by the form routines . Inside the sub-routine based on the button the user has selected u could perform the action.
    FORM FLIGHT    USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'FLIGHT' EXCLUDING RT_EXTAB.
    ENDFORM.
    Here the "Flight" is the PF_status .
    FORM BUTTON_CLICK USING UCOMM type SY-UCOMM
                           SELFIELD type SLIS_SELFIELD.
      CASE UCOMM.
        WHEN 'BUTTON!' .
    write ur code for button 1.
      WHEN "BUTTON"
      *Write ur code for button2 .
    end case.
    endform.
    for any queries reply back.
    regards

  • How to create a new push button in application tool bar in GMGRANT thru BDT

    Dear SAP Gurus -
    We have a requirement in 'GMGRANT' transaction. We need to create a button in the application tool bar of 'GMGRANT' transaction. Once the button is activated, if the user clicks on the button then it will go to a new screen (external screen). User can input data in to the external sceeen and upon saving, the data will be stored in to a custom table and when user clicks on 'back ' button user should come back to the GMGRANT transaction.
    Just wanted to know, how to create / activate a new button on application tool bar of GMGRANT transaction and what are the configuration and detail steps to achieve the same through BDT.
    We went through a lot of documents on BDT but do not have a proper solution.
    Could you please help.
    Thanks in advance.
    Regards,
    Atul Mohanty

    hi,
    You can find user-exits (menu exits) to add new menu item.
    But, there is no possibility to add new buttons on application tool bar.
    Regards,
    Sailaja.

  • Is it possible to deactivate a button on the application toolbar?

    Hello everybody!
    Is it possible to deactivate a button on the application toolbar from standard transaction like PA40?
    I'd want to do it using an user-exit.
    Thanks in advance.
    Cristian

    there is a push button on the std tool bar of pf-status 'Function code'.using that u can activate and deactivate teh function codes
    or
    Check this FM : RS_SET_SELSCREEN_STATUS
    sample code :
    DATA: BEGIN OF i_exc OCCURS 0,
    code LIKE sy-ucomm,
    END OF i_exc.
    DATA: ws_repid like sy-repid.
    CLEAR i_exc.
    i_exc-code = 'ONLI'.
    APPEND i_exc.
    MOVE: sy-repid TO ws_repid .
    CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
    p_status = ' '
    p_program = ws_repid
    TABLES
    p_exclude = i_exc.

Maybe you are looking for

  • Itunes Stops Working When Nano Plugged In

    Good evening everyone... Here's an interesting problem. Running 7.5.0.20 on Fisher Price Operating System (Vista). Up until tonight, all is well. Now, when I plug in either of my two Nanos (current and one generation back), Itunes immediately stops w

  • Standard report to display char. attributes

    Dear Team, Is there any standard report / screen for the display of result recorded against the inspection lots. Currently we are using QA33 - work list, by the help of this work list we have to display char. attributes individually. But the requirem

  • Apps won't open...help :(

    i have a bunch of apps on my ipad that worked fine before..but now more than half of them won't open!

  • Async back-to-back

    Hello all, I need some help with cabling. I need to connect 2 routers back-to-back through ASYNCHRONOUS RS-232 interfaces. I guess should use a DB-60 to DB-25 DTE cable for both interfaces. Any idea how to connect the two DB-25 outputs of cables? Tha

  • Concatenation in a Group by

    Hi, I'd like to concatenate attributes on a vertical basis when I perform a Group by For example: TABLE_TEST ID STATUS 1003 PL 1003 OP 1003 OP I am looking for ID STATUS 1003 PL, OP, OP The query would be something like: Select ID, concat(STATUS) Fro