Creating buttons on title bar using alv

hi all good morning,
can any one help me in making a button on title bar of ALV report. Till now i have used only one function of ALV i,e REUSE_ALV_GRID_DISPLAY. it is showing proper out put but i want to make some action using my own button on the final ALV result displayed like save change etc.

Hi,
How to add button to ALV toolbar using REUSE_ALV_LIST_DISPLAY?
In the program which calls ALV using REUSE_ALV_LIST_DISPLAY,
I have to add a new button.
I saw the demo program BCALV_GRID_08, which is written using ABAP-Controls.
In that example, the button is added using TOOLBAR event of cl_gui_alv_grid.
Could you help me to implement the same logic using REUSE_ALV_LIST_DISPLAY parameters.
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 such as sorting/subtotaling etc...
When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name.
an example of one of mine:
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZSDBOLST_REPORT'
i_callback_pf_status_set = 'STANDARD' <----
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'I_BOLACT'
i_grid_title = 'BOL Action Report'(031)
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_save = 'A'
is_variant = v_variant
TABLES
t_outtab = i_bolact
EXCEPTIONS
program_error = 1
others = 2.
I just tried the same procedure ,but my entire application toolbar disappeared and a lock icon appears next to the application toolbar in my copied pf-status.
Could you advice what might have gone wrong ?
As identified with the FM's help you can do the following.
1). Using SE80 (I think) you can copy a GUI status from one program to another. It mentions which one in the FM's help.
2). Create a form named like so:
Code:
Form Set_pf_status
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "Set_pf_status
In the above case the GUI status copied was named ZSTANDARD and adjusted accordingly, adding and removing the desired buttons. A button was added called '%DELETE'.
3). Create the following report:
Code:
Form User_command
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
Detects whether the icon/button for
'Return Tag Deletion' has been pressed. If it has then
detect whether any rows have been highlighted and then
set the delete flag.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: li_count TYPE I.
IF r_ucomm EQ '%DELETE'.
LOOP AT %g00 WHERE mark EQ 'X'.
ADD 1 TO li_count.
ENDLOOP.
IF li_count GT 0.
gc_delete_flag = 'X'.
r_ucomm = '&F03'. "Back arraow
ELSE.
MESSAGE W000 WITH 'Please highlight the rows to be deleted!'.
ENDIF.
ENDIF.
ENDFORM. "User_command
As I've added an extra button to indicate which records should be deleted I need to identify a form to be called to process when this button is chosen.
Then when you call the ALV function you to specify the following extra details:
Code:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting i_callback_program = gc_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_grid_title = lc_grid_title
is_layout = lc_layout
it_fieldcat = gt_fieldcat
it_sort = sort
i_save = l_save
is_reprep_id = l_bbs_id
is_variant = l_variant
tables t_outtab = %g00
exceptions program_error = 1
others = 2.
The parameters in capitals are the extra ones that need to be added.
Regards,
Satish

