Calling screens in ALV

hello all,
       i need to call screens like that of basic data of a particular material number selected from the secondary list of an ALV report. is it the same way as in an ordinary report that i have to proceed or is there other method.
   Do i have to put buttons in appln tool bar of secondary window of ALV report using set pf status or is there any other method???
kindly advice.
thanks in advance,
seenu
Message was edited by:
        srisri
Message was edited by:
        srisri

Hello,
Define a local class as shown:
CLASS lcl_eh DEFINITION.
PUBLIC SECTION.
DATA:ls_wa2_schd_lines TYPE ts_schd_lines,
lv_flag,
ls_toolbar TYPE stb_button,
lt_selected_rows TYPE lvc_t_roid,
ls_selected_row TYPE lvc_s_roid,
lv_counter TYPE i VALUE 0.
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.
ENDCLASS. "lcl_eh DEFINITION
CLASS lcl_eh IMPLEMENTATION.
*METHOD: HANDLE_TOOLBAR
*DESCRIPTION: This method provides the necessary detail required to
create an extra button in the toolbar.
METHOD handle_toolbar.
CLEAR ls_toolbar.
MOVE 'SELECT' TO ls_toolbar-function.
MOVE 0 TO ls_toolbar-butn_type.
MOVE 'SELECT' TO ls_toolbar-text.
MOVE 'SELECT'  TO ls_toolbar-icon.
MOVE 'SELECT'  TO ls_toolbar-quickinfo.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD. "handle_toolbar
*METHOD: HANDLE_USER_COMMAND
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'SELECT'  .
CALL METHOD gv_alv->get_selected_rows
IMPORTING
ET_INDEX_ROWS =
et_row_no = lt_selected_rows.
READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
READ TABLE gt_it_schd_lines INTO
gs_wa_schd_lines INDEX<b> ls_selected_row-row_id.</b>
You get the data of the row selected.Now call the screen
Call screen 200.
Before you call the method
SET_TABLE_FOR_FIRST_DISPLAY,you need to set the handlers.
CREATE OBJECT object_ref.
SET HANDLER object_ref->handle_toolbar FOR gr_alvgrid.
SET HANDLER object_ref->handle_user_command FOR gr_alvgrid.
Now call the method SET_TABLE_FOR_FIRST_DISPLAY.
regards,
Beejal
**Reward if this helps

