How to add push button in application tool bar in SAP transaction VA01

How to add push button in application tool bar in SAP standard transaction VA01 and how to implement the code for that function code.

There is no scope to create a push button in application tool bar. Instead of that we can add in a menu bar.

Similar Messages

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

  • Push buttons on application tool bar , should be changed based on radio but

    Hi fndz,
    i have 2 radio buttons on selection screen.
    depend on the radio button i select , the push buttons on 
    application tool bar of basic list should be changed.
    can u plz help me.
    Thanks & Regards
    kumar

    Hii..
    Parameters : r1 radiobutton group GRP1 ,
                        r2 radiobutton group GRP1 .
    START-OF-SELECTION.
       CASE 'X'.
       WHEN R1.
         SET PF-STATUS 'S1'.
       WHEN R2.
         SET PF-STATUS 'S2'.
       ENDCASE.
    Note: if you want to call the Same GUI Status (app toolbar), you can use the syntax
    SET PF-STATUS 'S1' EXCLUDING <ITAB>
    hope this solves ur issue.

  • How to add button on application tool bar of standard transaction-URGENT

    Hi All,
    Can any one let me know how to ADD the button in on application tool bar of standard transaction by using SHD0 transaction or any other solution.While adding the button I don't want do any code modification.
    Thanks,
    Vijay

    Hi,
      Go through this thread.
       Push Buttons on application toolbar.
    Regards,
    Vani.

  • How to add button on application tool bar of standard transaction

    Hi All,
    Can any one let me know how to ADD the button in on application tool bar of standard transaction by using SHD0 transaction or any other solution.While adding the button I don't want do any code modification.
    Thanks,
    Vijay

    HI
    SHD0 is used to create and maintain Screen and Transaction Variants..
    to know more about Screen and trransaction variants click on this link
    http://help.sap.com/saphelp_47x200/helpdata/en/67/232037ebf1cc09e10000009b38f889/content.htm
    we can create Transaction Variants Using SHD0 Transaction.
    Transaction Variants and Screen Variants
    Transaction variants can simplify transaction runs as they allow you to:
    Preassign values to fields
    Hide and change the 'ready for input' status of fields
    Hide and change table control column attributes
    Hide menu functions
    Hide entire screens
    In particular, hiding fields in connection with screen compression, and hiding screens, can result in greater clarity and simplicity.
    Transaction variants are made up of a sequence of screen variants. The field values and field attributes for the individual screens found in transaction variants are stored in screen variants. Each of these variants is assigned to a specific transaction, can, however, also contain values for screens in other transactions if this is required by transaction flow. The transaction that the variant is assigned to serves as initial transaction when the variant is called.
    There are both client-specific and cross-client transaction variants. All screen variants are cross-client, but may be assigned to a client-specific transaction variant.
    A namespace exists for cross-client transaction variants and screen variants and both are automatically attached to the Transport Organizer. Client-specific transaction variants must be transported manually.
    In principle, transaction and screen variants can be created for all dialog and reporting transactions. There are, however, certain Restrictions that apply to certain transactions, depending on their internal structure.
    No transaction variants are possible with transactions already containing preset parameters (parameter transactions and variant transactions).

  • Icon with push button on application tool bar

    hi
    how we place icon along with pushbutton on application tool bar on selecteion screen.
    thanks in adv

    Hi,
    you can check the code below for test,
    TYPE-POOLS icon.
    TABLES sscrfields.
    DATA functxt TYPE smp_dyntxt.
    Parameters: test(1) TYPE C.
    SELECTION-SCREEN: FUNCTION KEY 1.
    INITIALIZATION.
      functxt-icon_id   = ICON_GRAPHICS.
      functxt-quickinfo = 'graphics'.
      functxt-icon_text = 'Graphics'.
      sscrfields-functxt_01 = functxt.
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
        WHEN 'FC01'.
    Message 'Button 1 pressed' TYPE 'I'.
        WHEN OTHERS.
      ENDCASE.
    START-OF-SELECTION.

  • How to add custom buttons in the tool bar of the crystal reports viewer

    Hi,
    I'm using Crystal report viewer (Crystal 2008) in my report and I want to add custom buttons and handle them in the tool bar of the viewer. Is there anyway to achieve this?
    Please help me in this regard.
    Thanks in advance.
    Siva.

    I did this by adding a picturebox to the toolbar, the same size as the buttons, and loading in an image, and putting code into the Click event of the picturebox.
    I also put code into the MouseHover event to change the picture's background color and into the MouseLeave event to change it back.
    I have a couple of these buttons. They work very nicely and really look like part of the toolbar.

  • How to add push button in function module

    I want to add Push button( yes/no) in same screen. I used POPUP_TO_CONFIRM,
    but this popup is coming on next screen when I click on cancel button.

    There is no scope to create a push button in application tool bar. Instead of that we can add in a menu bar.

  • How to add button on application tool bar of standardt ransaction

    Hi All,
    Can any one let me know how to ADD the button in on application tool bar of standard transaction by using SHD0 transaction or any other solution.While adding the button I don't want do any code modification.
    Thanks,
    Vijay

    http://help.sap.com/saphelp_nw04/helpdata/en/c8/19762743b111d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/83/7a18cbde6e11d195460000e82de14a/frameset.htm
    these are the avilable user Exits for the Tcode..C203
    XCZD0004 Extend authority check for the material-recipe allocati
    CMDI001 Determine explosion control for BOM
    CPAU0001 Enhancement for Authorization Check in Task Lists
    CPDO0001 Test units of measure for reference operation set
    CPRE0001 Enhancement for Reorgnization Checks in Task Lists
    Run this Program.. enter the Tcode. u'ii get teh BADI's exist for the Tcode
    REPORT Z_FIND_BADI .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    Please give me reward points...

  • How to add push buttons in out put screen of ALV

    Hai,
    How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
    Thanks in advance .
    kiran

    Hi Kiran,
    Here is the sample code.If you are using reuse_alv_grid_display, no need to write code in PBO.
    Just double click the 'TEST' which is written in code.Then create a GUI Status.In Application toolbar,type the name of the button you want(say BUTTON).Then double click that name.Then enter the ICON name and function text.Activate it.This itself will work.If you want all the functionalities,then try to do as Vinod told.
    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 '<b>TEST</b>'.
    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
          call transaction 'MM01'.
      endcase.
    endform.

  • How to add push button in alv display with out class or method

    Hai,
    How to add push buttons in out put screen of ALV (tool bar) with out using classes or methods .I want to know using normal ALV .
    Thanks in advance .
    kiran

    You should post your question in the ABAP forum.
    ABAP Development

  • How to Add Push Button On Selection Screen

    Hi Experts,
    How to add Push button on Selection Screen.
    Points will b rewarded for useful help.
    Bohra.

    Hi,
    To create a pushbutton on the selection screen, you use:
    SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>
    USER-COMMAND <ucom> [MODIF ID <key>].
    The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.
    <push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.
    For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREENevent.
    Ex.
    REPORT DEMO.
    TABLES SSCRFIELDS.
    DATA FLAG.
    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.
    CASE SSCRFIELDS.
    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.
    This example defines four pushbuttons on a selection screen that is displayed as a
    dialog box. The selection screen is defined in a statement chain for keyword
    SELECTION-SCREEN.
    If the text symbols TEXT-020 and TEXT-040 are defined as 'Button 2' and 'Button 4',
    the four pushbuttons appear as follows on the selection screen displayed as a dialog box.
    Regards,
    Bhaskar

  • How to hide button in application tool bar

    Hi
    There is a standard SAP report. after executing it,
    There are 5 buttons in application tool bar .
    I want to hide 3 of the buttons,
    How can I hide them not by change program.
    (Ex, can I use transaction variant).
    Best Regards,

    try to use transaction variant....
    Edited by: shan palani on Dec 17, 2008 10:48 AM

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

  • Need to Add a button in ALV Tool Bar

    Hi,
    I have a requirement where in i need to add a button to a standard ALV report. Its using the class CL_GUI_ALV_GRID. There is a Badi for the report. The Report is co05n and the Badi is WORKORDER_INFOSYSTEM . I am getting the handle of
    CL_GUI_ALV_GRID object reference before screen display. Any guidance on how to add new button now to that toolbar?
    Any help will be rewarded.
    Thank you.
    regards,
    Deepthi lakshmi.A.

    Dear Deepthi Lakshmi.A.,
    Refer the standard program BCALV_GRID_05                  Add a Self-Defined Button to the Toolbar.
    PROGRAM BCALV_GRID_05.
    Purpose:
    ~~~~~~~~
    Demonstrate the creation of an own toolbar button.
    To check program behavior
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    The report shows a list of flights of one airline.
    Select one or more lines and press the 'Detail'-Button to popup
    a dialog window with related bookings.
    Essential steps (Search for '§')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1.Apply steps for event handling for events TOOLBAR and
      USER_COMMAND (see example for print events)
    2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
    3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
    4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
    INCLUDE .
    Predefine a local class for event handling to allow the
    declaration of a reference variable before the class is defined.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA: ok_code LIKE sy-ucomm,
          gt_sflight TYPE TABLE OF sflight,
          gt_sbook TYPE TABLE OF sbook,
          g_repid LIKE sy-repid,
          g_max type i value 100,
          gs_layout   TYPE lvc_s_layo,
          cont_on_main   TYPE scrfname VALUE 'BCALVC_TOOLBAR_D100_C1',
          cont_on_dialog TYPE scrfname VALUE 'BCALVC_TOOLBAR_D101_C1',
          grid1  TYPE REF TO cl_gui_alv_grid,
          grid2  TYPE REF TO cl_gui_alv_grid,
          custom_container1 TYPE REF TO cl_gui_custom_container,
          custom_container2 TYPE REF TO cl_gui_custom_container,
          event_receiver TYPE REF TO lcl_event_receiver.
    Set initial dynpro
    SET SCREEN 100.
    LOCAL CLASSES: Definition
    *===============================================================
    class lcl_event_receiver: local class to
                            define and handle own functions.
    Definition:
    ~~~~~~~~~~~
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
      PRIVATE SECTION.
    ENDCLASS.
    lcl_event_receiver (Definition)
    *===============================================================
    LOCAL CLASSES: Implementation
    *===============================================================
    class lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    § 2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        DATA: ls_toolbar  TYPE stb_button.
    E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.
    This class has got one attribute, namly MT_TOOLBAR, which
    is a table of type TTB_BUTTON. One line of this table is
    defined by the Structure STB_BUTTON (see data deklaration above).
    A remark to the flag E_INTERACTIVE:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            'e_interactive' is set, if this event is raised due to
            the call of 'set_toolbar_interactive' by the user.
            You can distinguish this way if the event was raised
            by yourself or by ALV
            (e.g. in method 'refresh_table_display').
            An application of this feature is still unknown...
    append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    append an icon to show booking table
        CLEAR ls_toolbar.
        MOVE 'BOOKINGS' TO ls_toolbar-function.
        MOVE icon_employee TO ls_toolbar-icon.
        MOVE 'Show Bookings'(111) TO ls_toolbar-quickinfo.
        MOVE 'Detail'(112) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.
      METHOD handle_user_command.
    § 3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'BOOKINGS'.
            CALL METHOD grid1->get_selected_rows
                     IMPORTING et_index_rows = lt_rows.
            CALL METHOD cl_gui_cfw=>flush.
            IF sy-subrc ne 0.
    add your handling, for example
              CALL FUNCTION 'POPUP_TO_INFORM'
                   EXPORTING
                        titel = g_repid
                        txt2  = sy-subrc
                        txt1  = 'Error in Flush'(500).
            else.
                      perform show_booking_table tables lt_rows.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.
    lcl_event_receiver (Implementation)
    *===================================================================
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    The instance grid2 is freed not until the program exits from the
    main screen.
    (It is created only once during the first selection of SBOOK,
    no matter how many times the second window is called).
      CALL METHOD custom_container1->free.
      IF not custom_container2 is initial.
        CALL METHOD custom_container2->free.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc ne 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = g_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in Flush'(500).
      ENDIF.
      LEAVE PROGRAM.
    ENDFORM.
    *&      Module  PBO_100  OUTPUT
          text
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      g_repid = sy-repid.
      IF custom_container1 is initial.
    select data from table SFLIGHT
        PERFORM select_table_sflight CHANGING gt_sflight.
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container1
            EXPORTING
                container_name = cont_on_main
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc ne 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
               EXPORTING
                    titel = g_repid
                    txt2  = sy-subrc
                    txt1  = 'The control could not be created'(510).
        ENDIF.
    create an instance of alv control
        CREATE OBJECT grid1
               EXPORTING i_parent = custom_container1.
    Set a titlebar for the grid control
        gs_layout-grid_title = 'Flights'(100).
    allow to select multiple lines
        gs_layout-sel_mode = 'A'.
        CALL METHOD grid1->set_table_for_first_display
             EXPORTING i_structure_name = 'SFLIGHT'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_sflight.
    ->Create Object to receive events and link them to handler methods.
    When the ALV Control raises the event for the specified instance
    the corresponding method is automatically called.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_user_command FOR grid1.
        SET HANDLER event_receiver->handle_toolbar FOR grid1.
    § 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
        CALL METHOD grid1->set_toolbar_interactive.
      ENDIF.                               "IF grid1 IS INITIAL
      CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid1.
    ENDMODULE.                             " PBO_100  OUTPUT
    *&      Module  PAI_100  INPUT
          text
    MODULE pai_100 INPUT.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI_100  INPUT
    *&      Module  PBO_0101  OUTPUT
          text
    MODULE pbo_0101 OUTPUT.
      IF custom_container2 is initial.
    (the data from sbook is already selected)
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container2
            EXPORTING
                container_name = cont_on_dialog
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc ne 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
               EXPORTING
                    titel = g_repid
                    txt2  = sy-subrc
                    txt1  = 'The control could not be created'(510).
        ENDIF.
    create an instance of alv control
        CREATE OBJECT grid2
               EXPORTING i_parent = custom_container2.
    change title
        gs_layout-grid_title = 'Bookings'(101).
        gs_layout-sel_mode = ' '.
        CALL METHOD grid2->set_table_for_first_display
             EXPORTING i_structure_name = 'SBOOK'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_sbook.
      ELSE.
        CALL METHOD grid2->refresh_table_display.
      ENDIF.                               "IF custom_container2 IS INITIAL.
      CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid2.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc ne 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = g_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in Flush'(500).
      ENDIF.
    ENDMODULE.                             " PBO_0101  OUTPUT
    *&      Form  SELECT_TABLE_SFLIGHT
          text
         <--P_GT_SFLIGHT  text
    FORM select_table_sflight CHANGING p_gt_sflight LIKE gt_sflight[].
      SELECT * FROM sflight INTO TABLE p_gt_sflight up to g_max rows.
    ENDFORM.                               " SELECT_TABLE_SFLIGHT
    *&      Form  SELECT_TABLE_SBOOK
          text
         -->P_LS_SFLIGHT  text
         <--P_GT_SBOOK  text
    FORM select_table_sbook USING    p_ls_sflight LIKE LINE OF gt_sflight
                            CHANGING p_gt_sbook LIKE gt_sbook[].
      DATA: lt_sbook LIKE gt_sbook[].
    Select data from sbook according to a line of sflight
    and append that data to table p_gt_sbook
      SELECT * FROM  sbook INTO TABLE lt_sbook
             WHERE  carrid  = p_ls_sflight-carrid
             AND    connid  = p_ls_sflight-connid
             AND    fldate  = p_ls_sflight-fldate.
      APPEND LINES OF lt_sbook TO p_gt_sbook.
    ENDFORM.                               " SELECT_TABLE_SBOOK
    *&      Module  PAI_0101  INPUT
          text
    MODULE pai_0101 INPUT.
      CASE ok_code.
        WHEN 'RETURN'.
          LEAVE TO SCREEN 0.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI_0101  INPUT
    *&      Form  show_booking_table
          text
         -->P_ET_INDEX_ROWS  text
    FORM show_booking_table TABLES p_et_index_rows
                                    STRUCTURE lvc_s_row.
      DATA: ls_selected_line LIKE lvc_s_row,
            lf_row_index TYPE lvc_index,
            ls_sflight LIKE LINE OF gt_sflight.
      CLEAR gt_sbook[].
      LOOP AT p_et_index_rows INTO ls_selected_line.
        lf_row_index = ls_selected_line-index.
    read selected row from internal table gt_sflight
        READ TABLE gt_sflight INDEX lf_row_index INTO ls_sflight.
    select corresponding lines of table sbook
    and append new lines to global table
        PERFORM select_table_sbook USING ls_sflight
                                   CHANGING gt_sbook.
      ENDLOOP.
    call dialog screen and display new alv control
      CALL SCREEN 101 STARTING AT 10 5.
    ENDFORM.                               " show_booking_table
    Regards,
    Naveen.

