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

Similar Messages

  • 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

  • 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

  • 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.

  • How do I add the rotate button to the main toolbar for all users

    How do I add the rotate button to the main toolbar for all users. I have a Windows 2003 Citrix farm with Adobe Reader 8. I can add it user by user but I want to add it to all users at once. All users need this rotate button,
    Thanks in advance
    ND

    Try the Reader forum. I have no clue.

  • 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

  • Adding a Button in the Application toolbar when using LDB for HR programs

    Hi Experts,
    I have a requirement to add a new button after execute button in the Application tool bar for the HR programs when using LDB PNP.
    Normally when we are using LDB in our program we will get a extra button provided by SAP after the execyte button.          When we are creating a new button for this  by using the table fields sscrfields  with the function key as 2 we are not able to see the new button.
    can any one help me in this issue.

    please post your relevant coding with respect to the button
    A.

  • How to put a push button in the top of page of ALV

    Hi at all,
    I need to put a push button in TOP OF PAGE .
    My code is below and i'd like to put a push button to do something.
    FORM top_of_page USING r_ddoc TYPE REF TO cl_dd_document.
      DATA: text TYPE sdydo_text_element.
      DATA: text_table TYPE sdydo_text_table.
      CALL METHOD r_ddoc->initialize_document.
    Title
      text = text-301.
      CALL METHOD r_ddoc->add_text
        EXPORTING
          text          = text
          sap_style     = 'HEADING'.
      CLEAR text.
    endform.
    Thanks at all.
    ENDFORM.

    Hi Domenico,
    For pushbuttons on Dynamic Documents please refer to this link:
    http://help.sap.com/saphelp_nw70/helpdata/EN/b6/ab3a7503ac11d4a73f0000e83dd863/frameset.htm
    Regards
    Marcin

  • How to make the buttons INVISIBLE in the Application toolbar

    Hi All,
    I have a requirement to create a button in the Application toolbar of the Module Pool Screen. The field should be made Invisible by default. and it should be displayed based on one condition.
    Could you please let me know how to make that particular button INVISIBLE. I think we can make it invisible by using EXCLUDING statement. But, How to make the button VISIBLE again when the check is satisfied.
    I found from the portal that the FM 'VIEW_SET_PF_STATUS' can be used to make a button INVISIBLE. Could anyone help me out how to pass the parameters to this Function module?
    or is there any Function Module available to make the button VISIBLE and INVISIBLE? Please help me on this issues.
    Is there any possibility to make the button VISIBLE or INVISIBLE as we do for the screen fields using LOOP AT SCREEN..?
    Thank you in advance.
    Regards.
    Paddu.

    Hi,
    Try to use below in the PBO module status_0100 OUTPUT.
    DATA t_fcode TYPE TABLE OF sy-ucomm.
    refresh t_fcode[].
    APPEND 'Function code name of the button' TO t_fcode. 
    Check the condition here for which you want to make field visible.
        DELETE FCODE of the button from T_FCODE table
      ENDIF.
      SET PF-STATUS 'STATUS_0100' EXCLUDING t_fcode.

  • 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

  • DISPLAY DYNAMIC TEXT ON THE APPLICATION TOOLBAR

    Hi Abappers,
    On the application toolbar i want to display dynamic text depending on which button is selected. can this be done...
    regards,
    Mansi.

    write the conditional setting of titlebar in
    at selection-screen output .
    if <condition> eq 'X' .
        set titlebar 'MAIN' with 'Maintain' .
      else .
        set titlebar 'MAIN' with 'Display'  .
      endif .
    now double click on MAIN, the system will ask youto creat the title click yes
    in the title field you can write static text along with & sign
    (& Test & & &)
    now if you say
    set titlebar 'MAIN' with 'Display'  '1' '2' '3' .
    it will display as
    Display Test 1 2 3 .
    Regards
    Raja

  • Grey-out button dynamically in the application toolbar

    Hi,
    How can I grey-out button dynamically in the application toolbar?
    It's not an ALV grid, where it's easy.
    SET PF-STATUS '100' EXCLUDING 'SOMETHING'. hides completely the button.
    Thanks,
    Peter

    Hi,
    Sorry forgot to add something to my previous reply...
    The complete steps will be as follows :
    1. Create Two PF status , One with active Button and Function code and Second with Inactive Function code and Greyed button (This can be acheive by using Push Button assignment as specified in the thread)
    2. Dynamically change the PF status to Second one when you want to deactivate the specified Function from the application tool bar.
    regards,
    Sumeet Mishra
    Reward point if this helps : )

  • Wan to add push button in the output of ALV Grid display.

    Hi Friends,
    I wan to add a Push button in the output of ALV GRID display with STANDARD ikons.
    How to copy standard ikons of GRID output.
    How to apply the copied status into my code.
    Regards,
    Viji

    Hi,
    Goto SE41, create a pf-status for your alv report program.
    On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
    Delete the unwanted buttons and also you can add new buttons if reqd.
    Activate pf-status --> and apply in alv program.
    Now to apply this pf-status in your alv report follow code:-
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
         it_sort                           = it_sort        " sort info
        TABLES
          t_outtab                          = it_final      " internal table
       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
    *       SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
    *       ON WHICH THE ALV GRID IS DISPLAYED
    *       -->RT_EXTAB
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_STAT'. "<--pass pf-status name here
    ENDFORM.                    "pf
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
        WHEN '<function_code>'. "<--to handle user actions
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun

  • Push button on the SAP Application toor bar

    Hi,
      i need to add a push button on the stanadard screen(me41,me42,me43).If click that button it will calls a custom screen.How it's possible to add a push button on sap std screen...
    Thanks in advance.....
    Avinash M

    Have you heard of GuiXT.   Check it out. 
    http://www.synactive.net/site/index.htm
    Regards,
    Rich Heilman

  • Push button in the selection screen

    Hi folks,
              I need to display a push button the selection screen.its not on the application tool bar..but in one of the selection block in the selection screen..could anybody guide how to do this...
               Thanks in advance,
               shyam.
    Edited by: shyam prasad on Jan 15, 2009 7:34 AM

    Hi Shyam,
    Try the following code..
    TABLES sscrfields.
    TYPE-POOLS icon.
    *SELECTION-SCREEN:
      BEGIN OF SCREEN 500 AS WINDOW TITLE title,
        PUSHBUTTON 2(10)  but1 USER-COMMAND cli1,
        PUSHBUTTON 28(30) but2 USER-COMMAND cli2
                               VISIBLE LENGTH 10.
      END OF SCREEN 500.
    AT SELECTION-SCREEN.
      CASE sscrfields.
        WHEN 'CLI1'.
        WHEN 'CLI2'.
      ENDCASE.
    START-OF-SELECTION.
      title  = 'Push button'.
      but1 = 'Button 1'.
      CALL FUNCTION 'ICON_CREATE'
        EXPORTING
          name   = icon_information
          text   = 'Button 2'
          info   = 'My Quickinfo'
        IMPORTING
          RESULT = but2
       EXCEPTIONS
         OTHERS = 0.
    Hope it will be useful..
    Regards,
    Lakshman.
    Edited by: Lakshman N on Jan 15, 2009 7:39 AM

Maybe you are looking for

  • How to display imaged documents on  EP   (.prop filename extension)

    Hello All Situation is, the business desires ability to display and optionally print multiple imaged invoices at one time.  These images are stored on the Content Server as ".prop" files.  On R/3 these files are displayed through the SD Viewer.   The

  • How to open PageMaker files in InDesign?

    It seems that this possibillity is taken away although it is told in the helpfile that it is possible. You can´t chose PM file type in Open files.

  • Vendor delivery rating for scheduling agreements

    Dear All, I need to check vendor delivery rating for sch. agreements. Mc$6 is not usefull because of sch. lines it works fo Po's. please suggest me how to get this. Regards MSR

  • Migration from ODI 10.1.3.5 to ODI 11.1.1.7 RCC issue

    SRC_SET is used, but possibly not needed, as both the source and target Datastores are on the same Data Server I am getting this issue when i ran RCC can i know why this error occurred and what is solution to remove this error. Thanks

  • ALV Scrolls to last row

    Hello everybody, I have a problem with my WebDynpro ALV. When I am using the calculation functions the ALV scrolls down to the totals line. When I set "Display Calculations at Start of Table" it scrolls to the first row in the Table (which is in fact