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

Similar Messages

  • 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

  • Creating push button on ALV application toolbar

    Hi Abapers,
    I have created one ALV in HR module using function module 'display_basic_list'. now my requirement is to create a push button on ALV application tool bar so that when user clicks on this push button another list has to appear..
    kindly gimme valid inputs which would help me.. Also provide me sample code...
    Thanks in Advance,
    Radhika.

    Hi,
    GO to SE41 copy the status STANDARD from the program SAPLKKBL..And give the status name and your program name...
    Add your buttons..
    In the parameter I_CALLBACK_PF_STATUS_SET give the form name 'PF_STATUS_SET'.
    In the subroutine.
    FORM PF_STATUS_SET.
    SET PF-STATUS 'STATUS NAME THAT YOU GAVE IN SE41'.
    ENDFORM.
    For user command pass the parameter I_CALLBACK_USER_COMMAND with the user command subroutine name..
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    IF R_UCOMM = ''.
    ENDIF.
    ENDFORM.
    Example
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = lv_repid
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    Thanks,
    Naren

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

  • 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

  • Adding a push button on the report toolbar

    adding a save button on the report toolbar, so that after clicking the button, the data fetched on the report will be stored in the application server.

    Hi
    to automate this process ,best way is to create a Z rport and there u can submit this sap standard report and get its output into an Internal table and then u can write this internal table to application server via following demo code -
    this is code for both (download /upload),u can not use CG3y and CG3z as u want to do it as a background job ..
    *& Report ZGILL_AS *
    REPORT ZGILL_AS message-id rp .
    tables: pa0001,pa0002.
    select-options s_pernr for pa0001-pernr no intervals MODIF ID XYZ.
    parameters: p_dwnld AS CHECKBOX ,
    p_upld AS CHECKBOX DEFAULT 'X'.
    parameters: P_DSNI(75) TYPE C MODIF ID ABG DEFAULT
    '/usr/local/sapdata/amit.dat' LOWER CASE.
    data: begin of itab occurs 0,
    pernr(8),
    sp1(1) value ',',
    werks(4),
    sp2(1) value ',',
    persg(1),
    sp3(1) value ',',
    persk(2),
    end of itab.
    data: s_eof(3).
    start-of-selection.
    if p_upld = 'X'.
    OPEN DATASET P_DSNI FOR OUTPUT IN LEGACY TEXT MODE.
    PERFORM FETCH_DATA.
    STOP.
    elseif p_dwnld = 'X'.
    OPEN DATASET P_DSNI FOR INPUT IN LEGACY TEXT MODE.
    IF SY-SUBRC NE 0.
    MESSAGE E016 WITH
    'Error opening seq. file, RC:' SY-SUBRC.
    EXIT.
    ENDIF.
    CLEAR S_EOF.
    DO.
    PERFORM FETCH_file.
    IF S_EOF EQ 'YES'. stop. ENDIF.
    ENDDO.
    endif.
    END-OF-SELECTION.
    if itab[] is not initial.
    perform print_file1 tables itab.
    else.
    write:/ 'No records exists'.
    endif.
    *& Form FETCH_DATA
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_DATA .
    SELECT * FROM PA0001 WHERE PERNR IN S_PERNR.
    MOVE-CORRESPONDING PA0001 TO ITAB.
    TRANSFER ITAB TO P_DSNI.
    APPEND ITAB.
    ENDSELECT.
    CLOSE DATASET P_DSNI.
    ENDFORM. " FETCH_DATA
    *& Form FETCH_file
    text
    --> p1 text
    <-- p2 text
    FORM FETCH_file .
    READ DATASET P_DSNI INTO itab.
    append itab.
    clear itab.
    IF SY-SUBRC NE 0.
    S_EOF = 'YES'. EXIT.
    ENDIF.
    ENDFORM. " FETCH_file
    *& Form print_file1
    text
    -->P_ITAB text
    FORM print_file1 tables P_ITAB structure itab .
    write:/2 'EmpNo',
    14 'Personnel Area',
    34 'Emp Group',
    47 'Emp SubGroup'.
    skip 1.
    loop at p_itab.
    write:2 p_itab-pernr,
    14 p_itab-werks,
    34 p_itab-persg,
    47 p_itab-persk.
    skip 1.
    endloop.
    ENDFORM. " print_file1
    <b>Reward if usefull</b>

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

  • 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

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

  • Buttons on  ALV Application Toolbar

    Hi,
    I have added buttons on the Application Toolbar of the ALV (in the GUI status).
    There are a lot of buttons and due to lack of space some of the buttons go out of the screen.
    Need to know if there is a way to make these buttons scrolable or in a dorp down.
    Thanks for the help.
    Karen

    Hi Karen,
    I also faced the same issue but solved it using alternative solution.
    1) Go to PF-STATUS and create a MENU BAR.
    2) Give Appropriate NAME and inside it  write FUNCTION CODE given for buttons under "Code"
    3) Appropriate description under "Text"
    4) Save and activate.
    Now,  execute the report and even if the buttons are going out of screen, you have option to select the button from MENU BAR.
    This is the best solution for this problem as far as i know.
    Also, if you re-size your window ; the you will get tabs with drop down.
    I hope this will help you in solving your issue.
    Regards,
    Rahul Mahajan

  • 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

  • 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 : )

  • 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

  • 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

  • Push Buttons in the custom Container

    Hi
    I have created one container using cl_gui_custom_container.
    Now I have splitted the container into two parts as left and right using cl_gui_splitter_container.
    Is there any way to create push buttons in the left container.
    Regards
    Vijay

    Pushbutton is an example of classic control while custom container is an example of GUI control . You can't mix controls of first type with the latter meaning you can embed classic control in GUI container. You can have such control only outside any container (on screen canvas). This is very common that you have docking container on the left and classic controls on the right side of the screen (not container)
    To be able to have a button inside container, you will have to use cl_gui_toolbar class adding your options there and handling them as normal OO event. This way you only combine GUI controls (toolbar + container). Otherwise it is not possible.
    Regards
    Marcin

Maybe you are looking for

  • Need help with Patch Tool in CS5

    I am having a problem using the patch tool in Photoshop CS5. I click on the Patch Tool and select the Source option from the upper tool bar. Then I circle a gray area in the background of my photo and, holding down the left mouse button, I drag the s

  • Spanish Question Marks and Dollar signs

    Every time one of my friends (using a Razr on ATT) sends me a sms with a dollar sign it shows up as an upside down question mark. My settings are for English, US (as delivered by ATT). What's up with that? Anyone else seeing this?

  • ORA-12545 on dblink

    Dear all, Db : 10.2.0.3. Solaris 10 In Toad, When querying a table data over DBLInk, am getting the error : ORA-12545 Connect Failed because target host or object does not exist but,the same query works fine when directly logging into the server.. Wh

  • SAP TM - Rating & Billing & Settlement Systems

    Dear All,                  I am interested in learning SAP TM - Rating & Billing & Settlement Systems. Can someone please let me know how to proceed. Thanks, Abhi

  • Why won't PSE 10 open on Windows 8?

    Help?