Maybe you are looking for

  • I can't print whit a printer connected to a base airport extreme (bonjour)

    Above all Sorry for my English and a big Ciao! to all the users. My problem: I can't print with an Epson Stylus photo R220 connected with an airport base express (WDS remote in a little network with an airport base estreme first generation) Printer u

  • Lion 10.7 - application switches spaces when opened from finder

    I am using Lion 10.7 , I assigned dreamweaver to desktop1 by choose Options > This Desktop when in desktop1. Then relaunch DW and it correctly opened in desktop 1. Now if i open a file using in finder (which is itself assigned to desktop3) on a file

  • Air and .xls file

    Here is my sample test for opening an xls file in iframe My HelloWord.html : <html> <head> <title>Dierbergs Web Applications</title> <script language="javascript" type="text/javascript" src="AIRAliases.js"></script> <script language="javascript"> fun

  • URGENT ISSUE: Line In Lag

    URGENT ISSUE: Line In Lag? Hello everyone, for Christmas I got a brand new computer with Windows 7 and a Soundblaster X-Fi card. I got this new computer to record music. I was horrified to find out that when I record guitar, vocals, or anything else

  • Sticky notes added to front  face of phone

    Just like on your computer sticky notes can be brought up and dropped down. Notepad is good for storing important stuff but you have to go thru so many steps to get to it. Sticky notes would be great for those everyday reminders like go to the bank /