Double Click on ALV Report Output, Bringing to selections creen

Hello Gurus,
Please help me When i do double click on ALV Report  output , it is going back to Selection screen, actually its working as Back button. Now how to stop it.. I did debugging but i cannot trace it.

PERFORM SUB_CREATE_FCAT.
DATA W_REPID LIKE SY-REPID.
    W_REPID = SY-REPID.
ls_layout-colwidth_optimize = 'X'.
ls_layout-zebra = 'X'.
PERFORM SUB_SORT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
*     I_INTERFACE_CHECK                 = ' '
*     I_BYPASSING_BUFFER                = ' '
*     I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                 = SY-CPROG
      I_CALLBACK_PF_STATUS_SET          = 'STATUS'
       I_CALLBACK_USER_COMMAND           = 'C_USERCOMMAND '
*     I_CALLBACK_TOP_OF_PAGE            = ' '
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*     I_CALLBACK_HTML_END_OF_LIST       = ' '
*     I_STRUCTURE_NAME                  =
*     I_BACKGROUND_ID                   = ' '
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
       IS_LAYOUT                         = ls_layout
       IT_FIELDCAT                       = IT_FIELDCAT
*     IT_EXCLUDING                      =
*     IT_SPECIAL_GROUPS                 =
       IT_SORT                           = IT_SORT
*     IT_FILTER                         =
*     IS_SEL_HIDE                       =
*     I_DEFAULT                         = 'X'
      I_SAVE                            = 'U'
*     IS_VARIANT                        =
*     IT_EVENTS                         =
*     IT_EVENT_EXIT                     =
*     IS_PRINT                          =
*     IS_REPREP_ID                      =
*     I_SCREEN_START_COLUMN             = 0
*     I_SCREEN_START_LINE               = 0
*     I_SCREEN_END_COLUMN               = 0
*     I_SCREEN_END_LINE                 = 0
*     I_HTML_HEIGHT_TOP                 = 0
*     I_HTML_HEIGHT_END                 = 0
*     IT_ALV_GRAPHICS                   =
*     IT_HYPERLINK                      =
*     IT_ADD_FIELDCAT                   =
*     IT_EXCEPT_QINFO                   =
*     IR_SALV_FULLSCREEN_ADAPTER        =
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER           =
*     ES_EXIT_CAUSED_BY_USER            =
     TABLES
       t_outtab                          = T_FINAL
*   EXCEPTIONS
*     PROGRAM_ERROR                     = 1
*     OTHERS                            = 2
   IF sy-subrc <> 0.
* Implement suitable error handling here
   ENDIF.