Similar Messages

  • Removing the minimize button from Title bar...

    Hi,
    I have created an desktop application using swing. I dont need minimized button on title bar of the main window. I searched a lot but could not find a solution. Can I get some useful links.
    What can I do ?
    Thanks

    Actually I want if the application is minimized, its state should not changed to iconified but it simple because hidden. And using the tray icon's option if application is open, it simple make the application visible. I did not want the following case which is happening right now.
    Case:
    1. I Minimized the application
    2. My application state becomes the iconified and it becomes hidden (As I have implemented the windowlistener)
    3. I used trayicon's Open option (it simply visible the application)
    4. Application becomes visible, but it is in iconified state. Because previously its state has been changed due to minimized button.I want whenever the Open option of tray icon is used, application must be visible in Maximized state. That why I also did on action listener of Open option
                            application.setState(NORMAL);
                            application.setExtendedState(MAXIMIZED_BOTH);
                            application.setVisible(true);That's why I planned to removed the minimize button from Title bar. But if it not possible then how can I avoid changing state of application when minimized button is used.
    thanks
    Jawahar Nayak

  • To disappear / disable buttons on title bar of JDialog

    hi,
    i want a non-modal JDialog without any buttons on tilte bar.
    i.e i dont want to have the X close button on tilte bar. how can i achieve this
    thanx

    by setting undecorated true whole of the tilte bar goes off. but i just want
    to remove the close button on title bar. any how i found the soln by setting
    setDefaultLookAndFeelDecorated(true) which removes the close button
    from title bar.
    if there is any other method plz suggest

  • Issue with the FR translation for toolbar buttons and title bar

    Hi All,
    In a report program I have a toolbar with some custom buttons and icons (GI Status) and I have a title bar (GUI Title) with the report heading.
    I have FR translations defined for them in SE63, but they are not actually displayed when I run report in FR language.
    All other translation work fine, only GUI Status and GUI Title translations donu2019t work.
    Your help will be highly appreciated.
    Sagar

    hi sagar,
    1.go to se41
    2. give the report name
        and status name.
    3.then change mode
    then click on application tool bar
    4.menu GOTO---->TRANSLATION
    5. here you can change from EN to FR
    reward me if it is useful
    thanks
    AM

  • Problem while placing a button in the Output using ALV OOPs

    Hi,
    I am using ALV OOPs to display  report output.
    In the toolbar i have to palce an update button  and if i click on that update it should then call the selection screen 500 .
    So,please  help me to achieve this using ALV OOPs.
    THANKS & REGARDS,
    Kiranmai.

    Hi,
    you can use set pf-status statement with the OOPs' concept where in you will have to give this in the events table and pass it to the method to display the alv ...
    Regards,
    Siddarth

  • Add new button on title bar of JFrame

    how can i add new button (like minimize, maximize and close) on title bar of JFrame.
    actually i want a new button for system try icon. if user click on this button JFrame will hide and system try icon will be visible

    Hi,
    Check out this Thread.
    Hope that help,
    Jack

  • Harcopy button visible title bar

    Hello,
    sometimes I see in some VI's a Hardcopy button visible in the window title bar (on the left of minimize/maximize and close button) but I fonud now way to configure this!
    Maybe this is a Windows functionality, but does some know how to setup this?

    I think you're referring to this:
    http://404techsupport.wordpress.com/2008/04/02/configuring-hardcopy-to-do-everything-you-want-and-mo...

  • Render JFrame title bar using java not by os

    i need to render JFrame title bar text , any one help me, i need detail example
    with example code, pleae dont provide any sigle line help. cause i have tired all the way .

    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFrame.html#setDefaultLookAndFeelDecorated(boolean)

  • How to inactive the push button on tool bar of alv report

    hi masters,
    i m working on the ALV interactive report, in this report i have to do 2 different operation on 2 screen.
    eg.- on first screen i have the push button for 'data' and on second screen i will have the push button for 'upload'.
    in this i don't want to give the 'upload' button on first screen and same i don't want to give the 'data' button on 2nd screen.
    i tried with using the 2 different gui status and 2 different PF-STATUS but its not working.
    anyone can tell me how i can deactivate the 'upload' button on first screen and how i can do same for 'get' buttton on 2nd screen.
    regards,
    vicky

    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

  • Problem with refresh button in tool bar in ALV

    hello experts,
                              I am displaying a report using OOPS ALV. Here i am deleting one row. After deleting the row, if i clicked on REFRESH button in the tool bar, it should display the table newly with all updations which i made. wat is the code to perform dis.
                                                      thanks in adance,

    in normal ALV we can refresh using     sel-refresh = 'X'.
    in OOPS ALV
    IF wa_toolbar-function = '&REFRESH'.
            wa_toolbar-function = 'REFRESH'.
            wa_toolbar-disabled = gc_x.
            MODIFY e_object->mt_toolbar FROM wa_toolbar
                              TRANSPORTING function disabled.

  • How to create custom signal/battery bar using j2me?

    first of all im trying to create the symbian UI from scratch .... but j2me comes with a fixed signal bar ... can i change it ???
    second is it possible 2 create the UI using j2me ??
    thank u

    Hi,
    the top bar management is always under the operating system control. You can use full screen mode to cover full screen, however some diveces can still show the bar. Another option is to use Game Canvas instead of Canvas which might on some devices utilize even "more full" screen mode.
    Some manufacturers add special .jad properties to utilize really full screen.
    Summary: this is really manufacturer/device dependent.
    Of course you can build your own UI completely - simply using the Canvas and paint it on your own. There are several UIs available for Java ME. However the most comprehensive and free is probably the LWUIT supported directly by Oracle. See: [http://lwuit.java.net/|http://lwuit.java.net/] and/or [http://www.oracle.com/technetwork/java/javame/javamobile/download/lwuit/index.html|http://www.oracle.com/technetwork/java/javame/javamobile/download/lwuit/index.html]
    Rada

  • How do i create a custom title bar

    I want to create a title banner on the bottom of my video that is a jpg...  basically, i want to layor the jpg on the bottom of my video.  How do i do that?

    You put it on top of the video in the timeline and make the duration the length of your project.

  • Fullscreen Tool Button in Title Bar

    Hi,
    I'm developing with the Developer Preview. I notice that several Windows 10 Apps have a tool button next to the minimize, restore, maximize buttons that is used to toggle full screen on and off. Its a diagonal double sided arrow. I don't get that for free
    in my Windows Store Application apparently. What do I have to do to get that tool button in my app?
    Thanks
    Brian

    I see what happened, the project you sent me is the result of the Windows 10 template, as you can see in the following screenshot:
    The template that adds the full screen toggle button that you describes, is in a different template, as you can see in the following screenshot:
    Hope this helps.

  • Minimize, maximize, and close buttons in title bar...

    i have a mac, the tiger model, and my three buttons are grey. for safari and all other windows. usually they are red, green, and yellow, but mine are just grey. how, if i can, do i change these to the red, yellow, and green color? preferably without downloading any kind of application or program.

    The gadgets are gray if the window is not active. If you activate the window then their colors should return.

  • Creating the GUI Buttons on Tu0131tle Bar of the Reports

    Hi,
    How can i create the buttons on title bar of my report as CL_GOS_MANAGER?
    the CL_GOS_MANAGER interface is creating a button on title bar of a report to open gos manager popup window.
    i want to do same as this method. i want to create my button.
    Can somebody help me pls?
    Thanks.

    Thank you for your reply,
    i've created a gui button on title bar with this code at INITIALIZATION;
    DATA: lo_container TYPE REF TO cl_gui_gos_container,
            lo_dialogbox TYPE REF TO cl_gui_dialogbox_container,
            lo_toolbar TYPE REF TO cl_gui_toolbar.
      DATA: lo_menu TYPE REF TO cl_ctmenu.
      DATA lt_event TYPE cntl_simple_events.
      DATA ls_event TYPE cntl_simple_event.
      DATA lp_style TYPE i.
      DATA lp_icon TYPE iconname.
      DATA lp_butn_type TYPE tb_btype.
      DATA lp_url(30).
      DATA lp_quick TYPE iconquick.
      DATA lp_nobut TYPE c.
      GET PARAMETER ID 'SGOSNOBUT' FIELD lp_nobut.
      CHECK lp_nobut IS INITIAL.
      lp_style = cl_gui_control=>ws_visible.
    *  IF CL_GOS_STARTER->go_container IS INITIAL.
        CREATE OBJECT lo_container
          EXPORTING
            width             = 58
            no_autodef_progid_dynnr = 'X'
          EXCEPTIONS
            OTHERS            = 5
        CHECK sy-subrc = 0.
        CREATE OBJECT lo_toolbar
          EXPORTING parent = lo_container.
        CALL FUNCTION 'ICON_CREATE'
          EXPORTING
            name       = 'ICON_PDF'
            add_stdinf = space
          IMPORTING
            RESULT     = lp_icon
          EXCEPTIONS
            OTHERS     = 0.
    *    IF gp_frontend = 'ITS'.
    ** insert menubutton
    *      lp_butn_type = 2.
    *    ELSE.
    ** insert menubutton with default
    *      lp_butn_type = 1.
    *    ENDIF.
        lp_quick = text-001.
        CALL METHOD lo_toolbar->add_button
          EXPORTING
            fcode     = '%MY_BUTTON'
            icon      = lp_icon
            butn_type = lp_butn_type
            quickinfo = lp_quick.
    * register events as system events.
        CLEAR lt_event.
        ls_event-eventid = cl_gui_toolbar=>m_id_function_selected.
        ls_event-appl_event = space.
        APPEND ls_event TO lt_event.
        ls_event-eventid = cl_gui_toolbar=>m_id_dropdown_clicked.
        ls_event-appl_event = space.
        APPEND ls_event TO lt_event.
        CALL METHOD lo_toolbar->set_registered_events
          EXPORTING
            events = lt_event.
    *    SET HANDLER on_function_selected FOR lo_toolbar.
    *  ELSE.
    *    CALL METHOD show.
    *  ENDIF.
    *  SET HANDLER on_dropdown_clicked  FOR lo_toolbar.
      call method cl_gui_cfw=>flush.
    but i didn't find where button clicked is falling.
    Thanks again.

Maybe you are looking for

  • Seelcting records with most recent date

    Hello Friends I am new to this group. I am having a set of records as follows in a table col1,col2, col3(dd/mm/yyyy) 1 abc 1/1/2007 1 def 2/1/2007 2 ghi 1/1/2007 2 --- 3/1/2007 (No value in col2) 3 jkl 1/1/2007 3 mno 4/1/2007 I would like the output

  • ComboBox set width problem

    Hey all, Has anyone experienced this, when i give a preferred width to my comboBox, and i use it for the first time, the drop down is still the same size. When the comboBox is again pressed, the dropdown comes with the given size. Please see the link

  • Put iView UNDER Detailed Navigation on certain pages

    Hey guys, anyone have a hint on this?? I want to have some pages (some - not all where an iView is displayed under the Detailed Navigation iView. I have tried to put the standard DTN iView onto the page together with the rest of the content but this

  • Im in the UK can i buy itunes videos off the U S A itunes

    hi iv noticed that the U S A itunes store has more music video choice that the U K itunes so is it possible to but videos from the U S A itunes

  • HELP! - Multiple ID's Here

    This is the one I want to use. However, after the community split from verizon I lost access to this account. Now, the only time I can access this community with this ID is to reset the password. I would like some help in migrating this User Name to