Problem with double click in alv interactive report

Hello frnds,
        the problem is i am displaying basic list using grid display with pf-status and usercommand forms. My first column is checkbox, after selecting checkboxes if i click on the pf-status Button then in the internal table  corresponding field is not getting updated with value 'X'. But once if i double click on the basic list after selecting the checkboxes the values are reflecting as X in the internal table . But my requirement is i want to get the values to be populated once i click on push button only ?
fcode i have used is &IC1( which is the fcode to trigger double event).Please help me out.
Thanks in advance.
subash.

hi ,
i had used like this .. it is working...
*&      Form  USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                        R_SELFIELD TYPE SLIS_SELFIELD.
  clear : v_flag.
  CASE R_UCOMM.
    WHEN 'DATA'.
LOOP AT IT_TEMP.
     if it_temp-checkbox =  'X'.
          v_flag = 'X'.
          v_pernr1 = IT_TEMP-PERNR.
*--Get compensation data and populate final internal table
          refresh it_fin.
          CALL FUNCTION 'Z_HR_COMP_STATEMENT'
            EXPORTING
              PERNR = v_pernr1
              BEGDA = s_date-low
              ENDDA = s_date-high
            TABLES
              FINAL = it_fin.
          if not it_fin[] is initial.
            delete adjacent duplicates from  it_fin comparing pernr.
            read table it_fin index 1.
            move-corresponding it_fin to it_final.
            append it_final.
            clear it_final.
          endif.
        endif.
     enddo.
ENDLOOP.
      if not v_flag is initial.
*------ display final data
        PERFORM final_display.
      else.
        message s000 with 'Select atleast one pernr'.
      endif.
  endcase.
ENDFORM.                    "USER_COMMAND
regards,
venkat.

