Using application toolbar push buttons in report

Hello folks,
I'm new to ABAP and so i'm facing some problems with my code.
I have copied a standard program to my Z program (ZXXXXX). I have added few push buttons to the application toolbar of the Z program (ZXXXXX) and now on click of the 1st button i need to call another standard program.
Where should I write the code for the action to be performed on click of the buttons? I am aware that it is generally written in the PAI module but I did not have this module, its a normal report program and not a module pool.
Need your help.
Thanks in advance.

Welcome on SCN!
Please do not forget to read Welcome and Rules of Engagement
As for the question, you would need to clarify where this application toolbar option is placed:
- in selection screen?
- in list (output of program)?
If first applies, do as above suggested (using AT SELECTION-SCREEN event).
If second is what you need, use event AT USER-COMMAND .
In both cases variable sy-ucomm will hold function code of triggered function (i.e sy-ucomm = 'MY_BUTTON' ). If that condition is fulfilled simply use SUBMIT 'MY_PROGRAM' AND RETURN , or just SUBMIT 'MY_PROGRAM' if you don't want to get back to calling program.
Regards
Marcin

Similar Messages

  • Va01 application toolbar push button

    gurus
    When ever we go into va01 screen we will see in the application toolbar the following buttons by default .
    Display document flow
    status overview
    Display sales summary
    Display sold to party
    Header output overview
    List of sales orders
    Now i want to add one more button here , and handle that according to that as per my requirement.
    tell me how to add the button there.
    another question is that in sales oreder ie in va01 i seen someone added the truck button and when ever we press it we can see another sub screen. how to find out where exactly he added this button i mean in which application toolbar and where he has written the code.
    i debugged but not getting idea.
    i started debugging and pressed on the trcuk button and gone to debugger screen , but i am searching for pf-status but i am not able to .
    tell me how to do this

    Hi,
    Check the following exits:
    V45A0001            Determine alternative materials for product selection
    V45A0002            Predefine sold-to party in sales document
    V45A0003            Collector for customer function modulpool MV45A
    V45A0004            Copy packing proposal
    Also refer Want to add a button to the application toolbar

  • 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 to add push button in report.

    Hi,
    how to add a push button in the standard list report and on clicking which the line-size of the screen should reduce from 300 to 100.
    how to proceed.
    Can anyone help me.
    Regards
    Guhapriyan

    Hii Guhapriyam,
    You can ceate PUSHBUTTON in selection-screen like Below
    SELECTION-SCREEN PUSHBUTTON 2(10) text-004 USER-COMMAND CL1.
    Create a variable to hold the processed PUSHBUTTON value like
    DATA v_flag TYPE flag.
    The PUSHBUTTON will be processed at the event AT SELECTION-SCREEN. So write your code like below
    AT SELECTION-SCREEN.
       IF sy-ucomm EQ 'CL1'.
         v_flag = 1.          "Buttob clicked
       ENDIF.
    START-OF-SELECTION.
    IF v_flag EQ 1.
         NEW-PAGE LINE-SIZE 100.
    ENDIF.
    OR
    The best way of doing this by setting PF-STATUS like
    START-OF-SELCTION.
    SET PF-STATUS 'ZSTATUS'.  "Double click on this and set the pushButton in standard toolbar option and in function key specify the BACK, EXIT and CANCEL button .
    Then write your logic at the event AT USER-COMMAND.
    AT USER-COMMAND.
       CASE sy-ucomm.
         WHEN 'RED'.
           NEW-PAGE LINE-SIZE 100.
         WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
           LEAVE SCREEN.
         WHEN OTHERS.
       ENDCASE.
    regards
    Syed

  • How to upload an icon for a toolbar push button

    I'd like to be able to define/upload an icon that I can use for a new push button on a toolbar for the FB03 screen.
    1)  How can I upload the button icon?
          From here?
          ABAP User Dialogs ->Screens ->Complex Screen Elements ->GUI controls on screen
          Or somewhere totally differently?
    2)  What file format does a button icon need to be in and what is the suggested pixel size?
    This is how I'm thinking of creating the button:
      lv_icon             = '@11@'.
    adding button to toolbar
      call method gref_toolbar->add_button
       exporting
        fcode            = lv_fcode
        icon             = lv_icon
        is_disabled      = lv_is_disabled
        butn_type        = cntb_btype_button
        quickinfo        = lv_quickinfo
       exceptions
        cntl_error       = 1
        cntb_btype_error = 2
        cntb_error_fcode = 3
        others           = 4

    Hi
    In Module Pool Programming (Or Dialog Programming) we can set the icons to buttons in the Menu Painter (SE 41).
    Go to SE41 and select the FCODE for which you want to upload icon. Double Click on the FCODE it will POP a Screen
    in which you can  see the field to upload icon.
    Hope this would help you.
    Murthy

  • Creation of push buttons in report program

    hi guys,
    I have rquirement like  in selection screen i need  one paramenter  like vbeln  and  i need two push buttons ?  can we create pushbuttons in selection screen? if possible can anyone please help me on these?
    thank you

    If the pushbuttons are in the application bar, you may
    - Change the pf-status. - Check FM [RS_SET_SELSCREEN_STATUS|http://www.sdn.sap.com/irj/scn/advancedsearch?query=rs_set_selscreen_status] (to be called in PBO - AT SELECTION-SCREEN OUTPUT)
    - Add 1-4 function key with [SELECTION-SCREEN - FUNCTION KEY|http://help.sap.com/abapdocu_70/en/ABAPSELECTION-SCREEN_FUNCTIONKEY.htm]
    Look at [samples provided by SAP|http://wiki.sdn.sap.com/wiki/display/ABAP/ExamplesanddemosbySAP]
    Regards,
    Raymond

  • Sending Print through Push Button in report...

    I'm running report with 'DISABLEPRINT=Yes' and 'DisableFile=Yes' parameters. Now can I send the print of currently displaying report to a printer without rerunning the report...I mean is there any print command in reports???

    Dear Pusa
    I'm using Reports 6i. My report layout style is Group Above. I've adopted this technique coz in this report I'm generating an important document which should be printed only once in normal conditions. So to avoid multiple printing of this report I've disabled File menu(to prohibit generation of PDF etc) and Print Button. Now the report will generate only thru a button I've placed into the report and it'll check there whether user is printing for the First time or more.....Ok??? is it enough???

  • How to use drag n drop button in report display

    hello friends
                             i'm displaying list report . i want one customer one time and with  diff amounts .ok first of all i'm diplaying detail customer details , if i click on one customer i have to display that cust one time and i want to get details . just like drag and drop button how to use this in normal report .
    please help me out .
    thanks & regards.
    lavanya

    Hi,
    Check this link..
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_basic.htm
    And also Check these Examples..
    BCALV_TREE_01
    BCALV_TREE_02
    BCALV_TREE_03
    BCALV_TREE_04
    BCALV_TREE_05
    BCALV_TREE_06
    BCALV_TREE_DEMO
    BCALV_TREE_DND
    BCALV_TREE_DND_MULTIPLE
    BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER01
    BCALV_TREE_ITEMLAYOUT
    BCALV_TREE_MOVE_NODE_TEST
    BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY

  • I get an'MSQL error number2002' when trying to use my toolbar game button how does one fix this

    MSQL error number 2002

    I can access the internet just fine in the browser and i can use any other app i have.
    Sent from my Verizon Wireless 4G LTE DROID

  • How to call report by click application toolbar button?

    I need to know the way to call a report by click a button in application toolbar?
    BR,
    Ali
    Moderator message: next time, please (re)search yourself instead of asking basic questions.
    Edited by: Thomas Zloch on Aug 31, 2010 11:44 AM

    Hi Ali,
    Selection-screen function key is used to add push buttons on application tool bar.
    Syntax:
    selection-screen functuin key<num>
    Where num is ranging from 1 to 5.
    whenever application toolbat components are added using above statement,tables are defined in the structure "SSCRFIELDS" as "Functxt_01","Functxt_02","Functxt_03","Functxt_04","Functxt_05" for the related function key numbers.
    eg:
    Tables SSCRFIELDS.
    Selection-Screen pushbutton/10(10 lb1 user-command pb1.
    Selectiong-Screen Function key1.
    Selectiong-Screen Function key2.
    Selectiong-Screen Function key3.
    Selectiong-Screen Function key4.
    Selectiong-Screen Function key5.
    Initialization.
    sscrfields-Functxt_01 = 'first".
    sscrfields-Functxt_01 = 'fifth".
    At Selection-Screen.
    case sy-ucomm.
    When 'first'.
    Sumbit zreport.
    endcase.
    Hope it solves your problem.
    Regards,
    Amarnath S

  • Report Out put by Push Button ???

    Hi SAP-ABAP Experts .
    Boss Please suggest me that i have to create a Screen in which only one Push Buton ,
    As user Click this Push Button , a report should run and give it's output , the point is how selection screen will get a
    perticular input when user will click this Push Button .
    How to do this Boss .?
    For Ex : program's Selection Screen has two input parameters
                                                             A = 5
                                                             B = 4
                                  output of the report : C = 10 .
    Requirement is when user click Puch Button , it will get out put C = 10 .
    My Best Regards : rajneesh .

    Hi,
    Use Module pool program for this.
    SAP ABAP Tutorial: Module Pool Programming. Part 2
    Once the program 'ZSALESORDSCREEN' is created Saved and Activated, run Transaction SE51.
    Enter screen number '9000'
    Screen numbers can be up to 4 characters long, all of which must be digits. Screen numbers from 9000 are reserved for customer-specific screens.
    In the Screen Painter enter a short Description and Activate the screen.
    Once this is done you will be presented with a screen that will have three tabs, namely Attributes/Element List/Flow Logic
    Click on Element List and type Ok_Code and Activate.
    Now click on Flow Logic.
    You should see the following code in the Flow Logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_9000.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_9000.
    Create MODULE STATUS_9000 by double clicking on it.  The following code will be automatically created.
    INCLUDE ZSALESORDERTOP                          .                      "
    INCLUDE ZSALESORDERO01                        .                    *
    INCLUDE ZSALESORDERI01                          .                    *
    INCLUDE ZSALESORDERF01                          .                    *
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    Uncomment the following code.
      SET PF-STATUS 'ZSALES'. -
    Menu Bar for the custom Sales Order Screen.
      SET TITLEBAR 'ZSL'.       -
    Title.
    Give appropriate names to PF-STATUS and TITLE BAR. Once the code is uncommented and the appropriate names are given. Double click on the name ZSALES. Once you see the prompt click on create object.
    You will see the following three options in the resulting screen.
                                                                                    Menu bar                                     Status for Sales Order Screen                                          
    Application toolbar                      Status for Sales Order Screen                                          
    Function keys                              Status for Sales Order Screen
    Click on the Function Keys Drop Down Box. You will see the Standard Tool Bar with Icons that you normally see in the SAP Screen.
    Enter the following values in the empty fields.
    Standard Toolbar                                                                               
    Ente     SAVE     BACK     EXIT     CANCEL    PRINT     FIND     FINDNEXT   FIRSTPAGE  PREVP     NEXT    LAST
    Activate the PF-STATUS.
    You will be prompted to enter the Function Text and Info Text for the button Enter.
    Please enter the following values.
    Function Text   'Ente'
    Info Text          'Enter'
    Execute Transaction SE80 and Activate the complete program by right clicking on it.
    We will now create a transaction code for our program. To create a transaction code right click on the main program and from the pop-up menu select Create-----Transaction.
    In the dialog box enter the following values.
    Transaction Code     'ZSALESORD'
    Short Description     'Create Sales Order'
    And Click on Save.
    You will now be asked to enter Program name and Screen Number. Enter the following values.
    Program         ZSALESORDSCREEN
    Screen            9000  
    Save and Activate the Program
    Now we need to enter code to create the Sales order. We also need to create the Screen Elements.
    In transaction SE80 in the left pane click on Screens and then double click on 9000.
    Now from the menu click on LAYOUT button.
    We need to create Labels and Text Boxes for the following fields.
    Filed  (Label Display)          Label Name              TextBox Name         Def Length
    Order Type                           lblordtyp                     txtordtyp                               2
    Sales Org                             lblsalesorg                  txtsalesorg                            4
    Distribution Channel            lbldistchnl                   txtdistchnl                             2
    Division                                lbldiv                           txtdiv                                    2
    Sold-to Party                        lblsoldto                     txtsoldto                            10
    Ship-to Party                        lblshipto                      txtshipto                            10
    Purchase Ord                       lblpurchord                 txtpurchord                        10
    Material                                lblmat                          txtmat                                18
    Quantity                               lblqty                           txtqty                                 13
    We also need to create a command button as follows
    Label                                 Name
    Create Order                     lblcreateord
    We will now look at the property box which is displayed after double clicking on each screen element.
    Order Type (Label)
                       Name                  lblordtyp
                       Text                    Order_Type
    Order Type (Text Box)
                       Name                  txtordtyp
                       Text                   
                       Def. Length         2
    Similarly fill the Property box for other fileds
    Important
    Property Box for Command Button in this case the Function Code is important
    Create Order  
                               Name                  cmdord
                               Text                    Create Order           
                               Fct Code             ORDE

  • Pushbutton on application toolbar

    Hi,
    How to write code for pushbutton on application toolbar in a normal report program and functionality on that?
    Basic question. Please search before posting such basic questions
    Edited by: kishan P on Sep 2, 2010 3:09 PM

    Hi Chandrka,
    To create and appear push button in the screen you need to create a Push button.
    go to start of selection .
    add syntax.
    Set PF STATUS 'cutom'.  <-- Double click on the custom it will take you to se41 and add a button in application toolbar
    and write code in At-user command and handle it.
    Prabhudas

  • Status without application toolbar?

    Hi all. Is anybody know if it's possible to set status without application toolbar? I meen if I use status without any buttons on application toolbar, there is a blank line on the screen in place of it. How can i remove it?

    If you are using module pool then you can use a opup screen or subscreen for this purpose.
    For creating buttons on the selection screen without using application toolbar,you can have a look at the following code :
    REPORT demo_sel_screen_pushbutton.
    TABLES sscrfields.
    DATA flag(1) TYPE c.
    SELECTION-SCREEN:
      BEGIN OF SCREEN 500 AS WINDOW TITLE tit,
        BEGIN OF LINE,
          PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
          PUSHBUTTON 12(10) text-020 USER-COMMAND cli2,
        END OF LINE,
        BEGIN OF LINE,
          PUSHBUTTON 2(10) but3 USER-COMMAND cli3,
          PUSHBUTTON 12(10) text-040 USER-COMMAND cli4,
        END OF LINE,
      END OF SCREEN 500.
    AT SELECTION-SCREEN.
      MESSAGE i888(sabapdocu) WITH text-001 sscrfields-ucomm.
      CASE sscrfields-ucomm.
        WHEN 'CLI1'.
          flag = '1'.
        WHEN 'CLI2'.
          flag = '2'.
        WHEN 'CLI3'.
          flag = '3'.
        WHEN 'CLI4'.
          flag = '4'.
      ENDCASE.
    START-OF-SELECTION.
      tit  = 'Four Buttons'.
      but1 = 'Button 1'.
      but3 = 'Button 3'.
      CALL SELECTION-SCREEN 500 STARTING AT 10 10.
      CASE flag.
        WHEN '1'.
          WRITE / 'Button 1 was clicked'.
        WHEN '2'.
          WRITE / 'Button 2 was clicked'.
        WHEN '3'.
          WRITE / 'Button 3 was clicked'.
        WHEN '4'.
          WRITE / 'Button 4 was clicked'.
        WHEN OTHERS.
          WRITE / 'No Button was clicked'.
      ENDCASE.

  • Execute in Back ground when push button clicked on alv output

    Hi Friends,
    I have a alv list display report with check boxes and a 'Detail' Push button in output
    when i check the check boxes and click on the 'Detail' Push button detail report is
    displayed using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'. My requirement is if I click on 'Detail'
    push button the code should also execute in back ground creating the spool. Request you
    to help with sample code. I tried with below but not working.
    WHEN 'DETAIL'.
          call function 'START_OF_BACKGROUNDTASK'
          exporting
           startdate = sy-datum
           starttime = sy-uzeit
          exceptions
          others    = 1.
          if sy-subrc = 1.
           exit.
          ELSE.
           PERFORM determine_table_from_output CHANGING rs_selfield.
           PERFORM call_alv_detail.
          endif.
         commit work.
    Thanks,
    Neetha.

    You could encapsulate the detail display in a separate report and call it in your 'DETAIL'-section like this:
    DATA: lv_number TYPE tbtcjob-jobcount,
               lv_name   TYPE tbtcjob-jobname,
               ls_rsparams TYPE rsparams,
               lt_rsparams LIKE STANDARD TABLE OF ls_rsparams.
    *           Get free job number
                 CALL FUNCTION 'JOB_OPEN'
                   EXPORTING
                     jobname          = lv_name
                   IMPORTING
                     jobcount         = lv_number
                   EXCEPTIONS
                     cant_create_job  = 1
                     invalid_job_data = 2
                     jobname_missing  = 3
                     OTHERS           = 4.
                 IF sy-subrc = 0.
                   SUBMIT 'ZDISPLAY_DETAIL'
                   VIA JOB lv_name NUMBER lv_number
                   WITH SELECTION-TABLE lt_rsparams
                   AND RETURN.
                   IF sy-subrc = 0.
    *                Submit
                     CALL FUNCTION 'JOB_CLOSE'
                       EXPORTING
                         jobcount             = lv_number
                         jobname              = lv_name
                         strtimmed            = 'X'
                       EXCEPTIONS
                         cant_start_immediate = 1
                         invalid_startdate    = 2
                         jobname_missing      = 3
                         job_close_failed     = 4
                         job_nosteps          = 5
                         job_notex            = 6
                         lock_failed          = 7
                         OTHERS               = 8.
                  ENDIF.
    Regards,
    Ulrich

  • Open folders in same window (in toolbar control button mode)

    Hi, when I set a finder window to hide the toolbar from view, using the toolbar control button in the top right, the folders open a new window when clicked.
    Is it possible to set them to open in the same window?
    Thanks

    Hi, when I set a finder window to hide the toolbar from view, using the toolbar control button in the top right, the folders open a new window when clicked.
    Is it possible to set them to open in the same window?
    Thanks

Maybe you are looking for

  • PR status incorrect for POs craeted via PUR_ORDER_CREATE_VIA_SD_EVNT functi

    We use the ALE process to create Purchase Orders automaticaly from Sales orders. The standard function module assigned to the Business Object BUS2032 in SWETYPV for ALECREATE is PUR_ORDER_CREATE_VIA_SD_EVNT SAP creates a PR and then converts it into

  • Portal runtime error. in PAR application

    Hello Gurus, i developed my own portal application for change portal password. I used the follow blog for made it: A Change Password Application I compiled (without errors) and deploied application on my portal and i created a new iview based on my P

  • Powering on without presing power button?

    Hi, On my old G5 tower with an old ADC Cinema display, the G5 was hidden under the desk and I used the power button on the monitor to power on the Mac. Same monitor, Apple ADC-DVI adapter, Mac pro. No good - not working! So, is there any way I an eit

  • OIM Custom validation on entitlement request submission.

    Hi, We have a requirement in OIM to do some custom validation on entitlement request submission through catalogue. Can we leverage the requestdatavalidator here. Is there any other way of doing it? Thanks in advance,

  • Intego virus barrier plus on osx lion 10.7.2

    I purchased an intego virus barrier plus at apple store,when I upgraded to osx 10.7.2 it causes problem when I shut down or reboot,my macbook pro will not start,so I re install again the osx 10.7.1 using the dvd disc installer,it start with no proble