Similar Messages

  • Can we call screen from ALV report

    Hi All,
    I am in the process of creating a stand alone application. However I have stuck up here.
    Problem: Can we call any screen from ALV report? If yes then how??? Can anyone give some code snippet??
    All your help appreciated.
    Thanks,
    Jignesh

    Hello Jignesh,
    Here is an example, when you double click on a line, it pops with with another screen that holds details for the flight information.
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click FOR EVENT double_click
                            OF cl_gui_alv_grid
                            IMPORTING e_row
                                      e_column.
       ENDCLASS.                    "lcl_event_handler
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_double_click.
        READ TABLE it_flight INTO wa_flight INDEX e_row-index.
        IF sy-subrc EQ 0.
          SELECT * FROM sbook
                   INTO TABLE it_book
                   WHERE carrid EQ wa_flight-carrid AND
                         connid EQ wa_flight-connid.
          CALL SCREEN 101 STARTING AT 10 10.
        ENDIF.
      ENDMETHOD.                 "HANDLE_DOUBLE_CLICK
    ENDCLASS.                    "LCL_EVENT_HANDLER
    MODULE status_0101 OUTPUT.
    Variant to save the layout
      gv_repid = sy-repid.
      IF g_custom_container2 IS INITIAL.
    Create an instance for Custom Container 'ALV_GRID'
        CREATE OBJECT g_custom_container2
               EXPORTING container_name = gs_container2.
    Create an instance for ALV Grid
        CREATE OBJECT g_grid2
               EXPORTING i_parent = g_custom_container2.
    Variant to save the layout
        gs_layout-grid_title = 'Flight Bookings'.
        CALL METHOD g_grid2->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SBOOK'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = it_book[].
      ELSE.
        CALL METHOD g_grid2->refresh_table_display.
      ENDIF.                               "IF grid2 IS INITIAL.
    Setting focus for created grid control
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = g_grid2.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                 " status_0101  OUTPUT
    Refer to BC_ALV_GRID04 for ALV data declarations used in the above piece of code.

  • ALV not getting refreshed when call screen is executed second time

    I have 2 screens 9001 and 9002. In 9001 , I am displaying the fields of a database table in a Table Control. The user has to select some of those fields and click on a button 'Generate ALV'. After clicking , the control navigates to 9002 where I am displaying ALV with data in the selected fields(the other fields remain empty). (using custom container)
    Now there is BACK button in 9002 where i have written LEAVE TO SCREEN  9001. After this if the user again make changes in column selection and click on 'Generate ALV' , then still the old alv data is displayed. (Mind you the structure of alv is same , only the selected fields should show data).
    I am using REFRESH_ALV_DISPLAY also and when i tested this function independently , its working fine (although for interactive alv in the same screen).
    I am making use of <fs> for dynamic internal table and i checked it using breakpoints , during the 2nd time , it contains the correctly updated data so i think the problem lies with alv
    Kindly check this code
    MODULE STATUS_9002 OUTPUT.
      SET PF-STATUS 'ZALV'.
    *  SET TITLEBAR 'xxx'.
      CREATE OBJECT C_CONT
        EXPORTING
          CONTAINER_NAME               = 'CUST_CONT'
      IF SY-SUBRC <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    IF OBJ_ALV IS INITIAL.
      CREATE OBJECT OBJ_ALV
        EXPORTING
          I_PARENT           = C_CONT
      CALL METHOD OBJ_ALV->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           I_STRUCTURE_NAME              = INP_TABLE
         CHANGING
          IT_OUTTAB                      = <itab>
    ELSE.
       CALL METHOD OBJ_ALV->REFRESH_TABLE_DISPLAY
      ENDIF.
    ENDMODULE.                 " STATUS_9002  OUTPUT
    Edited by: amber22 on Sep 16, 2011 6:45 PM

    Amber,
    Something like:
    *&      Module  STATUS_9001  OUTPUT
    MODULE status_9001 OUTPUT.
      SET PF-STATUS 'ST9001'.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'GEN'.
          SELECT * FROM spfli INTO TABLE gt_outtab.
          CALL SCREEN 9002.
        WHEN 'BACK'.
          LEAVE.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9002  OUTPUT
    MODULE status_9002 OUTPUT.
      SET PF-STATUS 'ST9002'.
      IF obj_alv IS INITIAL.
        CREATE OBJECT c_cont
          EXPORTING
            container_name = 'CUST_CONT'.
        CREATE OBJECT obj_alv
          EXPORTING
            i_parent = c_cont.
        CALL METHOD obj_alv->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SPFLI'
          CHANGING
            it_outtab        = gt_outtab.
      ELSE.
        CALL METHOD obj_alv->refresh_table_display.
      ENDIF.
    ENDMODULE.                 " STATUS_9002  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
    MODULE user_command_9002 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          CALL METHOD: obj_alv->free, c_cont->free.
          CLEAR: obj_alv, c_cont.
          CALL METHOD cl_gui_cfw=>flush.
          LEAVE TO SCREEN 9001.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9002  INPUT
    Altough it's not a really nice solution... Why using 2 screens for example? you could use two containers instead...
    Also I would recommand playing with the new salv class for your grids.
    Anyway don't hesitate to give feed-back.
    Kr,
    m.

  • In CL_GUI_SPLITTER_CONTAINER  ALV list  is not show in called screen

    Hello experts,
    i come across a problem while using the class:CL_GUI_SPLITTER_CONTAINER ,
    my codes is as follows:
    data:declarations is as follows:
                 data:gr_spliter     TYPE REF TO cl_gui_splitter_container,
                         gr_container1  TYPE REF TO cl_gui_container,
                         gr_container2  TYPE REF TO cl_gui_container,
                         gr_grid1       TYPE REF TO cl_gui_alv_grid,
                         gr_grid2       TYPE REF TO cl_gui_alv_grid,
    step 0  Fit  table contents:gt_out1 and gt_out2
    step 1:   CREATE OBJECT gr_spliter
                   EXPORTING
                   parent            = cl_gui_container=>screen0
                   ows               = 1
                   columns         = 2
    step 2:  CALL METHOD gr_spliter->get_container
                 EXPORTING
                 row       = 1
                column    = 1
                RECEIVING
                container = gr_container1.
                CALL METHOD gr_spliter->get_container
                 EXPORTING
                 row       = 1
                column    = 2
                RECEIVING
                container = gr_container2.
    step 3 :call screen 100 to show ALV.
    in the screen's PBO ,i show ALV using CL_GUI_ALV_GRID,the codes is:
       CREATE OBJECT gr_grid1
        EXPORTING
          i_parent          = gr_container1
       CREATE OBJECT gr_grid2
        EXPORTING
          i_parent          = gr_container2
      CALL METHOD gr_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name              =  Structure of table Gt_OUT1
        CHANGING
          it_outtab                     = gt_out1
    CALL METHOD gr_grid2>set_table_for_first_display
        EXPORTING
          i_structure_name              =  Structure of table Gt_OUT2
        CHANGING
          it_outtab                     = gt_out2
    But after activing the program ,there is no ALV show in screen 100,I debug the program and find that
    all the above object have been created corredtly.
    if i create a custom contol named 'CONTAINER',and at Step 1 change the parent's value to 'CONTAINER',
    then i could see the ALV whick i hope in screen 100.
    If i create a custom control in screen 100, the size of the alv will be different across different computer,
    is it possible to use CL_GUI_CONTAINER=>screen0 as cl_gui_splitter_container's attribute parent  value???
    and i find that there are 10 attributes named screen0 to screen9 in class CL_GUI_CONTAINER,will you tell me the usage of
    these attributes?
    now i only konw that ,you could set a containers parent value to be CL_GUI_CONTAINER=>screen0,which you do't have to create
    a custom control in your screen ,and the alv will be shown in full screen.and what the other attributes use (screen1,screen2,screen3,screen4 and so on)
    now i am confused with the problem,i am sure any words from you will give me help to this question!
    Hope to receive your advice!
    Best regards!
    yours Carl
    Edited by: lakeandmoon on Aug 27, 2010 11:24 AM

    Dear Carl,
    I mean go to screen painter and place there CUSTOM_AREA (the icon with C letter). In program's PBO create CUSTOM_CONTAINER
    module pbo output.
    if custom_container is initial.
    CREATE OBJECT custom_container
       EXPORTING container_name = 'CUSTOM_AREA'.\
    endif.
    endmodule.
    Then you work only with CUSTOM_CONTAINER (i.e. as parent to SPLITTER_CONTAINER). Using subscreens here doens't really add the value, so you don't need any.
    But how could i stretch the screen and this area to full screen?is it just gragging the screen to full screen and drag the subscreen or the custom control to full screen in screen painter?
    Yes, this is what I mean
    Regards
    Marcin

  • Call Transaction in ALV GRID Display

    Hi All,
    i have an ALV list .( list of Invoices) i want to call  trans.
    VF03 from clicking the line .
    i have also used User Command, events  in ALV function .
    as mention below , but cant able to call transaction.
    in ALV line is selected but not working or moves to another Tcode as VF03 with parameter id .
    please help me in this , if any body can ?
    thanks in advance
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_INTERFACE_CHECK        = G_INTERFACE_CHECK
          I_CALLBACK_PROGRAM       = GV_REPID
          IT_FIELDCAT              = GT_FIELDCAT[]
          I_DEFAULT                = 'X'
          I_SAVE                   = 'A'
          IS_LAYOUT                = LAYOUT_IN
          IS_VARIANT               = VARIANT_DETAIL
          IT_EVENTS                = EVENTCAT
         I_CALLBACK_PF_STATUS_SET = 'SET_STATUS'
          I_CALLBACK_USER_COMMAND  = USER_COMMAND
          I_GRID_TITLE             = 'Tax Report : GRN'
        I_CALLBACK_TOP_OF_PAGE   = 'page_header'
        I_BACKGROUND_ID          = 'ALV_BACKGROUND'
        IS_PRINT                 = ALV_PRINT
        IMPORTING
          ES_EXIT_CAUSED_BY_USER   = LS_EXIT_BY_USER
      TABLES
        T_OUTTAB                 = IT_VBRP
      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-SGV4.
      ENDIF.
    Nitin

    HI,
    check the sample code which call the transaction VA02.
    type-pools: slis.
    types: BEGIN OF TY_KNA1,
    KUNNR TYPE KUNNR,
    NAME1 TYPE NAME1,
    ORT01 TYPE ORT01,
    END OF TY_KNA1.
    TYPES: BEGIN OF TY_VBAK,
    VBELN TYPE VBELN,
    ERNAM TYPE ERNAM,
    ERDAT TYPE ERDAT,
    NETWR TYPE NETWR,
    WAERK TYPE WAERK,
    END OF TY_VBAK.
    *&--WORK AREA & TABLE DECLARATION--
    DATA: W_KNA1 TYPE TY_KNA1.
    DATA: T_KNA1 TYPE STANDARD TABLE OF TY_KNA1 INITIAL SIZE 1.
    DATA: W_VBAK TYPE TY_VBAK.
    DATA: T_VBAK TYPE STANDARD TABLE OF TY_VBAK INITIAL SIZE 1.
    *&--FIELDCAT TABLE & WORK AREA--
    DATA: W_FCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: T_FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA: W_FCAT1 TYPE SLIS_FIELDCAT_ALV.
    DATA: T_FCAT1 TYPE SLIS_T_FIELDCAT_ALV.
    *&--EVENT TABLE AND WORK AREA--
    DATA: W_EVENTS TYPE SLIS_ALV_EVENT.
    DATA: T_EVENTS TYPE SLIS_T_EVENT.
    DATA: W_EVENTS1 TYPE SLIS_ALV_EVENT.
    DATA: T_EVENTS1 TYPE SLIS_T_EVENT.
    *&--COMMENT TABLE & WORK AREA--
    DATA: W_COMMENT TYPE SLIS_LISTHEADER.
    DATA: T_COMMENT TYPE SLIS_T_LISTHEADER.
    DATA: W_COMMENT1 TYPE SLIS_LISTHEADER.
    DATA: T_COMMENT1 TYPE SLIS_T_LISTHEADER.
    APPENDING FCAT -
    W_FCAT-COL_POS = 1.
    W_FCAT-FIELDNAME = 'KUNNR'.
    W_FCAT-SELTEXT_M = 'CUST. NO'.
    W_FCAT-HOTSPOT = 'X'. "HOT SPOT HAND SYMBOL
    W_FCAT-EMPHASIZE = 'C119'. "FOR COLORING THE COLUMN 1
    APPEND W_FCAT TO T_FCAT.
    CLEAR W_FCAT.
    W_FCAT-COL_POS = 2.
    W_FCAT-FIELDNAME = 'NAME1'.
    W_FCAT-SELTEXT_M = 'CUST. NAME'.
    APPEND W_FCAT TO T_FCAT.
    W_FCAT-COL_POS = 3.
    W_FCAT-FIELDNAME = 'ORT01'.
    W_FCAT-SELTEXT_M = 'CITY'.
    APPEND W_FCAT TO T_FCAT.
    W_FCAT1-COL_POS = 1.
    W_FCAT1-FIELDNAME = 'VBELN'.
    W_FCAT1-SELTEXT_M = 'ORDER NO'.
    W_FCAT1-EMPHASIZE = 'C519'.
    APPEND W_FCAT1 TO T_FCAT1.
    CLEAR W_FCAT.
    W_FCAT1-COL_POS = 2.
    W_FCAT1-FIELDNAME = 'ERNAM'.
    W_FCAT1-SELTEXT_M = 'NAME OF PARTY'.
    APPEND W_FCAT1 TO T_FCAT1.
    W_FCAT1-COL_POS = 3.
    W_FCAT1-FIELDNAME = 'ERDAT'.
    W_FCAT1-SELTEXT_M = 'DATE'.
    APPEND W_FCAT1 TO T_FCAT1.
    W_FCAT1-COL_POS = 4.
    W_FCAT1-FIELDNAME = 'NETWR'.
    W_FCAT1-SELTEXT_M = 'ORDER VALUE'.
    APPEND W_FCAT1 TO T_FCAT1.
    W_FCAT1-COL_POS = 5.
    W_FCAT1-FIELDNAME = 'WAERK'.
    W_FCAT1-SELTEXT_M = 'CURRENCY'.
    APPEND W_FCAT1 TO T_FCAT1.
    *&--APPEND COMMENTRY--
    W_COMMENT-TYP = 'H'.
    W_COMMENT-INFO = 'CUSTOMER DETAILS'.
    APPEND W_COMMENT TO T_COMMENT.
    CLEAR W_COMMENT.
    *&--APPEND EVENTS TABLE--
    W_EVENTS-NAME = 'TOP_OF_PAGE'.
    W_EVENTS-FORM = 'TOPPAGE'.
    APPEND W_EVENTS TO T_EVENTS.
    W_EVENTS-NAME = 'USER_COMMAND'.
    W_EVENTS-FORM = 'SUB2'.
    APPEND W_EVENTS TO T_EVENTS.
    W_EVENTS1-NAME = 'TOP_OF_PAGE'.
    W_EVENTS1-FORM = 'TOPPAGE1'.
    APPEND W_EVENTS1 TO T_EVENTS1.
    CLEAR W_EVENTS1.
    W_EVENTS1-NAME = 'USER_COMMAND'.
    W_EVENTS1-FORM = 'SUB3'.
    APPEND W_EVENTS1 TO T_EVENTS1.
    SELECT-OPTIONS: CUSTNO FOR W_KNA1-KUNNR.
    SELECT KUNNR
    NAME1
    ORT01 FROM KNA1 INTO TABLE T_KNA1
    WHERE KUNNR IN CUSTNO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    *I_BACKGROUND_ID =
    I_GRID_TITLE = 'CUSTOMER DETAILS'
    IT_FIELDCAT = T_FCAT
    IT_EVENTS = T_EVENTS
    TABLES
    T_OUTTAB = T_KNA1 .
    FORM TOPPAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = T_COMMENT
    I_LOGO = 'LOGO_ALV'.
    ENDFORM. "END OF TOPPAGE SUB.
    FORM SUB2 USING UCOMM LIKE SY-UCOMM FIELDS1 TYPE SLIS_SELFIELD.
    READ TABLE T_KNA1 INTO W_KNA1 INDEX FIELDS1-TABINDEX.
    SELECT VBELN
    ERNAM
    ERDAT
    NETWR
    WAERK
    FROM VBAK
    INTO TABLE T_VBAK
    WHERE KUNNR = W_KNA1-KUNNR.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    *I_BACKGROUND_ID =
    I_GRID_TITLE = 'LIST OF ORDERS'
    IT_FIELDCAT = T_FCAT1
    IT_EVENTS = T_EVENTS1
    TABLES
    T_OUTTAB = T_VBAK.
    ENDFORM. "END OF SUB2.
    FORM TOPPAGE1.
    *&--APPEND COMMENTRYOF SECONDRY SCREEN--
    W_COMMENT1-TYP = 'H'.
    W_COMMENT1-INFO = 'LIST OF ORDERS'.
    APPEND W_COMMENT1 TO T_COMMENT1.
    W_COMMENT1-TYP = 'S'.
    W_COMMENT1-KEY = 'CUSTOMER'.
    W_COMMENT1-INFO = W_KNA1-KUNNR.
    APPEND W_COMMENT1 TO T_COMMENT1.
    CLEAR W_COMMENT.
    W_COMMENT1-TYP = 'A'.
    W_COMMENT1-INFO = W_KNA1-NAME1.
    APPEND W_COMMENT1 TO T_COMMENT1.
    CLEAR W_COMMENT1.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = T_COMMENT1
    I_LOGO = 'LOGO_ALV'
    REFRESH T_COMMENT1.
    ENDFORM. "END OF TOPPAGE1
    FORM SUB3 USING UCOMM LIKE SY-UCOMM FIELDS1 TYPE SLIS_SELFIELD.
    READ TABLE T_VBAK INTO W_VBAK INDEX FIELDS1-TABINDEX.
    SET PARAMETER ID 'VBAk' FIELD W_VBAK-VBELN.
    CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
    ENDFORM.
    reward if useful.
    thanks and regards.

  • Symbol as default in a selection screen in alv

    hi all,
    how to bring GE(>=) symbol as default in a selection screen in alv report.
    by
    Ramesh.

    Hai Ramesh,
    Create Pushbuttons in selection screen ,In pushbutton write the ' >=' instead of providing the text.
    Try like this may be u will find the answer,
    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.
    CLI1, CLI2, CLI3 and CLI4 are used for <ucom>. When the user clicks one of the pushbuttons, the AT SELECTION-SCREEN event is triggered, and the FLAG field is set. The FLAG field can be further processed during subsequent program flow after the user has chosen Execute.
    Refer the above code, and make change just to clear all the fields in the selection screen, when corresponding push button is clicked..
    May be this answer is helpful to u.
    Regards,
    Skumari

  • Selection screen in ALV output

    Hi Experts,
    My requirement is - A selection screen should pop up on the click of a button in the ALV output. Using the parameters I input on the selection screen anothor ALV should be displayed on the same page at the bottom. I'm displaying ALV using cl_gui_alv_grid.
    Thanks.
    Ajith

    Hi Nimesh,
    The requirement has slightly been updated so as to display the 2nd ALV is another screen.
    As you suggested I used the call selection screen. How ever I did not use events for the same. I called the selection screen on checking sy-ucomm in PAI.
    After I input the values in the pop up selection screen , even if I click the cancel button(at bottom) or the close button( top corner)  the execution still  follows and the second ALV is displayed.
    Please help me in this so that If I click on cancel or close the second ALV is not displayed and the control remains in the first ALV
    Thank you.
    Edited by: Ajith  Krishna on Oct 31, 2008 10:24 PM

  • Call Screen problem in a report

    Hi All,
    I have a report in which I am calling an ALV grid screen 1000. I select some line items and click on execute. On execution in the PAI I have called a function module which has a call screen statement inside it. This should call the screen 100 with tabstrip(This screen is not related to this report. This belongs to some other function group). But when I execute the report instead of calling the screen 100 again the screen 1000 is only being displayed. I have found that the PBO of screen 100 and all the subscreens in it are being called but after that this 100 screen not displayed as mentioned already. Please someone let me know if I am missing something somewhere.
    Thank you,
    Sri.

    Hi Madhu,
    I am calling the screen from PAI of the ALV grid screen. I have debuged and checked. The PBO of the screen and the corresponding subscreens is being called but after that instead of the wanted screen this ALV grid screen is being called. And when I press back button then again PAI of the actual screen is being called.
    When the same FM is called from other classic reports without using ALV grid it is working fine.
    Thanks,
    Sri.

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

  • Going back to selection screen from ALV

    Hi there,
    I have scenario: program -> selection screen -> ALV
    In the 'BACK' button I have put: LEAVE TO SCREEN 0. It should go back to selection screen. But it does not and exits the program. I also tried to call the selection screen like CALL SELECTION-SCREEN 1000. But in this case if I hit BACK on selection screen, it goes back to previous screen, the ALV not the program. Can you please assist any other way to use the back button from
    ALV -> Selection screen. Thanks.
    Regards,

    Hi Johnny
    Previously i got the same requirement according to that i had developed a report just go through this hope it may helpfull very much
    *& Report  ZALVDEMO                                                    *
    REPORT  ZALVDEMO.
    TABLES : J_1IEXCHDR, " header table
    J_1IEXCDTL, " item table
    J_1IPART2, " Excise Part II details
    LFA1, " vendor master table
    J_1IMOVEND, " vendor excise details table
    MSEG, " Document Segment: Material
    MKPF, " Header: Material Document
    DD07T, " domain text table
    T001W. " Plant and Branch Details
    DATA : BEGIN OF IT_CHDR OCCURS 100,
    DOCNO LIKE J_1IEXCHDR-DOCNO,
    DOCYR LIKE J_1IEXCHDR-DOCYR,
    EXNUM LIKE J_1IEXCHDR-EXNUM,
    EXDAT LIKE J_1IEXCHDR-EXDAT,
    WERKS LIKE J_1IEXCHDR-WERKS,
    EXBED LIKE J_1IEXCHDR-EXBED,
    EXCCD LIKE J_1IEXCHDR-EXCCD,
    ECS LIKE J_1IEXCHDR-ECS,
    END OF IT_CHDR.
    DATA : BEGIN OF IT_CDTL OCCURS 100,
    DOCYR LIKE J_1IEXCDTL-DOCYR,
    DOCNO LIKE J_1IEXCDTL-DOCNO,
    EXNUM LIKE J_1IEXCDTL-EXNUM,
    EXDAT LIKE J_1IEXCDTL-EXDAT,
    LIFNR LIKE J_1IEXCDTL-LIFNR,
    MATNR LIKE J_1IEXCDTL-MATNR,
    MAKTX LIKE J_1IEXCDTL-MAKTX,
    CHAPID LIKE J_1IEXCDTL-CHAPID,
    EXBAS LIKE J_1IEXCDTL-EXBAS,
    EXBED LIKE J_1IEXCDTL-EXBED,
    ECS LIKE J_1IEXCDTL-ECS,
    MENGE LIKE J_1IEXCDTL-MENGE,
    MEINS LIKE J_1IEXCDTL-MEINS,
    RDOC2 LIKE J_1IEXCDTL-RDOC2,
    END OF IT_CDTL.
    DATA TEXT(10).
    DATA : BEGIN OF IT_OUT OCCURS 0,
    SERIALNO LIKE J_1IPART2-SERIALNO,
    TEXT1 LIKE TEXT,
    EXNUM LIKE J_1IEXCDTL-EXNUM,
    EXDAT LIKE J_1IEXCDTL-EXDAT,
    NAME LIKE LFA1-NAME1,
    DDTEXT LIKE DD07T-DDTEXT,
    EXCCD LIKE J_1IEXCHDR-EXCCD,
    BUDAT LIKE MKPF-BUDAT,
    EXBAS LIKE IT_CDTL-EXBAS,
    EXBED LIKE IT_CDTL-EXBED,
    ECS LIKE IT_CDTL-ECS,
    MATNR LIKE IT_CDTL-MATNR,
    MAKTX LIKE IT_CDTL-MAKTX,
    CHAPID LIKE IT_CDTL-CHAPID,
    MENGE LIKE IT_CDTL-MENGE,
    MEINS LIKE IT_CDTL-MEINS,
    DEL_IND(1),
    END OF IT_OUT.
    DATA IT_PART2 LIKE J_1IPART2 OCCURS 0 WITH HEADER LINE.
    DATA S_NO(4) .
    DATA DB_CNT LIKE SY-TABIX.
    DATA EBELN_T LIKE MSEG-EBELN .
    TYPE-POOLS : SLIS.
    DATA : AFIELD TYPE SLIS_FIELDCAT_ALV.
    DATA : LIST_HEADER TYPE SLIS_T_LISTHEADER,
    FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    LS_FTCAT TYPE LVC_S_FCAT,
    SORTCAT TYPE SLIS_T_SORTINFO_ALV,
    SORTCAT_LN LIKE LINE OF SORTCAT,
    G_REPID LIKE SY-REPID,
    G_BACK_GROUND(70), "like bapibds01-objkey,
    GS_VARIANT LIKE DISVARIANT,
    G_SAVE ,
    GT_EVENTS TYPE SLIS_T_EVENT,
    ALV_EVENT TYPE SLIS_ALV_EVENT,
    EVENTCAT TYPE SLIS_T_EVENT,
    EVENTCAT_LN LIKE LINE OF EVENTCAT,
    LAYOUT_IN TYPE SLIS_LAYOUT_ALV,
    LAYOUT_IN1 TYPE SLIS_LAYOUT_ALV.
    CONSTANTS : GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
    'TOP_OF_PAGE',
    GC_FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE
    'USER_COMMAND',
    GC_FORMNAME_BEFORE_OUTPUT TYPE SLIS_FORMNAME VALUE
    'BEFORE_OUTPUT'.
    * ALV_EVENT TYPE SLIS_ALV_EVENT,
    DATA EX_NO LIKE IT_CHDR-EXNUM VALUE 0.
    DATA REGTYP_1 LIKE J_1IPART2-REGTYP.
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME.
    PARAMETERS WERKS TYPE J_1IEXCHDR-WERKS.
    SELECT-OPTIONS : BUDAT FOR J_1IEXCHDR-EXDAT.
    PARAMETERS : R1 RADIOBUTTON GROUP GRP DEFAULT 'X',
    R2 RADIOBUTTON GROUP GRP.
    SELECTION-SCREEN END OF BLOCK B.
    INITIALIZATION.
    G_REPID = SY-REPID.
    G_SAVE = 'A'.
    * PERFORM BUILD_EVENT USING GT_EVENTS[].
    PERFORM ALV_EVENT_INIT.
    AT SELECTION-SCREEN.
    REFRESH LIST_HEADER.
    PERFORM TOP_OF_PAGE_LIST_HEADER USING LIST_HEADER.
    START-OF-SELECTION.
    * PERFORM ALV_EVENT_INIT.
    G_REPID = SY-REPID.
    G_BACK_GROUND = ' ' .
    IF R1 = 'X'.
    CLEAR R2. CLEAR : REGTYP_1.
    REGTYP_1 = 'A'.
    * set titlebar 'BALAJI' with DB_CNT.
    ELSEIF R2 = 'X'.
    CLEAR R1.CLEAR : REGTYP_1.
    REGTYP_1 = 'C'.
    * set titlebar 'BALAJI1' with DB_CNT.
    ENDIF.
    SELECT * FROM J_1IPART2
    INTO CORRESPONDING FIELDS OF TABLE IT_PART2
    WHERE REGTYP = REGTYP_1 AND
    TRNTYP = 'GRPO' AND
    BUDAT IN BUDAT.
    * DOCYR = IT_CDTL-DOCYR AND
    * DOCNO = IT_CDTL-DOCNO.
    LOOP AT IT_PART2.
    SELECT SINGLE * FROM J_1IEXCHDR
    INTO CORRESPONDING FIELDS OF IT_CHDR
    WHERE TRNTYP = 'GRPO' AND
    DOCYR = IT_PART2-DOCYR AND
    DOCNO = IT_PART2-DOCNO AND
    WERKS = WERKS AND
    exdat IN BUDAT.
    * ORDER BY EXDAT.
    IF SY-SUBRC = 0.
    APPEND IT_CHDR.
    ELSE.
    CONTINUE.
    ENDIF.
    * IF SY-SUBRC <> 0.
    * MESSAGE E084.
    * ENDIF.
    ENDLOOP.
    LOOP AT IT_CHDR.
    SELECT * FROM J_1IEXCDTL
    INTO CORRESPONDING FIELDS OF IT_CDTL
    * FOR ALL ENTRIES IN IT_CHDR
    WHERE
    TRNTYP = 'GRPO' AND
    DOCNO = IT_CHDR-DOCNO AND
    DOCYR = IT_CHDR-DOCYR AND
    EXNUM = IT_CHDR-EXNUM AND
    EXDAT = IT_CHDR-EXDAT AND
    WERKS = IT_CHDR-WERKS.
    IF SY-SUBRC = 0.
    APPEND IT_CDTL.
    ELSE.
    CONTINUE.
    ENDIF.
    ENDSELECT.
    ENDLOOP.
    LOOP AT IT_CDTL.
    CLEAR TEXT.
    DB_CNT = DB_CNT + 1.
    READ TABLE IT_CHDR WITH KEY EXNUM = IT_CDTL-EXNUM.
    READ TABLE IT_PART2 WITH KEY DOCNO = IT_CDTL-DOCNO .
    IT_OUT-SERIALNO = IT_PART2-SERIALNO.
    SELECT SINGLE NAME1 FROM LFA1
    INTO IT_OUT-NAME
    WHERE LIFNR = IT_CDTL-LIFNR.
    SELECT SINGLE * FROM LFA1
    WHERE LIFNR = IT_CDTL-LIFNR.
    IF LFA1-LAND1 EQ 'IN'.
    TEXT = 'INVOICE'.
    IT_OUT-TEXT1 = TEXT.
    ELSE.
    TEXT = 'BOE'.
    IT_OUT-TEXT1 = TEXT.
    ENDIF.
    SELECT SINGLE * FROM J_1IMOVEND
    WHERE LIFNR = IT_CDTL-LIFNR.
    SELECT SINGLE * FROM DD07T
    * INTO IT_OUT-DDTEXT
    WHERE DOMNAME = 'J_1IVTYP' AND
    DDLANGUAGE = 'EN' AND
    DOMVALUE_L = J_1IMOVEND-J_1IVTYP.
    IF DD07T-DDTEXT = 'First Stage Dealer of indigenous excisable goods'
    OR
    DD07T-DDTEXT = 'Second Stage Dealer of indigenous excisablegoods'.
    DD07T-DDTEXT = 'Dealer'.
    ENDIF.
    IT_OUT-DDTEXT = DD07T-DDTEXT.
    * ELSEIF DD07T-DDTEXT = 'Second Stage Dealer of indigenous excisable
    *goods'.
    * DD07T-DDTEXT =
    CLEAR EBELN_T.
    SELECT SINGLE LFBNR FROM MSEG
    INTO EBELN_T
    WHERE MBLNR = IT_CDTL-RDOC2 .
    SELECT SINGLE * FROM MSEG
    WHERE BWART = '106' AND
    LFBNR = EBELN_T ."and
    * ebeln = ebeln_t.
    IF SY-SUBRC = 0.
    IT_OUT-DEL_IND = 'X'.
    ELSE.
    IT_OUT-DEL_IND = ' '.
    ENDIF.
    SELECT SINGLE BUDAT FROM MKPF
    INTO IT_OUT-BUDAT
    WHERE MBLNR = EBELN_T ."MSEG-LFBNR.
    IT_OUT-EXNUM = IT_CDTL-EXNUM.
    IT_OUT-EXDAT = IT_CDTL-EXDAT.
    IT_OUT-EXCCD = IT_CHDR-EXCCD.
    IT_OUT-EXBAS = IT_CDTL-EXBAS.
    IT_OUT-EXBED = IT_CDTL-EXBED.
    IT_OUT-ECS = IT_CDTL-ECS.
    IT_OUT-MATNR = IT_CDTL-MATNR.
    IT_OUT-MAKTX = IT_CDTL-MAKTX.
    IT_OUT-CHAPID = IT_CDTL-CHAPID.
    IT_OUT-MENGE = IT_CDTL-MENGE.
    IT_OUT-MEINS = IT_CDTL-MEINS.
    APPEND IT_OUT.
    * EX_NO = IT_CDTL-EXNUM.
    ENDLOOP.
    * Title Portion
    IF REGTYP_1 = 'A'.
    SET TITLEBAR 'BALAJI' WITH DB_CNT.
    ELSEIF REGTYP_1 = 'C'.
    SET TITLEBAR 'BALAJI1' WITH DB_CNT.
    ENDIF.
    AFIELD-COL_POS = 1.
    AFIELD-FIELDNAME = 'SERIALNO'.
    AFIELD-SELTEXT_L = 'INPUTS'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 2.
    AFIELD-FIELDNAME = 'TEXT1'.
    AFIELD-SELTEXT_L = 'TYPE OF DOC'.
    AFIELD-JUST = 'L'.
    AFIELD-DECIMALS_OUT = '0'.
    AFIELD-NO_ZERO = 'X'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 3.
    AFIELD-FIELDNAME = 'EXNUM'.
    AFIELD-SELTEXT_L = 'DOC.NO'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 4.
    AFIELD-FIELDNAME = 'EXDAT'.
    AFIELD-SELTEXT_L = 'DOC.DATE'.
    AFIELD-JUST = 'C'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 5.
    AFIELD-FIELDNAME = 'NAME'.
    AFIELD-SELTEXT_L = 'NAME OF THE SUPPLIER'.
    AFIELD-NO_ZERO = 'X'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 6.
    AFIELD-FIELDNAME = 'DDTEXT'.
    AFIELD-SELTEXT_L = 'TYPE-OF-SUPPLIER'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 7.
    AFIELD-FIELDNAME = 'EXCCD'.
    AFIELD-SELTEXT_L = 'ECC OF THE SUPPLIER'.
    AFIELD-NO_ZERO = 'X'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 8.
    AFIELD-FIELDNAME = 'BUDAT'.
    AFIELD-SELTEXT_L = 'INPUT RECV DATE'.
    AFIELD-JUST = 'C'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 9.
    AFIELD-FIELDNAME = 'EXBAS'.
    AFIELD-SELTEXT_L = 'ASSESSABLE-VALUE'.
    AFIELD-DO_SUM = 'X'.
    AFIELD-JUST = 'R'.
    AFIELD-DECIMALS_OUT = '2'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 10.
    AFIELD-FIELDNAME = 'EXBED'.
    AFIELD-SELTEXT_L = 'DET OF CREDIT TAKEN CENVAT'.
    AFIELD-JUST = 'R'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 11.
    AFIELD-FIELDNAME = 'ECS'.
    AFIELD-SELTEXT_L = 'DET OF CREDIT TAKEN E-CESS'.
    AFIELD-JUST = 'R'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 12.
    AFIELD-FIELDNAME = 'MATNR'.
    AFIELD-SELTEXT_L = 'MATERIAL-CODE'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 13.
    AFIELD-FIELDNAME = 'MAKTX'.
    AFIELD-SELTEXT_L = 'DESCRIPTION'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 14.
    AFIELD-FIELDNAME = 'CHAPID'.
    AFIELD-SELTEXT_L = 'TARIFF-ID'.
    AFIELD-JUST = 'L'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 15.
    AFIELD-FIELDNAME = 'MENGE'.
    AFIELD-SELTEXT_L = 'QUANTITY'.
    AFIELD-JUST = 'R'.
    AFIELD-DO_SUM = ' '.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 16.
    AFIELD-FIELDNAME = 'MEINS'.
    AFIELD-SELTEXT_L = 'UOM'.
    AFIELD-JUST = 'C'.
    APPEND AFIELD TO FIELDCAT.
    AFIELD-COL_POS = 17.
    AFIELD-FIELDNAME = 'DEL_IND'.
    AFIELD-SELTEXT_L = 'Deleted'.
    AFIELD-JUST = 'C'.
    APPEND AFIELD TO FIELDCAT.
    * * LAYOUT FOR ZEBRA CATLOG
    LAYOUT_IN-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT_IN-ZEBRA = 'X'.
    LAYOUT_IN-GET_SELINFOS = 'X'.
    LAYOUT_IN-CONFIRMATION_PROMPT = 'X'.
    LAYOUT_IN-DETAIL_POPUP = 'X' .
    * SORTCAT-decimals = '0'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_SAVE = G_SAVE
    IS_VARIANT = GS_VARIANT
    IT_FIELDCAT = FIELDCAT
    IT_SORT = SORTCAT
    IS_LAYOUT = LAYOUT_IN
    IT_EVENTS = EVENTCAT
    * I_BACKGROUND_ID = g_back_ground
    TABLES
    T_OUTTAB = IT_OUT.
    *& Form TOP_OF_PAGE_LIST_HEADER
    * text
    * -->LIST_HEADERtext
    FORM TOP_OF_PAGE_LIST_HEADER USING LIST_HEADER TYPE SLIS_T_LISTHEADER.
    DATA : HLINE TYPE SLIS_LISTHEADER,
    TEXT(60) TYPE C.
    CLEAR : HLINE,TEXT.
    HLINE-TYP = 'H'.
    * WRITE 'ROOTS INDUSTRIES LTD' TO TEXT.
    HLINE-INFO = TEXT.
    APPEND HLINE TO LIST_HEADER.
    SELECT SINGLE * FROM T001W WHERE WERKS = WERKS.
    CLEAR : HLINE,TEXT.
    HLINE-TYP = 'H'.
    WRITE 'PLANT :' TO TEXT.
    WRITE WERKS TO TEXT+8.
    HLINE-INFO = TEXT.
    APPEND HLINE TO LIST_HEADER.
    CLEAR : HLINE,TEXT.
    HLINE-TYP = 'H'.
    WRITE T001W-NAME1 TO TEXT.
    HLINE-INFO = TEXT.
    APPEND HLINE TO LIST_HEADER.
    CLEAR : HLINE,TEXT.
    HLINE-TYP = 'H'.
    WRITE T001W-STRAS TO TEXT.
    HLINE-INFO = TEXT.
    APPEND HLINE TO LIST_HEADER.
    CLEAR : HLINE,TEXT.
    HLINE-TYP = 'H'.
    WRITE T001W-ORT01 TO TEXT.
    HLINE-INFO = TEXT.
    APPEND HLINE TO LIST_HEADER.
    CLEAR : HLINE,TEXT.
    HLINE-TYP = 'H'.
    WRITE 'DATE :' TO TEXT.
    WRITE BUDAT-LOW TO TEXT+7.
    IF BUDAT-HIGH NE ''.
    WRITE 'TO' TO TEXT+18.
    WRITE BUDAT-HIGH TO TEXT+22.
    ENDIF.
    HLINE-INFO = TEXT.
    APPEND HLINE TO LIST_HEADER.
    ENDFORM. "TOP_OF_PAGE_LIST_HEADER
    *& Form ALV_EVENT_INIT
    * text
    FORM ALV_EVENT_INIT .
    CLEAR ALV_EVENT.
    ALV_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
    ALV_EVENT-FORM = 'ALV_TOP_OF_PAGE'.
    APPEND ALV_EVENT TO EVENTCAT.
    CLEAR ALV_EVENT.
    ALV_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
    ALV_EVENT-FORM = 'ALV_TOP_OF_LIST'.
    APPEND ALV_EVENT TO EVENTCAT.
    * CLEAR ALV_EVENT.
    * ALV_EVENT-NAME = SLIS_EV_END_OF_LIST.
    * ALV_EVENT-FORM = 'ALV_END_OF_LIST'.
    * APPEND ALV_EVENT TO GT_EVENTS.
    * CLEAR ALV_EVENT.
    * ALV_EVENT-NAME = SLIS_EV_END_OF_PAGE.
    * ALV_EVENT-FORM = 'ALV_END_OF_PAGE'.
    * APPEND ALV_EVENT TO GT_EVENTS.
    ENDFORM. "ALV_EVENT_INIT
    *& Form ALV_TOP_OF_PAGE
    * text
    FORM ALV_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = LIST_HEADER
    I_LOGO = 'ENJOYSAP_LOGO'.
    ENDFORM. "ALV_TOP_OF_PAGE
    *& Form BUILD_EVENT
    * text
    * -->P_GT_EVENTS[] text
    FORM BUILD_EVENT USING P_EVENTS TYPE SLIS_T_EVENT.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = P_EVENTS
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2.
    READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND INTO
    ALV_EVENT.
    IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_USER_COMMAND TO ALV_EVENT-FORM.
    APPEND ALV_EVENT TO P_EVENTS.
    ENDIF.
    READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_BEFORE_LINE_OUTPUT INTO
    ALV_EVENT.
    IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_BEFORE_OUTPUT TO ALV_EVENT-FORM.
    APPEND ALV_EVENT TO P_EVENTS.
    ENDIF.
    ENDFORM. " BUILD_EVENT
    Reward if helpfull
    Regards
    Pavan

  • Handling Double click on a Pop-up screen with ALV Grid

    Hello Experts,
    I have an issue handling double click on ALV Pop-up screen. I tried to achive this using following steps.
    1. I defined a local class in Top-include to handle double click and implemented it in the following way.
    CLASS lcl_alv_event_handler DEFINITION.
    PUBLIC SECTION.
    CLASS-METHODS:
    on_double_click FOR EVENT double_click
    OF cl_gui_alv_grid
    IMPORTING e_row
    e_column
    es_row_no.
    ENDCLASS. "lcl_alv_event_handler DEFINITION
    *~~~ Implementation code
    CLASS lcl_alv_event_handler IMPLEMENTATION.
    To handle Selection of Issue data on Screen 100
    METHOD on_double_click.
    DATA: lt_row_no TYPE lvc_t_roid,
    ls_req TYPE zcst_zirt_seltab.
    READ TABLE gt_req
    INTO ls_req
    INDEX e_row-index.
    g_req_id = ls_req-zzrequest_id.
    gv_selected = true.
    CALL METHOD go_alv->dispatch
    EXPORTING
    cargo = 'OK'
    eventid = 3
    is_shellevent = ' '
    is_systemdispatch = 'X'
    EXCEPTIONS
    cntl_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.
    ENDMETHOD. "on_double_click
    ENDCLASS. "lcl_alv_event_handler IMPLEMENTATION
    2. Registered the event in the PBO module of the screen
    ls_events-eventid = 3.
    ls_events-appl_event = gc_true.
    APPEND ls_events TO lt_events.
    CALL METHOD co_alv->set_registered_events
    EXPORTING
    events = lt_events
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    illegal_event_combination = 3
    OTHERS = 4.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT co_alv_event_handler.
    SET HANDLER: co_alv_event_handler->on_double_click FOR co_alv.
    CALL METHOD co_alv->set_toolbar_interactive.
    3. In the PAI module of Screen, tried to handle the event 'OK' that waqs registred in PBO.
    CASE save_ok.
    WHEN 'OK'.
    Get selected line
    CALL METHOD io_alv->get_selected_rows
    IMPORTING
    et_index_rows = lt_rows
    et_row_no = lt_rows_no.
    IF NOT lt_rows IS INITIAL.
    READ TABLE lt_rows INTO ls_rows INDEX 1.
    IF sy-subrc EQ 0.
    gv_selected = 'X'.
    READ TABLE it_req
    INTO ls_req
    INDEX ls_rows-index.
    e_req_id = ls_req-zzrequest_id.
    SET SCREEN 0.
    ENDIF.
    ELSE.
    SET SCREEN 0.
    ENDIF.
    With this code what is happening is, when user double clicks a line on Pop-up screen with ALV grid data, the program is able to successfully get into the class implementation but the control is not going to PAI module to execute the OK_code handling part.
    Am I doing this in the right way? Appreciate quick suggestions. Proper posts will be thoroughly awarded with points.
    Thx.
    Minni

    Put your code into the Event handler Implementation of Double Click which is there in the PAI Module.
    Regards,
    Naimesh Patel

  • F4 on the called screen

    Hi,
    Ive created a screen in screen painter and its linked to the dictionary field of a ztable. When i call the screen thru a tcode, i can see the F4 help on the fields for which i hav created value tables in their domain.But when i call the same screen from alv list, i cannot see the F4 help that comes automatically from dictionary field.Why is this happening?
    Thanks,
    Nidhi.

    Hi,
    I think there is some confusion..Will giv an example.
    I have screen no suppose 100.On that screen there is a field username which is linked to dictionary field.That dictionary field has a value table.So when i call screen 100 using a tcode, i get F4 help on the field username.Ive not written any code for this F4 help.Its coming directly from the dictionary field.Now, in the same program i generate an alv list.On that list there is a button. When i click that button, it calls that same screen 100 using syntax call screen <scr number>.I can see that field username on the screen but this time i cannot access F4 help.Why is this happening.
    As u told me to mention reftab name and ref fieldname, am already doing that.Still its not working.
    Nidhi.

  • Leaving to another screen with ALV.

    Hello,
    I use CL_GUI_ALV_GRID - SET_TABLE_FOR_FIRST_DISPLAY to generate an ALV list from a selection screen.
    Now, I have created a button that calls another screen.
    the ALV is on screen 100 and the other one is on 200.
    Now, when this button is pressed, the code says, leave to screen 200.
    But, however, the ALV from screen 100 still stays there and I can't seem to find a way to get rid of it.
    Can anyone help here, please!
    Thanks!

    Hi ,
    check the screen no is 200 or not.
    check the button is having the same function code or not.
    use the same functioncode as of button.
    and in pai of 1st screen
    write.
    ok_code = sy-ucomm.
    CASE ok_code.
    when 'click'.
    call screen 200.
    endcase.
    Regards

  • Call screen in SAP Query selection screen (SQ01)

    Hi experts , in sq01 selection screen my requirement is: for one field  when the user call F4 the small screen should be appear and when they fill
    those 3 fields I should concatenate them and send it as a single field to query for process , the important thing is those 3 fields should be in '
    one line beside each other , is there a way like call screen or ... in  sq01 for this issue ??
    the screen that should be appear is something like this

    Hi,
    I dont think that ALV double click can be handles via SAP query. One possibility is that you can modify the report program that SAP generates for the query. Change the program to handle the double click evet on the ALV grid and call transaction ME23n using the PO number on the line selected.
    Regards
    Ajith

  • How can I call functionality of ALV Grid by event of button outside grid?

    Hello,
    How can I call functionality of ALV Grid by event of button located outside ALV Grid? For example how to fire printing of this ALV Grid by button click elsewhere on the screen (not in toolbar of ALV Grid).
    Best regards,
    Josef Motl

    hi Motl,
    these are steps to create a button in ALV and trigger an event from it..
    1.Use the parameter i_callback_pf_status_set in the function module REUSE_ALV_GRID_DISPLAY
    i_callback_program = gd_repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    form set_pf_status using rt_extab type slis_t_extab.
    set pf-status 'NEWALVSTATUS'.
    endform.
    You have to copy the standard ALV pf stauts to 'NEWALVSTATUS' and add your button.
    2.You have to do the following to process the new button click.
    i_callback_user_command = 'USER_COMMAND'
    form user_command using i_ucomm like sy-ucomm
    is_selfield type slis_selfield.
    case i_ucomm.
    3. to copy the standard pf status to a new one.go to the ALV screen and take the menu System -> Status.  Then look for the standard pf status. Copy this to Z range and then add your new button.
    reward points if helpful
    regards
    satesh

Maybe you are looking for

  • Itunes 10.6.1 and my airport express

    I just downloaded Itunes 10.6.1 and cannot stream through my airport express anymore. What's up? I am on a MacbookPro OS 10.6.8

  • Valid Use of a Collection in SCCM

    I've read the contents of this post with much interest and would like to ask about whether my particular requirement is possible. When we build a server for the first time we need to ensure that it is not placed in collection with other production se

  • Artwork on iPod

    I've added artwork for most of my albums on my iPod. (tedious, i know.) well this took me a while and when i unplugged my iPod from my comp and started playing some music the artwork did not appear as it does for music i've actually purchased on iTun

  • Mac Mini Server & OS X Lion

    Can I wipe off the Snow Leopard server version running on a 2.53 Ghz Core 2 Duo Server and install the "normal" OS X lion on it...? I do not want the server version... If so, what are the steps I should follow.. Thanks in advance.

  • IPhone 4s; setting ringtones? No "tones/ ringtones" tab in iTune

    I just got an iPhone 4s, and I am unable to set ringtones that are not purchased from the store. However, I don't want to repurchase music that I have already paid for. How do I set rigntones from my iTunes library onto my Iphone 4s? I have synched t