Similar Messages

  • Problem in double click in ALV

    In the ALV GRID , I have used the following code to go to VA02 and VA22 .
    WHEN c_ic1.
        Retrieve the vbeln value of the record selected and use it to open tcode VA02.
          CLEAR wa_outtab.
          READ TABLE i_outtab INTO wa_outtab with key p_rs_selfield-fieldname.
          SET PARAMETER ID c_pid FIELD wa_outtab-vbeln.
          if wa_outtab-auart eq  C_ZQT .
          CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.
          ELSEIF wa_outtab-auart eq  C_ZQR .
          CALL TRANSACTION c_tcode2 AND SKIP FIRST SCREEN.
          ELSE.
          CALL TRANSACTION c_tcode1 AND SKIP FIRST SCREEN.
          ENDIF .
          IF sy-subrc <> 0.
            no requirement to display error message in case error
            in opening tcode va02.
          ENDIF.
    Now My problem is that when the user clicks on a particular sales order in ALV GRID , that particular sales order should be displayed in VA02 .I,e instead of user entering the value of sales order manualy in VA02 . It has to automatically take from the ALV GRID tht particular sales order whic he has double clicked in the ALV .
    Please tell me how to achieve this functionality ..
    Regards
    pavan

    refer this code.....
    pass USER_COMMAND IN ALV AND THEN
    ADD THE CODE LIKE THIS..
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    *break mtabap.
      data : lv_vbeln TYPE vbeln_va.
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'VBELN' .
           Read table  IT_FINAL into  wa_FINAL index rs_selfield-tabindex.
            if sy-subrc = 0.
              lv_vbeln = wa_FINAL-vbeln.
              SET PARAMETER ID 'AUN' FIELD lv_vbeln.
              CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN .
           clear lv_vbeln.
            endif.
          ENDIF.
          clear wa_final.
            ENDCASE.
    ENDFORM. "user_command

  • Problems with Page Break in an Interactive Reporting report

    Hello everybody,
    Platform: Hyperion System 9.3.1.
    I have serious problems in managing the 'page break' in an Interactive Reporting report.
    The report shows sales data by store, with article and colour details and it is organized like this:
    group 1: geographic area
    group 2: country
    group 3: city
    group 4: store
    columns: article, colour
    facts: quantity, price, value
    My client's request is to perform a page break at the store group level, meaning that apart from the first store occurance, any change in the store value shoul start a new page.
    The requested result is like this:
    page1: geographic area1
    country1
    city1
    store1
    data store1...
    page 2: store2
    data store2...
    page3: store3
    data store3...
    I tried several combinations of using Break After and Break Before on the store group, with Keep Next / Keep Together and it was impossible to obtain the desired result.
    If I use Break Before the result is as follows:
    page 1: geographic area1
    country1
    city1
    page 2: store1
    data store1...
    page 3: store2
    data store2...
    If I use Break After the result is as follows:
    page 1: geographic area1
    country1
    city1
    store 1
    page 2: data store1...
    store 2
    page 3: data store2...
    even if I specify 'Keep with next' or 'Keep together' for store group and the store data table.
    Any help will be very very appreciated because I've been trying for weeks to figure out this issue.
    Daniela

    First start without using any of the Keep with Next and Keep together.
    Second. try putting the Page Break in the Group Footer. You do not need to keep it visible
    Then you may want to repeat headers on Store in case the Store's Detail rolls onto next page
    Hope this helps
    Wayne

  • Problems with using special characters in Interactive Report Search

    Hi!
    I am currently developing an Application on Application Express 3.1.2.00.02 including a page with an Interactive Report, facing the problem that I cannot use special german characters in the Searchbar.
    So if i try to find a name like 'Schröder' the created Filter looks like this 'Schröder' and i won't get any valid search results. By the way the rest of the application supports these special characters like using them in Buttons or any other Page elements.
    Does anyone have a clue how to fix this problem, because it's driving me nuts ;)
    Thanks in advance
    Philipp
    Edited by: philipp_m on 10.06.2009 11:15

    Does noybody have a clue how to solve this problem. I tried to find out where the Problem occures. The Ajax Request looks like this
    f01     contains
    f01     Schröder
    f01     15
    p_flow_id     100
    p_flow_step_id     50
    p_instance     3176950818119673
    p_request     APXWGT
    p_widget_action     QUICK_FILTER
    p_widget_action_mod     ADD
    p_widget_mod     ACTION
    p_widget_name     worksheet
    p_widget_num_return     15
    x01     14175446766823030
    x02     14176526259823035
    So I guess it has to be inside the Javascript file (apex_ns_3_1.js). I hope someone can help me.
    Bye
    Philipp

  • Yosemite problems with double click dock commands and keyboard shorcuts

    I have a mid 2012 macbook pro 17", i recently installed Yosemite although it fixed my internet problem (connection dropping randomly) now i am having issues with opening apps and files. Double clicking on a file launches the corresponding app but does't open the file i just get and message stating the app is not open anymore if click the file again. Finder keyboard shorcuts such as command+Q don't work. Can't access some menu items such as "about this mac". Dragging a file into the dock icon launches the app but doesn't open the file either.
    I have no idea what's causing this. anybody got a clue or having similar problems
    Thank you

    Same problem here. (Yosemite 10.0.1)
    the mouse is a 'team scorpion g-reaver' http://teamscorpion.net/ts2014/g-reaver_1.html
    It's work perfectly on the pc of my brother (he uses windows).
    It's a clean install...
    And has a funny fact... The Left Button was with this problem... So what I did? I changed the primary mouse button to the Right... Worked ok for almost 1~2 days... After that, the two buttons showed the double-click problem....
    But, I repeat, the mouse works perfectly in the windows of my brother '-'

  • How can i show details in ALV GRID with double click in a row?

    Hello, ich try to show the details of a row with double click in the line,
    but it doesn't work!?
    I have a eventhandler for doubleclick and the program run this code, but what i have to do, to show the details!?
    I try it with some methods like cl_gui_cfw=>set_new_ok_code, ...
    i think about the methods cl_gui_alv_grid->show_detail, but this method is private,
    i can create a class with inheritance of the cl_gui_alv_grid class and try this method!?
    Have anybody any ideas!?

    Hello Lars
    The following sample reports shows an ALV list with company codes. Double-clicking on any company code will open a second ALV list displaying all customers.
    *& Report  ZUS_SDN_ALVGRID_EVENTS_1
    REPORT  zus_sdn_alvgrid_events_1.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_docking2      TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_t001          TYPE STANDARD TABLE OF t001,
      gt_knb1          TYPE STANDARD TABLE OF knb1.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_t001     TYPE t001,
          ls_col_id   TYPE lvc_s_col.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_t001 INTO ls_t001 INDEX e_row-index.
        CHECK ( ls_t001-bukrs IS NOT INITIAL ).
        SELECT * FROM knb1 INTO TABLE gt_knb1
          WHERE bukrs = ls_t001-bukrs.
        IF ( syst-subrc NE 0 ).
          MESSAGE 'No customers found' TYPE 'S'.
        ELSE.
    *     Trigger PAI of dynpro '0100' and set new ok-code
          CALL METHOD cl_gui_cfw=>set_new_ok_code( 'CALL_SCREEN_0200' ).
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM t001 INTO TABLE gt_t001.
      REFRESH: gt_knb1.
    * 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 OBJECT go_docking2
        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 ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      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 go_grid2
        EXPORTING
          i_parent          = go_docking2
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'T001'
        CHANGING
          it_outtab        = gt_t001
        EXCEPTIONS
          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 METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          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.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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 METHOD go_docking2->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0200'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    * ok-code field = GD_OKCODE
      CALL SCREEN '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.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'CALL_SCREEN_0200'.
          go_grid2->refresh_table_display( ).  " necessary
          CALL SCREEN '0200'.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Regards
      Uwe

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

  • 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

  • Difference between Interactive report and ALV Interactive report.

    What is the difference between Interactive report and ALV Interactive report.
    i think there is no much difference the same Interactive report Events and functionality we will implement with ALV.
    Experts guide me.

    Hi,
    ALV interactive report gives many advantages than interactive report like sorting, summing and getting graphics.
    An interactive report generally basic list displayed. User double clicks on any valid line or user selects a line and presses as button on the tool bar. Then the corresponding event is triggered
    refer
    http://www.sapgenie.com/abap/drill_down_reports.htm
    You can find a interactive ALV report here
    http://www.sap-img.com/abap/an-interactive-alv-report.htm
    also refer
    Below threads consist of number of interactive ALV codes:
    interactive ALV code
    ALV-INTERACTIVE.
    Interactive ALV
    Regards

  • 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

  • ALV Interactive report! Need Simple Logic

    Hi!
       Can any one tell me the simple logic (steps) to be followed in developing alv interactive report
      NO CODING PLEASE
      Thanks
      Imran

    Hi Imran,
        Here i am trying to explain through the standard ALV FMs...
    1) You will do the same coding as how you will do for normal ALV through FMs.
    2)  Create an event type variable of type - SLIS_T_EVENT
    3) Call function module REUSE_ALV_EVENTS_GET to get all the events like 'USER COMMAND'
    4) Fill the internal table with the form name against USER COMMAND event.
    5) create FORM & ENDFORM for the USER COMMAND event.
    6) With in the form which you created in 5th step, create a variable of type - SLIS_SELFIELD, to capture user click information like on which field name & value user clicked.
    7) When you press on Base list of ALV, SY-UCOMM value will be &IC1, based on that you can validate whether user clicked or not on base list.
    8) Again you will populate the internal tables with required entries for the interactive list and we will call REUSE_ALV fm once again.
    I hope you understand the process, if not please get back to me.
    Regards,
    Donepudi
    Reward if its helpful.

  • Double click in alv list

    Hi all,
    Here is the code:
    my aim is to double click the alv list and display the correspoonding data .can any one tell me how to solve this.
    regards,
    Lisa
    Message was edited by: Lisa Roy

    Hi Lisa,
    **-ALV list Display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = SY-REPID
       <b>   I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'</b>
        <b>  I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'</b>
          IS_LAYOUT                = X_LAYOUT
          IT_FIELDCAT              = IT_FIELDCAT
          IT_EVENTS                = IT_EVENTS
        TABLES
          T_OUTTAB                 = IT_FINAL
        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.
    you need to pass these two forms
    FORM PF_STATUS_SET USING    P_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING P_EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE
                                                             SLIS_SELFIELD.
    case UCOMM.
    when '&IC1'.  "this is for double click.
    "do some thing..
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Open file from table with double click

    Hi all,
    I use adf faces and JDEV 11.
    I want to open a file by double clicking on row in a table. (file is stored in the database).
    I first tried it with a button to open the file, with this code:
           System.out.println("Double click!");       
           BindingContainer bindings = this.getBindings();
            DCIteratorBinding iter = (DCIteratorBinding)bindings.get("XxahelpBezoekRapDocView1Iterator");
            Row row = iter.getCurrentRow();
            FacesContext fc = FacesContext.getCurrentInstance(); 
            HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse();
            response.setHeader("Content-Disposition","attachment; filename=\""+row.getAttribute("Filename").toString()+"\"");
            response.setHeader("cache-control", "no-cache");
            try {
                InputStream in;
                in = ((BlobDomain)row.getAttribute("Bijlage")).getInputStream();
                ServletOutputStream out = response.getOutputStream();
                writeInputStreamToOutputStream(in, out);
                fc.responseComplete();     
            } catch (IOException e) {
                e.printStackTrace();
            } This is working fine.
    Now I wan't to open the file with double clicking on a row.
    For opening the file I use the same code in the backing bean and this code on the page:
          <f:facet name="metaContainer">
        <af:group>
            <trh:script>
               goEditRow = function(event) {
                    AdfCustomEvent.queue( event.getSource(), "doubleClickOnRow", {}, false);
            </trh:script>
        </af:group>
        </f:facet>And a clientListener and serverListener on the table:
    <af:clientListener method="goEditRow" type="dblClick"/>
    <af:serverListener type="doubleClickOnRow" method="#{backingBeanScope.backing_pages_EditTicket.doubleClick}"/>The only thing that happens when I double click is that I see "Double click!" in the console. But I can't save the file :S
    What is the problem?
    Thanks in advance.

    Hi
    What we do is to pick a table column for downloading the file.
    We change the component in the column to the an af:commandLink and add an
    af:fileDownLoadActionListener to the command link.
    The user clicks on the link to download (open) the file.
    Its not exactly the same as what you requested (double
    click on the row) but it might be another solution.
    Regards
    Paul

  • Why can't I open files with double click, etc?

    Hello, all,
    I have been having problems with my MacBook (Aluminum late 2008, I think, OS 10.5). It runs slowly; files on the desktop and in my "Macintosh HD" often won't open with double-click but have to be opened with File-->Open; there are Word Work Files that won't go away; the trackpad is often stiff and not very responsive; clicking on the mouse is very stiff, despite very easy settings. In short, a lot of things are sluggish. Sometimes, also, I get the spinning beach ball, but not all the time.
    I have run disk permissons repair from Disk Utility many times (both from the desktop and from the MacBook install disk); I have replaced the directory with Disk Warrior at least twice; I have verified that the disk is OK; I have zapped the PRAM; and done other things of that kind.
    I took the MacBook to an Apple Store yesterday. It had been unplugged and much to my surprise, most everything seemed to be working all right. When I opened it today, however, I found everything as it was before I took it to Apple. Including the Word Work files, which I thought were gone.
    If I recall correctly, this started when I was working on a long editing project in Word, but I don't know whether that has anything to do with what has happened. I've done similarly long projects before, and this never happened.
    I could try trashing the Word Work files (there seem also to be quite a lot of folders with "recovered" files), but I don't want to do that unless I can be assured that nothing bad will come from doing that.
    I know this seems quite comprehensive, and may involve several issues, but I'm really unhappy about this and would love to think there is something more I can do, apart from returning to the Apple Store. Besides everything else, how can I khow that I won't find, again, that the MacBook will work fine there but goes back to its troubled state when I return?
    Clues, anyone?
    Thanks,
    jenny

    Hi, Mike,
    I have 211.59 left out of total HD space of 232.57.Space should not be a problem. I'll try using Activity  Monitor today. I have 2 GB of memory. But since this is the first time I[ve had this problem, I don't see how it could be a problem with memory, do you?
    I finished the project more than a week ago. After I shut down the computer, it temporarily returned to normal but subsewuently started acting odd again, although I've done nothing but email since I turned it on again.
    I am going to try getting rid of the Word Work files and see whether that helps. I am wondering whether the book I was working on had something wrong with it (it was written in NeoOffice but opened in Word), or my copy of Word has gotten corrupted. Although I haven't used Word since I finished with the book.
    Sorry this font is so tiny, but although I was able to choose my font in my original message, there doesnt' seem to be a place to do that here. At least, I don't see it.
    I'll get back to you on the Activity Monitor. Thanks.
    jenny

  • Alv interactive report  for secondary list

    Hi All,
    This is my code for ALV interactive report. Its working Properly for me when i select material number iam able to display the secondary list properly . if i sorted the basic list other than material number for ex . created date . iam uable to display correct secondary list . Can any one help me in this issue?
    REPORT  ZWRLOMDMM_PMG_PHWEB_PLD   NO STANDARD PAGE HEADING
            LINE-SIZE 120
            LINE-COUNT 65
            MESSAGE-ID 00.
    TABLES                                                              *
    TABLES: MARA ,      "General Material Data
            ZWPBPH.     " Published Product Hierarchy
    TYPE-POOLS                                                          *
    TYPE-POOLS:SLIS .
    DATA:FIELDCATALOG_BASIC TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
         FIELDCATALOG_SECONDARY TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
         GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
         GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
         GD_REPID LIKE SY-REPID.
    INTERNAL TABLES                                                     *
    *Internal Tables to Get Data.
    *Internal Table For MARA Table.
    DATA:BEGIN OF T_MARA OCCURS 0 ,
            MATNR LIKE MARA-MATNR,
            MTART LIKE MARA-MTART,
            ERSDA LIKE MARA-ERSDA,
            ERNAM LIKE MARA-ERNAM,
            AENAM LIKE MARA-AENAM,
            SPART LIKE MARA-SPART,
         END OF T_MARA.
    *Internal Table For ZWPBPH Table.
    DATA:BEGIN OF T_ZWPBPH OCCURS 0 ,
           PBPINO LIKE ZWPBPH-PBPINO,
           PBPAPINO LIKE ZWPBPH-PBPAPINO,
         END OF T_ZWPBPH.
    *Internal Table For Basic List Field Catalog.
    DATA:BEGIN OF T_ALV OCCURS 0 ,
           MATNR LIKE MARA-MATNR,
           MTART LIKE MARA-MTART,
           ERSDA LIKE MARA-ERSDA,
           ERNAM LIKE MARA-ERNAM,
           SPART LIKE MARA-SPART,
           SPART1(3),
         END OF T_ALV.
    *Internal Table For Secondary List Field Catalog.
    DATA: BEGIN OF T_ALVS OCCURS 0 ,
            MATNR LIKE MARA-MATNR,
            AENAM LIKE MARA-AENAM,
            LAEDA LIKE MARA-LAEDA,
          END OF T_ALVS.
    *Internal Table For Model
    DATA:T_MODEL LIKE T_ZWPBPH OCCURS 0 WITH HEADER LINE.
    *Internal Table For Product
    DATA:T_PRODUCT LIKE T_ZWPBPH OCCURS 0 WITH HEADER LINE.
    *Internal Table For Family
    DATA:T_FAMILY LIKE T_ZWPBPH OCCURS 0 WITH HEADER LINE.
    *Internal Table For Line
    DATA:T_LINE LIKE T_ZWPBPH OCCURS 0 WITH HEADER LINE.
    *Internal Table For Type
    DATA:T_TYPE LIKE T_ZWPBPH OCCURS 0 WITH HEADER LINE.
    SELECTION SCREEN                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: P_MATN RADIOBUTTON GROUP R1  USER-COMMAND run default 'X'.
    SELECT-OPTIONS: P_MATNR FOR MARA-MATNR MODIF ID SC1 .
    PARAMETERS: P_DAT RADIOBUTTON GROUP R1  .
    SELECT-OPTIONS: : P_DATE FOR MARA-LAEDA  MODIF ID SC2.
    PARAMETERS: P_DIV RADIOBUTTON GROUP R1  .
    SELECT-OPTIONS: : P_DIVIS for mara-spart  MODIF ID SC3.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION                                                      *
    INITIALIZATION.
      REFRESH: T_MARA,
               T_ZWPBPH,
               T_ALV,
               T_ALVS,
               T_MODEL,
               T_PRODUCT,
               T_FAMILY,
               T_LINE,
               T_TYPE.
      CLEAR:   T_MARA,
               T_ZWPBPH,
               T_ALV,
               T_ALVS,
               T_MODEL,
               T_PRODUCT,
               T_FAMILY,
               T_LINE,
               T_TYPE.
      GD_REPID = SY-REPID.
    *AT SELECTION-SCREEN OUTPUT.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF P_MATN = 'X'.
          FREE : P_DIVIS,P_DATE.
          IF SCREEN-GROUP1 = 'SC2' or SCREEN-GROUP1 = 'SC3'.
            SCREEN-INPUT  = 0.
            MODIFY SCREEN.
            CONTINUE.
          ENDIF .
        ENDIF.
        IF P_DAT = 'X'.
          FREE : P_MATNR,P_DIVIS.
          IF SCREEN-GROUP1 = 'SC1' or  SCREEN-GROUP1 = 'SC3'.
            SCREEN-INPUT  = 0.
            MODIFY SCREEN.
            CONTINUE.
          ENDIF .
        ENDIF.
        IF P_DIV = 'X'.
          FREE : P_DATE,P_MATNR.
          IF SCREEN-GROUP1 = 'SC1' or SCREEN-GROUP1 = 'SC2'.
            SCREEN-INPUT = 0.
            MODIFY SCREEN.
            CONTINUE.
          ENDIF .
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION                                                  *
    START-OF-SELECTION.
      PERFORM GET_FIELDCATALOG_BASIC.
      PERFORM GET_FIELDCATALOG_SECONDARY.
      PERFORM POPULATE_DATA.
    END-OF-SELECTION                                                    *
    END-OF-SELECTION.
    *&      FORM GET_FIELDCATALOG_BASIC.
    Get Fieldcatalog For Basic List
    FORM GET_FIELDCATALOG_BASIC.
      FIELDCATALOG_BASIC-FIELDNAME = 'MATNR'.
      FIELDCATALOG_BASIC-SELTEXT_M = 'Material Number'.
      FIELDCATALOG_BASIC-COL_POS   = 0.
      FIELDCATALOG_BASIC-OUTPUTLEN = 20.
      FIELDCATALOG_BASIC-HOTSPOT   = 'X'.
      FIELDCATALOG_BASIC-EMPHASIZE = 'X'.
      FIELDCATALOG_BASIC-KEY       = 'X'.
      APPEND FIELDCATALOG_BASIC TO FIELDCATALOG_BASIC.
      CLEAR FIELDCATALOG_BASIC.
      FIELDCATALOG_BASIC-FIELDNAME = 'MTART'.
      FIELDCATALOG_BASIC-SELTEXT_M = 'Material Type'.
      FIELDCATALOG_BASIC-COL_POS   = 0.
      FIELDCATALOG_BASIC-OUTPUTLEN = 20.
      FIELDCATALOG_BASIC-EMPHASIZE = 'X'.
      FIELDCATALOG_BASIC-KEY       = 'X'.
      APPEND FIELDCATALOG_BASIC TO FIELDCATALOG_BASIC.
      CLEAR FIELDCATALOG_BASIC.
      FIELDCATALOG_BASIC-FIELDNAME = 'ERSDA'.
      FIELDCATALOG_BASIC-SELTEXT_M = 'Created Date'.
      FIELDCATALOG_BASIC-COL_POS   = 0.
      FIELDCATALOG_BASIC-OUTPUTLEN = 12.
      FIELDCATALOG_BASIC-EMPHASIZE = 'X'.
      FIELDCATALOG_BASIC-KEY       = 'X'.
      APPEND FIELDCATALOG_BASIC TO FIELDCATALOG_BASIC.
      CLEAR FIELDCATALOG_BASIC.
      FIELDCATALOG_BASIC-FIELDNAME = 'ERNAM'.
      FIELDCATALOG_BASIC-SELTEXT_M = 'Created By'.
      FIELDCATALOG_BASIC-COL_POS   = 0.
      FIELDCATALOG_BASIC-OUTPUTLEN = 15.
      FIELDCATALOG_BASIC-EMPHASIZE = 'X'.
      FIELDCATALOG_BASIC-KEY       = 'X'.
      APPEND FIELDCATALOG_BASIC TO FIELDCATALOG_BASIC.
      CLEAR FIELDCATALOG_BASIC.
      FIELDCATALOG_BASIC-FIELDNAME = 'SPART'.
      FIELDCATALOG_BASIC-SELTEXT_M = 'Division PMG'.
      FIELDCATALOG_BASIC-COL_POS   = 0.
      FIELDCATALOG_BASIC-OUTPUTLEN = 14.
      FIELDCATALOG_BASIC-EMPHASIZE = 'X'.
      FIELDCATALOG_BASIC-KEY       = 'X'.
      APPEND FIELDCATALOG_BASIC TO FIELDCATALOG_BASIC.
      CLEAR FIELDCATALOG_BASIC.
      FIELDCATALOG_BASIC-FIELDNAME = 'SPART1'.
      FIELDCATALOG_BASIC-SELTEXT_M = 'Division PhWEB'.
      FIELDCATALOG_BASIC-COL_POS   = 0.
      FIELDCATALOG_BASIC-OUTPUTLEN = 14.
      FIELDCATALOG_BASIC-EMPHASIZE = 'X'.
      FIELDCATALOG_BASIC-KEY       = 'X'.
      APPEND FIELDCATALOG_BASIC TO FIELDCATALOG_BASIC.
      CLEAR FIELDCATALOG_BASIC.
    ENDFORM.                    "GET_FIELDCATALOG_BASIC
    *&      FORM GET_FIELDCATALOG_SECONDARY
    Get Fieldcatalog For Secondary List
    FORM GET_FIELDCATALOG_SECONDARY.
      FIELDCATALOG_SECONDARY-FIELDNAME = 'MATNR'.
      FIELDCATALOG_SECONDARY-SELTEXT_M = 'Material Number'.
      FIELDCATALOG_SECONDARY-COL_POS   = 0.
      FIELDCATALOG_SECONDARY-OUTPUTLEN = 20.
      FIELDCATALOG_SECONDARY-EMPHASIZE = 'X'.
      FIELDCATALOG_SECONDARY-KEY       = 'X'.
      APPEND FIELDCATALOG_SECONDARY TO FIELDCATALOG_SECONDARY.
      CLEAR FIELDCATALOG_SECONDARY.
      FIELDCATALOG_SECONDARY-FIELDNAME = 'AENAM'.
      FIELDCATALOG_SECONDARY-SELTEXT_M = 'Changed By'.
      FIELDCATALOG_SECONDARY-COL_POS   = 0.
      FIELDCATALOG_SECONDARY-OUTPUTLEN = 20.
      FIELDCATALOG_SECONDARY-EMPHASIZE = 'X'.
      FIELDCATALOG_SECONDARY-KEY       = 'X'.
      APPEND FIELDCATALOG_SECONDARY TO FIELDCATALOG_SECONDARY.
      CLEAR FIELDCATALOG_SECONDARY.
      FIELDCATALOG_SECONDARY-FIELDNAME = 'LAEDA'.
      FIELDCATALOG_SECONDARY-SELTEXT_M = 'Changed ON'.
      FIELDCATALOG_SECONDARY-COL_POS   = 0.
      FIELDCATALOG_SECONDARY-OUTPUTLEN = 20.
      FIELDCATALOG_SECONDARY-EMPHASIZE = 'X'.
      FIELDCATALOG_SECONDARY-KEY       = 'X'.
      APPEND FIELDCATALOG_SECONDARY TO FIELDCATALOG_SECONDARY.
      CLEAR FIELDCATALOG_SECONDARY.
    ENDFORM.                    "GET_FIELDCATALOG_SECONDARY
    *&      FORM POPULATE_DATA
    FORM POPULATE_DATA.
    *Get Data From MARA And ZWPBPH Tables
      IF P_MATN = 'X'.
    SELECT MATNR MTART ERSDA ERNAM AENAM SPART FROM MARA INTO TABLE T_MARA
    where MATNR IN P_MATNR .
        IF SY-SUBRC <> 0.
          MESSAGE E001(0) WITH 'Invalid Material Number'.
        ENDIF.
      ELSEIF P_DAT = 'X'.
    SELECT MATNR MTART ERSDA ERNAM AENAM SPART FROM MARA INTO TABLE T_MARA
    where LAEDA IN P_DATE .
        IF SY-SUBRC <> 0.
          MESSAGE E001(0) WITH 'Invalid Date Range'.
        ENDIF.
      ELSEIF P_DIV = 'X'.
    SELECT MATNR MTART ERSDA ERNAM AENAM SPART FROM MARA INTO TABLE T_MARA
    where SPART IN P_DIVIS .
        IF SY-SUBRC <> 0.
          MESSAGE E001(0) WITH 'Invalid Division'.
        ENDIF.
      ELSEIF P_MATN = ' ' AND P_DAT = ' ' AND  P_DIV = ' '.
    SELECT MATNR MTART ERSDA ERNAM AENAM SPART FROM MARA INTO TABLE T_MARA.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM T_MARA COMPARING MATNR.
      SORT T_MARA BY MATNR.
      IF T_MARA[] IS NOT INITIAL .
    SELECT PBPINO PBPAPINO FROM ZWPBPH INTO TABLE T_ZWPBPH FOR ALL ENTRIES
    IN T_MARA WHERE PBPINO = T_MARA-MATNR.
      ENDIF.
      IF SY-SUBRC = 0.
        LOOP AT  T_ZWPBPH.
          SELECT SINGLE PBPINO PBPAPINO FROM ZWPBPH INTO  T_MODEL   WHERE
          PBPINO = T_ZWPBPH-PBPAPINO.
          IF SY-SUBRC = 0.
          SELECT SINGLE PBPINO PBPAPINO FROM ZWPBPH  INTO T_PRODUCT   WHERE
          PBPINO
          = T_MODEL-PBPAPINO.
          ENDIF.
          IF SY-SUBRC = 0.
           SELECT SINGLE PBPINO PBPAPINO FROM ZWPBPH  INTO T_FAMILY   WHERE
           PBPINO = T_PRODUCT-PBPAPINO.
          ENDIF.
          IF SY-SUBRC = 0.
            SELECT SINGLE PBPINO PBPAPINO FROM ZWPBPH  INTO T_LINE   WHERE
            PBPINO = T_FAMILY-PBPAPINO.
          ENDIF.
          IF SY-SUBRC = 0.
       SELECT SINGLE PBPINO PBPAPINO FROM ZWPBPH INTO T_TYPE   WHERE PBPINO
        = T_LINE-PBPAPINO.
          ENDIF.
          IF SY-SUBRC = 0.
         SELECT SINGLE MTART ERSDA ERNAM SPART FROM MARA INTO CORRESPONDING
          FIELDS OF T_ALV WHERE MATNR = T_ZWPBPH-PBPINO AND SPART <>
        T_TYPE-PBPAPINO+1(2).
          ENDIF.
          IF SY-SUBRC = 0.
            MOVE T_ZWPBPH-PBPINO TO T_ALV-MATNR.
            MOVE T_TYPE-PBPAPINO+1(2) TO T_ALV-SPART1.
            APPEND T_ALV.
            SELECT SINGLE MATNR AENAM LAEDA FROM MARA INTO CORRESPONDING
            FIELDS OF T_ALVS WHERE MATNR = T_ZWPBPH-PBPINO.
            APPEND T_ALVS.
            CLEAR T_ALVS.
          ENDIF.
        ENDLOOP.
      ENDIF.
      SORT T_ALV BY MATNR.
      SORT T_ALVS BY MATNR.
      call function 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = GD_REPID
          i_callback_user_command = 'DISPLAY_DETAIL'
          it_fieldcat             = FIELDCATALOG_BASIC[]
          i_save                  = 'X'
        TABLES
          t_outtab                = T_ALV
        EXCEPTIONS
          program_error           = 1
          others                  = 2.
    ENDFORM.                    "POPULATE_DATA
    *&      Form  DISPLAY_DETAIL
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM DISPLAY_DETAIL USING UCOMM LIKE SY-UCOMM
    SELFIELD TYPE SLIS_SELFIELD.
    Select Material Number For Secondary List
      DATA: T_ALV_TEMP LIKE T_ALVS OCCURS 0 WITH HEADER LINE.
      IF UCOMM = '&IC1'.
        READ TABLE T_ALVS INDEX SELFIELD-TABINDEX.
        IF SY-SUBRC = 0.
          MOVE T_ALVS TO T_ALV_TEMP.
          APPEND T_ALV_TEMP.
        ENDIF.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program = GD_REPID
            it_fieldcat        = FIELDCATALOG_SECONDARY[]
          TABLES
            t_outtab           = T_ALV_TEMP.
      ENDIF.
    ENDFORM.                    "DISPLAY_DETAIL

    Hi,
    Try this in the routine display details
    READ TABLE T_ALV INDEX SELFIELD-TABINDEX.
    READ TABLE T_ALVS with key matnr = T_ALV-MATNR
    thanks

Maybe you are looking for

  • What is new in firmare - missing on this site!

    When software is updated - I can't find what is new on Nokia site? Can somebody help?

  • HP Scanner not working with Lion?

    The print function is fine but the scanner won't work.  I have tried removing the printer and reinstalling, but that didn't work.  Any ideas?

  • Failover from MPLS network to EIGRP network, need help.

    I hope I explain this right. We are about to add an MPLS Circuit between HA and SA sites. Currently We have HA Connecting to AV site via ATM and SA connecting to AV site via Frame-relay. All routes are via EIGRP. From what we gather from MPLS you nee

  • [Help] Create dinamically components and its id

    Hello guys. I need a help I know it sounds weird from the title above but I have been struggling to find a better solution but can´t figure it out. I have searched through internet but couldn´t find a solution for my problem. Here is what I have to d

  • (13-inch, Early 2011) Buying memory/RAM from non-Apple vendors?

    I've read somewhat similar threads here, and I apologize if I'm beleaguering the issue - I just couldn't find a comparable match... I have a MacBook Pro - 13-inch (Early 2011), and I'm needing to up RAM/memory (see below screenshot). Processor  2.3 G