Similar Messages

  • Double click in ALV tree output????

    Hi all,
    I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issue of double clicking.
    Please tell how to handle events in this report tree display.
    For the following code its displaying output in tree format and in right way. But i need to add double click functionality to this.
    So provide me some sample program for this one....
    * create hierarchy
      CALL METHOD tree1->set_table_for_first_display
              EXPORTING
                   it_list_commentary   = lt_list_commentary
                   i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = ls_variant
              CHANGING
                   it_sort              = gt_sort[]
                   it_outtab            = itab_outtab
                   it_fieldcatalog      = t_fieldcat. "gt_fieldcatalog.
    * expand first level
      CALL METHOD tree1->expand_tree
             EXPORTING
                 i_level = 1.
    * optimize column-width
      CALL METHOD tree1->column_optimize
               EXPORTING
                   i_start_column = tree1->c_hierarchy_column_name
                   i_end_column   = tree1->c_hierarchy_column_name.
    In grid ALV we can have double cilck functionality using code:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program       = w_repid
                i_callback_pf_status_set = 'PF_STATUS'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = ls_layout
                it_fieldcat              = gt_fc[]
    Here we can write subroutine for USER_COMMAND and handle the double click evenet. But tell me how to provide this in tree ALV.
    <REMOVED BY MODERATOR>
    Regards,
    Sachin
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 1:47 PM

    Hello Sachin
    The following sample report ZUS_SDN_ALV_TREE_DEMO demonstrates the crucial parts for double-click event handling (nodes & items) in ALV trees.
    *& Report  ZUS_SDN_ALV_TREE_DEMO
    *& Thread: double click in ALV tree output????
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="742412"></a>
    REPORT  zus_sdn_alv_tree_demo.
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knvv AS data.
    TYPES: nkey       TYPE lvc_nkey.
    TYPES: parent_key TYPE lvc_nkey.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA: gt_outtab    TYPE ty_t_outtab.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gt_fcat          TYPE lvc_t_fcat,
      gs_layout        TYPE lvc_s_layo,
      gs_variant       TYPE disvariant,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_tree          TYPE REF TO cl_gui_alv_tree.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
        handle_node_double_click
          FOR EVENT node_double_click OF cl_gui_alv_tree
          IMPORTING node_key,
        handle_item_double_click
          FOR EVENT item_double_click OF cl_gui_alv_tree
          IMPORTING node_key
                    fieldname.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_node_double_click.
        message 'Event=Double-Click on Node' type 'I'.
        call transaction 'XD03'.
      ENDMETHOD.                    "handle_node_double_click
      METHOD handle_item_double_click.
        message 'Event=Double-Click on Item' type 'I'.
        call transaction 'VA03'.
      ENDMETHOD.                    "handle_item_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      PERFORM init_controls.
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      container                   =
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          lifetime_dynpro_dynpro_link = 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.
      CALL SCREEN '0100'.
    ** NOTE: no elements on screen
    **  PROCESS BEFORE OUTPUT.
    **    MODULE STATUS_0100.
    **  PROCESS AFTER INPUT.
    **    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
      CASE gd_okcode.
        WHEN 'BACK'  OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'REFRESH'.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  init_controls
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      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 tree control
      CREATE OBJECT go_tree
        EXPORTING
            parent              = go_docking
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
            item_selection      = 'X'  " required for double-click event on item
            no_html_header      = ''
            no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    * create Hierarchy-header
      DATA ls_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING ls_hierarchy_header.
      PERFORM build_fieldcatalog.
      PERFORM set_layout_and_variant.
    * create emty tree-control
      CALL METHOD go_tree->set_table_for_first_display
        EXPORTING
    **      i_structure_name     = 'KNVV'
          is_variant           = gs_variant
          i_save               = 'A'
    *      i_default            = 'X'
          is_hierarchy_header  = ls_hierarchy_header
    *      is_exception_field   =
    *      it_special_groups    =
    *      it_list_commentary   =
    *      i_logo               =
    *      i_background_id      =
    *      it_toolbar_excluding =
    *      it_except_qinfo      =
        CHANGING
          it_outtab            = gt_outtab
    *      it_filter            =
          it_fieldcatalog      = gt_fcat.
    * create hierarchy
      PERFORM create_hierarchy.
    * register events
      PERFORM register_events.
    * adjust column_width
      CALL METHOD go_tree->column_optimize.
    ENDFORM.                    " init_controls
    *&      Form  build_hierarchy_header
    *       build hierarchy-header-information
    *      -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
      REFRESH: gt_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNVV'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DELETE gt_fcat FROM 8.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT_AND_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout_and_variant .
      CLEAR: gs_layout,
             gs_variant.
      gs_variant-report = syst-repid.
      gs_variant-handle = 'TREE'.
    ENDFORM.                    " SET_LAYOUT_AND_VARIANT
    *&      Form  create_hierarchy
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM create_hierarchy .
      DATA: ls_knvv    TYPE sflight,
            ls_outtab  TYPE ty_s_outtab,
            lt_outtab  TYPE ty_t_outtab.
    * get data
      SELECT * FROM knvv INTO CORRESPONDING FIELDS OF TABLE lt_outtab
                            UP TO 200 ROWS .                "#EC CI_NOWHERE
      SORT lt_outtab BY kunnr vkorg.
    * add data to tree
      DATA: ld_kunnr_key TYPE lvc_nkey,
            ld_vkorg_key TYPE lvc_nkey,
            ld_last_key  TYPE lvc_nkey.
      LOOP AT lt_outtab INTO ls_outtab.
        ON CHANGE OF ls_outtab-kunnr.
          PERFORM add_customer_line USING    ls_outtab-data
                                  CHANGING ld_kunnr_key.
        ENDON.
        ON CHANGE OF ls_outtab-vkorg.
          PERFORM add_salesorg_line USING    ls_outtab-data
                                             ld_kunnr_key
                                  CHANGING ld_vkorg_key.
        ENDON.
        PERFORM add_complete_line USING  ls_outtab-data
                                         ld_vkorg_key
                                CHANGING ld_last_key.
      ENDLOOP.
    * calculate totals
      CALL METHOD go_tree->update_calculations.
    * this method must be called to send the data to the frontend
      CALL METHOD go_tree->frontend_update.
    ENDFORM.                    " create_hierarchy
    *&      Form  add_customer_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_customer_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_data TYPE ty_s_outtab-data.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@A0@'.  " icon_customer.
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    * add node
      l_node_text =  us_data-kunnr.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_data
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_customer_line
    *&      Form  add_salesorg_line
    *       add hierarchy-level 1 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_salesorg_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_data TYPE ty_s_outtab-data.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@DS@'.  " ICON_PARTNER_SALES_ACTIVITY
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    * add node
      l_node_text =  us_data-vkorg.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_data
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_salesorg_line
    *&      Form  add_cmplete_line
    *       add hierarchy-level 3 to tree
    *      -->P_LS_SFLIGHT  sflight
    *      -->P_RELEATKEY   relatkey
    *     <-->p_node_key    new node-key
    FORM add_complete_line USING     us_data TYPE ty_s_outtab-data
                                     ud_relat_key TYPE lvc_nkey
                         CHANGING  cd_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
    * set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-fieldname = go_tree->c_hierarchy_column_name.
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
    **  ls_item_layout-editable = 'X'.
      APPEND ls_item_layout TO lt_item_layout.
    **  CLEAR ls_item_layout.
    **  ls_item_layout-fieldname = 'PLANETYPE'.
    **  ls_item_layout-alignment = cl_gui_column_tree=>align_right.
    **  APPEND ls_item_layout TO lt_item_layout.
      l_node_text =  us_data-vtweg.
      DATA: ls_node TYPE lvc_s_layn.
      ls_node-n_image   = space.
      ls_node-exp_image = space.
      CALL METHOD go_tree->add_node
        EXPORTING
          i_relat_node_key = ud_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = us_data
          i_node_text      = l_node_text
          is_node_layout   = ls_node
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = cd_node_key.
    ENDFORM.                               " add_complete_line
    *&      Form  register_events
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM register_events.
    * define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    * define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_header_click.
    **  APPEND l_event TO lt_events.
    **  l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
    **  APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_double_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
      APPEND l_event TO lt_events.
      CALL METHOD go_tree->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    * set Handler
      set handler:
        lcl_eventhandler=>handle_node_double_click for go_tree,
        lcl_eventhandler=>handle_item_double_click for go_tree.
    **  DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
    **  CREATE OBJECT l_event_receiver.
    **  SET HANDLER l_event_receiver->handle_node_ctmenu_request
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_node_ctmenu_selected
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_item_ctmenu_request
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_item_ctmenu_selected
    **                                                        FOR tree1.
    **  SET HANDLER l_event_receiver->handle_checkbox_change FOR tree1.
    ENDFORM.                               " register_events
    Regards
      Uwe

  • Double Click in ALV Report in Web dynpro ABAP4

    Hi All,
    I am very much new to WDA4 , can anybody plz guide me how to enable double click in ALV Report in Web dynpro ..
    Plz help it is urgent .....
    Thnks
    Sahil

    Hi All,
    I am very much new to WDA4 , can anybody plz guide me how to enable double click in ALV Report in Web dynpro ..
    Plz help it is urgent .....
    Thnks
    Sahil

  • Double click in alv report

    Hi all,
    I have below output in alv report.
    matnr 101_102 121_122 123_124
    10000   23          34              45
    10001   34          34              456
    if i m clicking on 23 in combination of 121_122 and 10000 then i want to see detail for 121_122 and if i m clicking on 34 combination of 101_102 then i want to see detail according to it.
    plz help me. its urgent.
    thanks in advance.

    Check the below report and do compare and modify the report as per your req.
    REPORT  ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
    MESSAGE-ID ZZ_9838                      .
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
          I_VARIANT1 TYPE DISVARIANT,
          I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
      V_REPID = SY-REPID.
      PERFORM BUILD_FIELDCATLOG.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATLOG
          Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'AEDAT'.
      WA_FIELDCAT-SELTEXT_M = 'DATE.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'LIFNR'.
      WA_FIELDCAT-NO_OUT    = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  EVENT_CALL
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    EXCEPTIONS
       LIST_TYPE_WRONG       = 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.
    ENDFORM.                    "EVENT_CALL
    *&      Form  POPULATE_EVENT
         Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    *&      Form  data_retrieval
      retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM.                    "data_retrieval
    *&      Form  bUild_listheader
          text
         -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
      DATA HLINE TYPE SLIS_LISTHEADER.
      HLINE-INFO = 'this is my first alv pgm'.
      HLINE-TYP = 'H'.
    ENDFORM.                    "build_listheader
    *&      Form  display_alv_report
          text
    FORM DISPLAY_ALV_REPORT.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_GRID_TITLE                      = I_TITLE_EKKO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         = ALV_LAYOUT
         IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
        i_default                         = 'ZLAY1'
         I_SAVE                            = 'A'
        is_variant                        = i_variant
         IT_EVENTS                         = V_EVENTS
        TABLES
          T_OUTTAB                          = IT_EKKO
    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.
    ENDFORM.                    "display_alv_report
    *&      Form  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_EKPO
          text
    FORM BUILD_FIELDCATLOG_EKPO.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELP'.
      WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MENGE'.
      WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-SELTEXT_M = 'UOM'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'NETPR'.
      WA_FIELDCAT-SELTEXT_M = 'PRICE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
    *&      Form  event_call_ekpo
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
    ENDFORM.                    "event_call_ekpo
    *&      Form  POPULATE_EVENT
           Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      ENDFORM.                    "POPULATE_EVENT
    *&      Form  TOP_OF_PAGE
          text
    FORM F_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
       i_logo                   =
       I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = I_TITLE_EKPO
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = I_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         =
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = V_EVENTS
      TABLES
        T_OUTTAB                          = IT_EKPO
    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.
    ENDFORM.
    Thanks
    Seshu

  • Double click in alv report rows

    Hi to all!!
    I have an alv report and I want it to go directly to a transaction IW38 when I double click the row, I know that i have to use the reuse_alv_grid_display's IT_EVENT parameter and also the I_CALLBACK_USERCOMMAND but I don't know exactly how.
    Can anybody show me an example or help me?
    THANKS A LOT!!!

    Hi,
    Take a look at the following code ( 2 main perform ):
    *       ITAB_user_command                          *
    FORM itab_user_command  USING ucomm TYPE sy-ucomm
                            s_selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
    *     Call Transaction MM03
          IF s_selfield-fieldname = 'MATNR' .
           READ TABLE t_bom INDEX s_selfield-tabindex.
            SET PARAMETER ID 'MAT' FIELD t_bom-matnr.
            CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    *&      Form  display_data
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
    *           i_background_id             = 'SIWB_WALLPAPER'
                i_background_id             = 'ALV_BACKGROUND'
                i_callback_program          = w_repid
    *           i_callback_html_top_of_page = w_html_top_of_page
    *           i_structure_name            = 'TRDIR'
                i_bypassing_buffer          = 'X'
                i_default                   = 'X'
                i_save                      = w_variant_save "'A'
                is_variant                  = w_variant
                is_layout                   = w_layout
                i_callback_user_command     = 'ITAB_USER_COMMAND'
    *            i_callback_pf_status_set    = 'SET_PF_STATUS'
                it_fieldcat                 = i_fieldcat_alv[]
                it_events                   = i_events[]
                it_event_exit               = i_event_exit[]
    *            it_excluding                = i_excluding
                is_print                    = w_print
    *           i_screen_start_column       = 1
    *           i_screen_start_line         = 1
    *           i_screen_end_column         = 70
    *           i_screen_end_line           = 30
           TABLES
                t_outtab                    = t_bom
           EXCEPTIONS
                program_error               = 1.
    ENDFORM.                    " display_data
    Best regards,
    Erwan

  • ALV Report output as per selection screen

    Hi,
    I got a requirement. In selection screen there is field where i can entered 1 to 12 numbers. When i entered a number,  so that in output of an alv report should display that many fields
    for eg.
    if  i entered 5 in selection screen
    in out put 5 fields of alv report should display.
    Thanks....
    Moderator message : Spec dumping / Outsourcing is not allowed. Thread locked.
    Edited by: Vinod Kumar on Jul 15, 2011 11:34 AM

    hi,
    u sort the internal table by the materials in our variant.
    like sort itab by jtab
    itab consists of all materials
    jtab cosists of materials in variant.
    hope it may helpful,
    regards,
    chandu

  • Double-click in standard report

    Hi,
    I'm creating a standard report (not an ALV, just write's...) and I need to control events when I double-click on certain caracters on the screen. How can I do that?
    Thanks
    Carles

    hi,
    while genarating secondary list based on uer actions( double click), we provide the logic for genarating list unsder <b>AT LINE-SELECTION</b> event.
    AT LINE-SELECTION.
      <statements>.
    When the user triggers the function code PICK, AT LINE-SELECTION is always triggered if the cursor is positioned on a list line. The function code PICK is, by default, always linked with function key F2 and hence with the mouse double-click.
    <b>Example for AT LINE-SELECTION.</b>
    REPORT demo_list_at_line_selection.
    START-OF-SELECTION.
      WRITE  'Basic List'.
    AT LINE-SELECTION.
      WRITE: 'Secondary List by Line-Selection',
           / 'SY-UCOMM =', sy-ucomm.
    When you run the program, the basic list appears with the standard list status. The detail list shows that SY-UCOMM has the value PICK.
    To pass individual output fields or additional information from a user selected line to the corresponding processing block during an interactive event, use these statements:
    <b>HIDE</b>
    The HIDE statement is one of the fundamental statements for interactive reporting. You use the HIDE technique when creating a basic list. It defines the information that can be passed to subsequent detail lists.
    <b>READ LINE</b>
    Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.
    <b>GET CURSOR</b>
    Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output field or output line on which the cursor was positioned during the interactive event to the ABAP program.
    <b>DESCRIBE LIST</b>
    The DESCRIBE LIST statement allows you to read certain list attributes, such as the number of lines or pages, into program variables.
    follow this link fro more information.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba42335c111d1829f0000e829fbfe/content.htm
    follow this link for sample programs on interactive reports.
    http://www.sap-img.com/abap/a-sample-hide-get-cursor-in-interactive-programming.htm
    http://www.erpgenie.com/abap/drill_down_reports.htm
    regards,
    Ashok reddy

  • Help in double click in alv

    hi,
    i doing alv and it working o.k. and i wont to add the double click on field and move it to transction how can i do that?
    I reward
    thankes
    "this is my declartion alv
    FORM f_display_data.
      DATA:
        ls_layout   TYPE slis_layout_alv,
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
      m_fieldcat 'OBJECT' 'ITAB' 'X' 'Object'.
      m_fieldcat 'OBJECT_NAME' 'ITAB' 'X'  'Oject Name'.
    * Fill Layout - Name of the field with color
      ls_layout-info_fieldname = 'LINE_COLOR'.
      ls_layout-colwidth_optimize = 'X'.
    * Display the list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout    = ls_layout
          it_fieldcat  = lt_fieldcat
          i_grid_title = 'User Exit & Badi'
        TABLES
          t_outtab     = itab.
      CASE wf_object.   "this lines is what i wont to add for double click
        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.
    Regards

    Hi
    Here is an example program which illistrates how to handle the double click event.
    REPORT ZRICH_0001.
    TABLES: MARA.
    DATA: BEGIN OF I_ALV OCCURS 0,
          MATNR TYPE MARA-MATNR,
          MAKTX TYPE MAKT-MAKTX,
          END OF I_ALV.
          CLASS cl_event_receiver DEFINITION      Handles Double Click
    CLASS CL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS HANDLE_DOUBLE_CLICK
          FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
          IMPORTING E_ROW E_COLUMN.
      PRIVATE SECTION.
    ENDCLASS.
          CLASS CL_EVENT_RECEIVER IMPLEMENTATION    Handles Double Click
    CLASS CL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_DOUBLE_CLICK.
        PERFORM DRILL_DOWN USING E_ROW-INDEX.
      ENDMETHOD.
    ENDCLASS.
    DATA: ALV_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: EVENT_RECEIVER TYPE REF TO CL_EVENT_RECEIVER.
    DATA: ALV_GRID       TYPE REF TO CL_GUI_ALV_GRID.
    DATA: FIELDCAT  TYPE LVC_T_FCAT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      CALL SCREEN 100.
         Module  status_0100  OUTPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
    Create Controls
      CREATE OBJECT ALV_CONTAINER
             EXPORTING
                   CONTAINER_NAME    = 'ALV_CONTAINER'.
      CREATE OBJECT ALV_GRID
             EXPORTING
                   I_PARENT          =  ALV_CONTAINER.
    Create Event Receiver
      CREATE OBJECT EVENT_RECEIVER.
    ALV Specific. Data selection.
    Populate Field Catalog
      PERFORM GET_FIELDCATALOG.
      CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          CHANGING
               IT_OUTTAB       = I_ALV[]
               IT_FIELDCATALOG = FIELDCAT[].
      handler for ALV grid
      SET HANDLER EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR ALV_GRID.
    ENDMODULE.
         Module  USER_COMMAND_0100  INPUT
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK' OR 'CANC'.
          IF NOT ALV_CONTAINER IS INITIAL.
            CALL METHOD ALV_CONTAINER->FREE.
            CLEAR: ALV_CONTAINER.
            FREE : ALV_CONTAINER.
          ENDIF.
          IF SY-SUBRC = 0.
            SET SCREEN 0.
            LEAVE SCREEN.
          ELSE.
            LEAVE PROGRAM.
          ENDIF.
        WHEN 'EXIT'.
          IF NOT ALV_CONTAINER IS INITIAL.
            CALL METHOD ALV_CONTAINER->FREE.
            CLEAR: ALV_CONTAINER.
            FREE : ALV_CONTAINER.
          ENDIF.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.
    FORM GET_DATA
    FORM GET_DATA.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE I_ALV
            FROM MARA
              INNER JOIN MAKT
                ON MARAMATNR = MAKTMATNR
                   WHERE MARA~MATNR IN S_MATNR
                     AND MAKT~SPRAS = SY-LANGU.
      SORT I_ALV ASCENDING BY MATNR.
    ENDFORM.
         Form  Get_Fieldcatalog - Set Up Columns/Headers
    FORM GET_FIELDCATALOG.
      DATA: LS_FCAT TYPE LVC_S_FCAT.
      REFRESH: FIELDCAT.
      CLEAR: LS_FCAT.
      LS_FCAT-REPTEXT    = 'Material Number'.
      LS_FCAT-COLTEXT    = 'Material Number'.
      LS_FCAT-FIELDNAME  = 'MATNR'.
      LS_FCAT-REF_TABLE  = 'I_ALV'.
      LS_FCAT-OUTPUTLEN  = '18'.
      LS_FCAT-COL_POS    = 1.
      APPEND LS_FCAT TO FIELDCAT.
      CLEAR: LS_FCAT.
      LS_FCAT-REPTEXT    = 'Material Description'.
      LS_FCAT-COLTEXT    = 'Material Description'.
      LS_FCAT-FIELDNAME  = 'MAKTX'.
      LS_FCAT-REF_TABLE  = 'I_ALV'.
      LS_FCAT-OUTPUTLEN  = '40'.
      LS_FCAT-COL_POS    = 2.
      APPEND LS_FCAT TO FIELDCAT.
    ENDFORM.
    DRILL_DOWN
    FORM DRILL_DOWN USING INDEX.
      READ TABLE I_ALV INDEX INDEX.
      IF SY-SUBRC = 0.
    Do whatever you need to do, in this case, I'm driling into tcode MM03
        SET PARAMETER ID 'MAT' FIELD I_ALV-MATNR.
        CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDFORM.
    <b>Reward if useful</b>

  • On Double Clicking An ALV

    Hi ALL,
    I have a doubt in ALV,
    My requirement is that, I developed one ALV report.
    Now when i double click one field i have to show some fields in a new report.
    How this can be done.
    Thanks & Regards,
    Pradeep Alex

    BC ALV report will help you using OOABAP.
    any method you want to use, what you need to do is pass a subroutine name to the  USER_COMMAND method. either directly in the  ALV FM export parameter or in the event table.
    in this subroutine which you have defined for USER_COMMAND, do what ever code you want. this will trigger when you double click the ALV output.

  • Tab not working on ALV report output in Persona

    In normal SAP GUI we can move the cursor position on ALV report output between different column by pressing TAB on keyboard. But in case of persona 2.00, TAB doesn't work and we have to click on each cell of the report output whatever we want to highlight. Is there any settings or SAP note we can implement to so TAB will work on persona.
    Thanks,
    harkamal

    Hi Devendra Singh,
    I think it's not possible to show all field values in another Language (Eg Thai) But it's possible if it's short Text, Long Text etc
    SE63 and follow menu
    Translation
    ABAP Objects
    Short Text / Long Text Etc..
    AND
    Translation
    NON ABAP Objects
    For that also you have to maintain it first in SE63..
    [SAP Help1|http://help.sap.com/erp2005_ehp_04/helpdata/EN/77/5719d2492011d1894a0000e829fbbd/frameset.htm]
    [SAP Help2|http://help.sap.com/erp2005_ehp_04/helpdata/EN/b4/54601d77f38e429ffad9e3e11c1b25/frameset.htm]
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • ALV Report output in Excel format

    Hi ,
    I am facing a different behaviour in two computers , while trying to take an Excel format of an ALV report output. After generating the ALV output ,in one , when I click on the Excel Format button - the Excel spreadsheet opens with the output data. In the second computed , under the same action , a blank Excel sheet opens .
    Could someone tell me a solution . What aspect is responsible for this ?
    Regards ,
    Sujata

    Reduce the MACRO security settings in the Excel to Medium.
    Open an execl sheet, Chose from menu Tootls->Macro->Security.
    Chose the radio-buton medium. Close the file and all excel applications.Then try downloading again.
    Regards,
    Ravi

  • How to do the ALV report output in groups and caluculate the tOTALS(URGENT

    Hi
    In my ALV report output .I have to group the output based on the DAYS field
    0-10 days in one group
    10-30 days in one group
    above 30 days one group
    There is also a field by name "AMOUNT" in my output.
    I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
    Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
    Thanks in Advance

    Please don't repost your questions...
    Check out my answer in your other post.
    How to make the ALV report in groups  and caluculate the TOTALS
    Regards,
    Naimesh Patel

  • ALV report output to be send to the respective users through email

    Hi Gurus,
    My requirement is to send the ALV report output to the respective users Email ID (Lotus notes) when the report runs in background.
    Could any one suggest me with sample coding, How to send a ALV report output to the respective email ID's ( Suggest me the FM that used to send a internal table)
    Regards
    Paul

    Hi Paul,
      Here for u the sample code:
    <b>call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_txt               = it_message
                receivers                  = it_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    Store function module return code
      gd_error = sy-subrc.
    Get it_receivers return code
      loop at it_receivers.
      endloop.</b>
    Hope this helps you.Reply for queries
    Regards,
    Kumar.

  • How to give  push button in alv report  output

    hi,
    my requirement is that , i have to give push button in alv report output(item level) not in application toolbar, i am using reuse_alv_grid_display FM, can any body provide me sample code
    regards,
    siva kumar

    have a look at this thread, also has a sample report at the end from Uwe Schieferstein.
    [button on alv list|How to add and program a pushbutton on ALV grid line;
    seems not to work try this:
    How to add and program a pushbutton on ALV grid line
    Edited by: Micky Oestreich on May 15, 2008 10:20 PM

  • Select  mutiple rows in ALV report output

    Hi All,
    I want to select the Multiple records i in ALV report output with out holding the CNTL(Control Key).
    Is there any options in Layout?
    Please let me know
    regards,
    Ajay
    Edited by: Ajay reddy on May 30, 2010 3:27 PM

    Hi Ajay,
    To select several rows without Control button, if the rows are adjacent:
    - select the first and the last of the desired rows with Shift button pressed
    or
    - select a row, keep the mouse button pressed, and pass over the desired rows
    I don't know an option without Control if the rows are not adjacent.
    http://help.sap.com/saphelp_bw/helpdata/en/d1/7d9d37664e4d45e10000009b38f8cf/content.htm
    Regards,
    Paulo Carvalho

Maybe you are looking for

  • How to retreive dynamicly  the name of  a trigger associated with a table

    Hi, Comming from Ms-Access and SQL Server, i use triggers (build by omwb) to get automaticaly a new value to primary keyes (during the insert phase). Is it possible to retreive by sql, schema... the name of a trigger associate to a specific col in a

  • MIGO Base Value.

    Dear Expert Please help me on below scenario. My client is raising PO. The Material cost is 100 INR. While goods receipting, Knowing that material cost is 120 INR. So i am changing the Base value 100 to 120 INR in detail data (Excise item) tab while

  • Issue restarting MacBook Pro, hard drive corruption, explain please

    Hi I am having huge troubles with my MacBook Pro. I was wondering if anyone could possibly explain the reason behind that. Paste of the report: Anonymous UUID:       4932FEB6-68AC-2C4D-886E-1D395BFF8484 Tue Jan  7 20:12:07 2014 panic(cpu 0 caller 0xf

  • Jumpy video playback from iPhone 5 to Mac Book Pro

    Hi I recently took some footage on my iPhone 5 and downloaded onto my 2007 Mac Book Pro via iPhoto. Unfortunately, mid download iPhoto became unresponsive and I had to Force quit. After restarting iPhoto I saw that the videos had not been downloaded

  • How to create the Copy icon in the change Purchase order functionality

    Hi, In the shopping cart creation screen, there has a option to copy one Item in the Items in Shopping Cart section.This functionality is supplied by standard SAP. Now I will have to build the same logic ( Copy Icon with the copy and paste logic)  in