Selecting Multiple rows in an ALV

Hi Experts,
Using 'REUSE_ALV_GRID_DISPLAY' is it possible to select multiple rows, WITHOUT using CTRL OR SHIFT keys ?
thanks in advance.

I have done an application for multiple selection in ALV using check box concept. Please find that code below.
*& Report  ZATL_DELIVERY
REPORT  zatl_delivery.
INCLUDE zatl_delivery_declarations.
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
SELECT-OPTIONS:  s_vbeln FOR vbak-vbeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK a.
INITIALIZATION.
AT SELECTION-SCREEN.
START-OF-SELECTION .
SET PF-STATUS 'ABC'.
SET PF-STATUS 'BCD'.
get the sales order numbers thru given
selection-screen parameters
  SELECT vbeln FROM vbak INTO TABLE it_data
          WHERE vbeln IN s_vbeln.
          AND  ERDAT = P_DATE.
  IF NOT it_data[] IS INITIAL.
    SELECT vbeln vstel FROM vbap INTO TABLE it_vstel
             FOR ALL ENTRIES IN it_data
               WHERE vbeln = it_data-vbeln.
  ENDIF.
  LOOP AT it_data INTO wa_data.
    CALL FUNCTION 'ZBAPI_GET_MATERIAL_PLANT_DTL'
      EXPORTING
        v_vbeln = wa_data-vbeln
      TABLES
        it_bapi = it_result.
    LOOP AT it_result INTO wa_result.
      READ TABLE it_vstel INTO wa_vstel WITH KEY
                       vbeln = wa_result-vbeln.
      wa_final-vbeln = wa_result-vbeln. " SALES ORDER NO
      wa_final-matnr = wa_result-matnr.
      wa_final-vstel = wa_vstel-vstel.
      wa_final-werks = wa_result-werks.
      wa_final-labst = wa_result-kwmeng.
      APPEND wa_final TO it_final.
      CLEAR wa_result.
    ENDLOOP.
    REFRESH it_result.
    CLEAR wa_data.
  ENDLOOP.
  PERFORM build_fldcat.
  PERFORM disp_output.
*SET PF-STATUS 'ABC'.
*&      Form  ABC
      text
     -->EXTAB      text
FORM abc USING extab TYPE slis_t_extab.
  SET PF-STATUS 'ABC'. " excluding extab.
ENDFORM.                    "ABC
read
*&      Form  build_fldcat
      text
-->  p1        text
<--  p2        text
FORM build_fldcat .
  wa_fldcat-col_pos = '1'.
  wa_fldcat-fieldname = 'MARK'.
  wa_fldcat-checkbox = 'X'.
  wa_fldcat-edit = 'X'.
  wa_fldcat-seltext_m     = 'MARK'.
  APPEND wa_fldcat TO i_fldcat.
  CLEAR wa_fldcat.
  wa_fldcat-col_pos = '2'.
  wa_fldcat-fieldname = 'VBELN'.
  wa_fldcat-tabname = 'IT_FINAL'.
  wa_fldcat-seltext_m     = 'SALES ORD NO'.
  APPEND wa_fldcat TO i_fldcat.
  wa_fldcat-col_pos = '3'.
  wa_fldcat-fieldname = 'MATNR'.
  wa_fldcat-tabname = 'IT_FINAL'.
  wa_fldcat-seltext_m     = 'MAT NO'.
  APPEND wa_fldcat TO i_fldcat.
  wa_fldcat-col_pos = '4'.
  wa_fldcat-fieldname = 'WERKS'.
  wa_fldcat-tabname = 'IT_FINAL'.
  wa_fldcat-seltext_m     = 'PLANT'.
  APPEND wa_fldcat TO i_fldcat.
  wa_fldcat-col_pos = '5'.
  wa_fldcat-fieldname = 'LABST'.
  wa_fldcat-tabname = 'IT_FINAL'.
  wa_fldcat-seltext_m     = 'QNTY'.
  APPEND wa_fldcat TO i_fldcat.
ENDFORM.                    " build_fldcat
*&      Form  disp_output
      text
-->  p1        text
<--  p2        text
FORM disp_output .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'ABC'
      it_fieldcat              = i_fldcat
      i_callback_user_command  = 'CHECKED'
    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.
ENDFORM.                    " disp_output
*&      Form  CHECKED
      text
     -->R_UCOMM      text
     -->RS_SELFIELD  text
FORM checked USING r_ucomm LIKE sy-ucomm
              rs_selfield TYPE slis_selfield.
  DATA: gd_repid LIKE sy-repid, "Exists
  ref_grid TYPE REF TO cl_gui_alv_grid.
  IF ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        e_grid = ref_grid.
  ENDIF.
  IF NOT ref_grid IS INITIAL.
    CALL METHOD ref_grid->check_changed_data .
  ENDIF.
  CASE r_ucomm.
    WHEN 'DELIVERY'.
      IF rs_selfield-fieldname = 'MARK'.
        DATA : date_external(10) TYPE c.
        DATA: temp_date TYPE sy-datum.
        temp_date = sy-datum.
        temp_date = temp_date + 1.
        CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
          EXPORTING
            date_internal            = sy-datum
          IMPORTING
            date_external            = date_external
          EXCEPTIONS
            date_internal_is_invalid = 1
            OTHERS                   = 2.
        LOOP AT it_final INTO wa_final WHERE mark EQ 'X'.
          PERFORM bdc_dynpro      USING 'SAPMV50A' '0100'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'LV50C-VBELN'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'LIKP-VSTEL'
                                        wa_final-vstel. " 'HLL'.
          PERFORM bdc_field       USING 'LV50C-DATBI'
                                        date_external. "
          PERFORM bdc_field       USING 'LV50C-VBELN'
                                        wa_final-vbeln.     " '34'.
          PERFORM bdc_dynpro      USING 'SAPMV50A' '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'LIPS-MATNR(02)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=SICH'.
          PERFORM bdc_field       USING 'LIKP-BLDAT'
                                        date_external. " '19.09.2008'.
            CLEAR date_external.
          CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
            EXPORTING
              date_internal            = temp_date
            IMPORTING
              date_external            = date_external
            EXCEPTIONS
              date_internal_is_invalid = 1
              OTHERS                   = 2.
          PERFORM bdc_field       USING 'LIKP-WADAT'
                                        date_external ." '19.09.2008'.
            CLEAR date_external.
          PERFORM bdc_field       USING 'LIKP-BTGEW'
                                        wa_final-labst.     " -'12'.
          PERFORM bdc_field       USING 'LIKP-GEWEI'
                                        'wa_likp-GEWEI'.
          PERFORM bdc_transaction USING 'VL01'.
          PERFORM msg_get  TABLES it_msg.
          CLEAR wa_final.
          REFRESH it_msg.
        ENDLOOP.
        PERFORM disp_msg.
      ENDIF.
  ENDCASE.
ENDFORM.                    "CHECKED
*&      Form  BDC_DYNPRO
      text
     -->P_0443   text
     -->P_0444   text
FORM bdc_dynpro  USING    value(p_0443)
                          value(p_0444).
  wa_bdc-program = p_0443.
  wa_bdc-dynpro =  p_0444.
  wa_bdc-dynbegin = 'X'.
  APPEND wa_bdc TO it_bdc.
  CLEAR wa_bdc.
ENDFORM.                    " BDC_DYNPRO
*&      Form  BDC_FIELD
      text
     -->P_0448   text
     -->P_0449   text
FORM bdc_field  USING    value(p_0448)
                         value(p_0449).
  wa_bdc-fnam = p_0448.
  wa_bdc-fval =  p_0449.
  APPEND wa_bdc TO it_bdc.
  CLEAR wa_bdc.
ENDFORM.                    " BDC_FIELD
*&      Form  BDC_TRANSACTION
      text
     -->P_0508   text
FORM bdc_transaction  USING    value(p_0508).
  CALL TRANSACTION p_0508 USING it_bdc
                       MODE 'N'
                       UPDATE 'S'
                       MESSAGES INTO it_msg.
ENDFORM.                    " BDC_TRANSACTION
*&      Form  msg_get
      text
     -->P_IT_MSG  text
FORM msg_get  TABLES   p_it_msg STRUCTURE bdcmsgcoll.
  LOOP AT p_it_msg INTO wa_msg.
    v_msgid = wa_msg-msgid.
    v_msgnr = wa_msg-msgnr.
    v_msgv1 = wa_msg-msgv1.
    v_msgv2 = wa_msg-msgv2.
    v_msgv3 = wa_msg-msgv3.
    v_msgv4 = wa_msg-msgv4.
    IF wa_msg-msgtyp = 'E' OR
       wa_msg-msgtyp = 'A' OR
       wa_msg-msgtyp = 'X'.
      PERFORM build_msg USING v_msgid
                        v_msgnr
                        v_msgv1
                        v_msgv2
                        v_msgv3
                        v_msgv4
                  CHANGING msg_text_e.
  Build the text for successful records getting created
    ELSEIF wa_msg-msgtyp = 'S' OR
           wa_msg-msgtyp = 'W' OR
           wa_msg-msgtyp = 'I'.
      PERFORM build_msg USING v_msgid
                              v_msgnr
                              v_msgv1
                              v_msgv2
                              v_msgv3
                              v_msgv4
                         CHANGING msg_text_s.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " msg_get
*&      Form  build_msg
      text
     -->P_V_MSGID  text
     -->P_V_MSGNR  text
     -->P_V_MSGV1  text
     -->P_V_MSGV2  text
     -->P_V_MSGV3  text
     -->P_V_MSGV4  text
     <--P_MSG_TEXT_E  text
FORM build_msg  USING    p_v_msgid
                         p_v_msgnr
                         p_v_msgv1
                         p_v_msgv2
                         p_v_msgv3
                         p_v_msgv4
                CHANGING p_msg_text_s.
  CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
    EXPORTING
      langu = sy-langu
      msgid = p_v_msgid
      msgno = p_v_msgnr " wa_msgcoll-msgnr
      msgv1 = p_v_msgv1
      msgv2 = p_v_msgv2
      msgv3 = p_v_msgv3
      msgv4 = p_v_msgv4
    IMPORTING
      text  = p_msg_text_s.
  wa_mess-v_msg = p_msg_text_s .
  APPEND wa_mess TO i_mess.
  CLEAR wa_mess.
ENDFORM.                    " build_msg
*&      Form  disp_msg
      text
-->  p1        text
<--  p2        text
FORM disp_msg .
  PERFORM build_fieldcat_secandary.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'BCD'
      it_fieldcat              = i_fldcat1
      i_callback_user_command  = 'SECANDARY'
    TABLES
      t_outtab                 = i_mess
    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.                    " disp_msg
*&      Form  build_fieldcat_secandary
      text
-->  p1        text
<--  p2        text
FORM build_fieldcat_secandary .
  wa_fldcat1-col_pos = '1'.
  wa_fldcat1-fieldname = 'V_MSG'.
  wa_fldcat1-tabname = 'I_MESS'.
  wa_fldcat1-seltext_m     = 'MESSAGE'.
  APPEND wa_fldcat1 TO i_fldcat1.
ENDFORM.                    " build_fieldcat_secandary
*&      Form  SECANDARY
      text
     -->R_UCOMM    text
FORM secandary USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
    WHEN 'BCK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDFORM.                    "SECANDARY
*&      Form  ABC
      text
     -->EXTAB      text
FORM bcd USING extab TYPE slis_t_extab.
  SET PF-STATUS 'BCD'. " excluding extab.
ENDFORM.                    "ABC
Hope this will help you,
Murthy.

Similar Messages

  • Selecting multiple rows of an alv

    Hi All,
    I have a requirement where in i have to select multiple rows of an alv and when i click a button i should get the data of all the selected rows, i am able to select only one row by default , how to select multiple rows or records,i am new to this Web dynpro alv , can aynbody please help me on this.
    Thanks,
    Praveen.

    hi, praveen kumar.
    About how to make "Multiple-select" of ALV available, you can take a reference of the following coding. Just one example:
    ****ALV Config****
      DATA:
          lr_salv_wd_table TYPE REF TO iwci_salv_wd_table,
          l_value TYPE REF TO cl_salv_wd_config_table,
          lr_table_settings TYPE REF TO if_salv_wd_table_settings.
       lr_salv_wd_table = wd_this->wd_cpifc_alv_child( ).  "Your statically declared ALV component usage
       l_value = lr_salv_wd_table->get_model( ).
    * tabel setting
      lr_table_settings ?= l_value .
      lr_table_settings->set_selection_mode( cl_wd_table=>e_selection_mode-MULTI ).
    About how to get your selected records of ALV, you can make use of the context node bound to your ALV component. For example,
    ****get selected elements****
    lt_elems = lo_node->GET_SELECTED_ELEMENTS(
          INCLUDING_LEAD_SELECTION = abap_true ).
    These are just examples. For detail, you can search them.
    Thanks.Best wishes.

  • How to select multiple row in ALV report

    Hi friends,
    1. How to select multiple row in ALV report
                   ( How to set tab in ALV report and want to select multiple line.)
    Thanking you.
    Subash

    Hi Sahoo,
    If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
    in layout structure you will find field SEL_MODE
    pass :
    LS_LAYOUT-SEL_MODE = 'A'.
    In PAI.
      CALL METHOD GRID->GET_SELECTED_ROWS
        IMPORTING
          ET_INDEX_ROWS = T_ROWS
          ET_ROW_NO     = T_ROWID.
    Hope these will solve your problem.
    Regards,
    Kumar M.

  • Selecting Multiple Rows from ALV GRID Display

    Hi,
    I am having a ALV GRID Display. I want to select multiple rows from the Output and move them to an internal table.
    Please let me know how do I acheive this.
    Thanks in advance,
    Ishaq.

    Hi,
    Have a look on the following code. It displays the selected rows which hv been selected in basic list.
    TABLES:
      spfli.
    TYPE-POOLS:
      slis.
    DATA:
      BEGIN OF t_spfli OCCURS 0,
        checkbox.
            INCLUDE STRUCTURE spfli.
    DATA:  END OF t_spfli.
    DATA:
      t_sspfli LIKE STANDARD TABLE OF t_spfli .
    DATA:
      fs_spfli LIKE LINE OF t_sspfli.
    DATA:
      fs_layout TYPE  slis_layout_alv,
      w_program TYPE sy-repid.
    SELECT *
      FROM spfli
      INTO CORRESPONDING FIELDS OF TABLE t_spfli.
    *fs_layout-info_fieldname = 'COLOR'.
    fs_layout-box_fieldname = 'CHECKBOX'.
    w_program = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program       = w_program
        i_callback_pf_status_set = 'FLIGHT'
        i_callback_user_command  = 'SPFLI_INFO'
        i_structure_name         = 'SPFLI'
        is_layout                = fs_layout
      TABLES
        t_outtab                 = t_spfli
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  FLIGHT
          text
         -->RT_EXTAB   text
    FORM flight    USING rt_extab TYPE slis_t_extab..
      SET PF-STATUS 'FLIGHT' EXCLUDING rt_extab.
    ENDFORM.                    "FLIGHT
    *&      Form  SPFLI_INFO
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM spfli_info USING ucomm LIKE sy-ucomm
                           selfield TYPE slis_selfield.
      selfield-refresh = 'X'.
      CASE ucomm.
        WHEN 'FLIGHT'.
          LOOP AT t_spfli.
            IF t_spfli-checkbox = 'X'.
              t_spfli-checkbox = ' '.
             t_spfli-color = 'C51'.
              MODIFY t_spfli TRANSPORTING checkbox.
              fs_spfli = t_spfli.
              APPEND fs_spfli TO t_sspfli.
            ENDIF.
          ENDLOOP.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
      CLEAR fs_spfli.
      fs_layout-info_fieldname = 'COLOR'.
    fs_layout-confirmation_prompt = 'X'.
      fs_layout-key_hotspot = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = w_program
          i_structure_name   = 'SFLIGHT'
          is_layout          = fs_layout
        TABLES
          t_outtab           = t_sspfli
        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.
      REFRESH t_sspfli.
    ENDFORM.                    "SPFLI_INFO
    Regards,
    Chandu

  • Selecting multiple rows in ALV

    Hi Experts,
    I am using REUSE_ALV_GRID_DISPLAY FM in my program for my ALV output . I need to select multiple rows and will click a custom button on the appln toolbar. How can I know which all rows are selected? Please help.
    Many Thanks,
    Neeraj

    Hi,
    Try this way.
    <font color=blue><pre>
    REPORT ztest_alv_row_selection.
    DATA: BEGIN OF it_output OCCURS 0,
            select TYPE c,          <font color=red>"This variable stores the value when row selected.</font>
            bukrs  TYPE t001-bukrs,
            butxt  TYPE t001-butxt,
          END OF it_output.
    TYPE-POOLS:slis.
    DATA:it_events            TYPE STANDARD TABLE OF slis_alv_event,
         it_fieldcat          TYPE STANDARD TABLE OF slis_fieldcat_alv,
         wa_fieldcat          TYPE slis_fieldcat_alv,
         wa_events            TYPE slis_alv_event,
         wa_layout            TYPE slis_layout_alv.
    DATA:g_program            TYPE sy-repid VALUE sy-repid.
    START-OF-SELECTION.
      SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_output UP TO 100 ROWS.
      DEFINE fieldcatalog.
        wa_fieldcat-fieldname = &1.
        wa_fieldcat-tabname   = &2.
        wa_fieldcat-seltext_l = &3.
        append wa_fieldcat to it_fieldcat.
        clear  wa_fieldcat.
      END-OF-DEFINITION.
      fieldcatalog: "Column table       col text
                    'BUKRS' 'IT_OUTPUT' 'BUKRS',
                    'BUTXT' 'IT_OUTPUT' 'BUTXT'.
      wa_layout-box_fieldname     = 'SELECT'. <font color=red> "This has to be set to get selection</font>
      wa_layout-colwidth_optimize = 'X'.
      wa_events-name              = 'PF_STATUS_SET'.
      wa_events-form              = 'PF_STATUS_SET'.
      APPEND wa_events TO it_events.
      CLEAR wa_events.
      wa_events-name              = 'USER_COMMAND'.
      wa_events-form              = 'USER_COMMAND'.
      APPEND wa_events TO it_events.
      CLEAR wa_events.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = g_program
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat
          it_events          = it_events
        TABLES
          t_outtab           = it_output.
    *&      Form  PF_STATUS_SET
    FORM pf_status_set USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTEST'.
    1. When you set Pf status ZTEST, standard application tools will be removed.
    2. Goto SE41 give program 'SAPLKKBL' and status 'STANDARD_FULLSCREEN'.
    3. Copy the status from those to ZTEST of our program. Now you will see all standard functions.
    ENDFORM.                    "PF_STATUS_SET
          FORM USER_COMMAND                                          *
    FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN 'DISPLAY'.  "user presses SAVE
          LOOP AT it_output.
            IF it_output-select EQ 'X'.
          Process records that have been selected
              WRITE:/ it_output.
            ENDIF.
          ENDLOOP.
      ENDCASE.
    ENDFORM.                    "user_command</pre></font>
    Thanks
    Venkat.O

  • Selecting multiple rows in ALV grid display

    Hi,
    I have an ALV grid display in my report.
    My grid contains multiple rows.
    I have to select multiple rows at a time, to perform some operations on the selected rows.
    How can it be achieved?
    Thanks,
    Sandeep.

    Hi ,
    you have to use a box fieldname in the report to be able to select multiple lines at a time :
    - in your internal table declaration put the first field as 'box_fieldname' of type c1
    - then in your work area for layout add, lwa_layout-box_fieldname =     'box_fieldname'
    - in the perform for handling user commands, all selected lines will have an "X" in the field name  'box_fieldname'
    Thanks and Regards,
    Dev.

  • Select Multiple Rows in a Table without CTRL

    Expecting the user to press "Ctrl" when selecting multple rows is very unfriendly and unintuitive. We'd like the row selection to work as in ALV where you just select multiple rows by clicking on them.
    We've set the tables rowSelectable to true and selectionMode to 'multi' but we still cannot select multiple rows without the CTRL hotkey.
    This issue apparently [arose before|About selection in the table] but wasn't resolved.
    System Details
    SAP_ABA     701     0006     SAPKA70106
    SAP_BASIS     701     0006     SAPKB70106
    SAP_AP     700     0019     SAPKNA7019

    Hello Marc,
    you need to call IF_WD_CONTEXT_NODE->set_selected(index = lv_index) sorry for the typo in my previous comment.
    by calling IF_WD_CONTEXT_NODE->set_selected method wont remove the lead selection.
    to unselect the records, you can call the same method by passing the FLAG value as abap_false.
    so for your usecase the logic will be like this in the ON_SELECT event handler
    1. get the index of the new_lead_selection
    2. check whether this is already seleted in the context node by calling IF_WD_CONTEXT_NODE->IS_selected
    3. if already selected then call IF_WD_CONTEXT_NODE->set_selected( flag = abap_false index = lv_index)
       if not selected then call IF_WD_CONTEXT_NODE->set_selected( index = lv_index )
    Hope this solved your problem.
    BR, Saravanan
    Edited by: Saraa_n on Jul 6, 2011 11:52 AM

  • Select multiple rows in a grid

    Hi All,
    I want to select multiple rows in a grid on click of a button, there is no checkbox there are multiple rows which need to be selected like we do on pressing shift key on the keyboard. Please suggest how can this be done.
    thanks in advance.
    Regards,
    Anju

    Hi Anju,
    You can check this link to solve your problem:
    https://wiki.sdn.sap.com/wiki/display/Snippets/ALV%2bGrid%2bDisplay%2bwith%2bcheckbox%2bto%2bprocess%2bselected%2brecords%2bat%2bruntime
    Hope it helps you.
    Thanks & Regards,
    Sarita Singh Rathour

  • Urgent :  how to select the rows in the ALV Grid Control

    How to select the rows in the ALV Grid control,
    I am facing the situation where i need to select the row/rows in the Grid control and then to lock the entries,
    If anyone have the solution please help me out
    <b>Its very Urgent</b>

    Hi Bharath,
    Go through this hope u can understand.
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    A Multiple columns, multiple rows with selection buttons.
    B Simple selection, listbox, Single row/column
    C Multiple rows without buttons
    D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.
    Reward points if helpful.
    Thanks
    Naveen khan

  • How to select multiple rows from List Of Values

    Hello,
    I use ADF 11g to create my list of values (LOV). I want to select multiple rows from it. but i can't.
    so how i can select many rows to set them in my adf table.
    Thank in advance

    Hi,
    LOV is map to an attribute in the viewObject so it will return only one value or more values from selected row. You can't select multiple rows from LOV.
    But you can do this by using popup which you can select multiple rows and insert the selected rows to another table.
    This blog post explain how to achieve this :
    http://husaindalal.blogspot.com/2009/11/search-from-popup-and-add-to-new-table.html#comments
    Sameh Nassar

  • Selecting multiple rows in a table

    Hi All,
    I have one problem with selecting multiple rows in a table.I tried with setting table property-selectionMode as Multi, but i dinn't get the solution.
    please provide me solution for this.
    Thanks & Regards,
    Sreelakshmi.

    HI
    Int leadSelection = wdcontext.nodemodelnode.getLeadSelection();
      for(int i=0;i<wdcontext.nodeModelNode.size;i++)
        if(wdcontext.nodeModelNode.isMultiselected(i) || leadSelection ==i)
               String name = wdcontext.nodemodelnode.getnameelementatindex(i).getName();
               String  address = wdcontext.nodemodelnode.getaddresselementatindex(i).getAddress();
               String age = wdcontext.nodemodelnode.getAgeelementatindex(i).getAge();
            Create a method for the Table Property onLeadSelect() where you can open a popup window
             Create a value node and with attributes same as Table attributes and then set the values of the table
             to the value node attributes.
    Thanks

  • Select multiple row in a table that are not connected

    I want to be able to select multiple rows, but want to be able to select rows that are not next to each other. They maybe have one or two rows between. Is there anyway to do this in a table?
    Thanks

    So do a lot of other people, but you can’t.
    Tell Adobe here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    Bob

  • Select multiple rows from dual table

    Is it possible to select multiple rows from dual table using a single select statement.
    i.e., i want the out put to be
    column_name
    1
    2
    3
    4
    Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AM

    Aside from the fact you're responding to an old thread...
    1002424 wrote:
    While using CONNECT BY, I see it always leave behind one row.
    Suppose I have a condition based on which I have to generate constant rows like
    SELECT 1 FROM DUAL WHERE ROWNUM < N;
    Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
    SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
    no rows selected
    SQL>

  • Pressing cntrl+left mouse click doesn't select multiple rows.

    Hi,
    I've got this problem after i migrated my form from 6i to 10g.
    In 6i version, cntrl+left mouse click used to work in order to select multiple rows on the screen. But, it's not working in 10g.
    Instead, Shit + left mouse click is working to select multiple rows in 10g.
    Please can someone help me out with this. I want cntrl + left mouse click to work.
    Any help will be appreciated.
    Regards
    Navnit

    Hi Pradeep,
    Thanks for your reply.
    Do you mean fmrweb.res file?
    This is the content of my res file
    9 : 0 : "Tab" : 1 : "Next Field"
    9 : 1 : "Shift+Tab" : 2 : "Previous Field"
    116 : 0 : "F5" : 3 : "Clear Field"
    38 : 0 : "Up" : 6 : "Up"
    40 : 0 : "Down" : 7 : "Down"
    33 : 0 : "PageUp" : 12 : "Scroll Up"
    34 : 0 : "PageDown" : 13 : "Scroll Down"
    69 : 2 : "Ctrl+E" : 22 : "Edit"
    10 : 0 : "Return" : 27 : "Return"
    76 : 2 : "Ctrl+L" : 29 : "List of Values"
    115 : 0 : "F4" : 32 : "Exit"
    75 : 2 : "Ctrl+K" : 35 : "Show Keys"
    83 : 2 : "Ctrl+S" : 36 : "Commit"
    118 : 1 : "Shift+F7" : 61 : "Next Primary Key"
    117 : 0 : "F6" : 62 : "Clear Record"
    38 : 2 : "Ctrl+Up" : 63 : "Delete Record"
    117 : 1 : "Shift+F6" : 64 : "Duplicate Record"
    40 : 2 : "Ctrl+Down" : 65 : "Insert Record"
    119 : 1 : "Shift+F8" : 66 : "Next Set of Records"
    1005 : 0 : "Down" : 67 : "Next Record"
    1004 : 0 : "Up" : 68 : "Previous Record"
    118 : 0 : "F7" : 69 : "Clear Block"
    66 : 2 : "Ctrl+B" : 70 : "Block Menu"
    34 : 1 : "Shift+PageDown" : 71 : "Next Block"
    33 : 1 : "Shift+PageUp" : 72 : "Previous Block"
    116 : 1 : "Shift+F5" : 73 : "Duplicate Field"
    119 : 0 : "F8" : 74 : "Clear Form"
    122 : 0 : "F11" : 76 : "Enter Query"
    122 : 2 : "Ctrl+F11" : 77 : "Execute Query"
    69 : 3 : "Shift+Ctrl+E" : 78 : "Display Error"
    80 : 2 : "Ctrl+P" : 79 : "Print"
    123 : 0 : "F12" : 80 : "Count Query"
    85 : 2 : "Ctrl+U" : 81 : "Update Record"
    121 : 3 : "Shift+Ctrl+F10" : 82 : "Function 0"
    112 : 3 : "Shift+Ctrl+F1" : 83 : "Function 1"
    113 : 3 : "Shift+Ctrl+F2" : 84 : "Function 2"
    114 : 3 : "Shift+Ctrl+F3" : 85 : "Function 3"
    115 : 3 : "Shift+Ctrl+F4" : 86 : "Function 4"
    116 : 3 : "Shift+Ctrl+F5" : 87 : "Function 5"
    117 : 3 : "Shift+Ctrl+F6" : 88 : "Function 6"
    118 : 3 : "Shift+Ctrl+F7" : 89 : "Function 7"
    119 : 3 : "Shift+Ctrl+F8" : 90 : "Function 8"
    120 : 3 : "Shift+Ctrl+F9" : 91 : "Function 9"
    113 : 0 : "F2" : 95 : "List Tab Pages"
    72 : 2 : "Ctrl+H" : 30 : "Help"
    112 : 0 : "F1" : 30 : "Help"
    I don't know what value should i enter for cntrl + left mouse click ?
    Even for shift + left mouse click, row is not there but it's working.
    Please tell if you know what row should i enter for cntrl + left mouse click in order for it to select mutliple rows?
    Regards
    Navnit

  • How to select multiple row of table using check box?

    hi,
             i am having table on view having first field as checkbox. what i want, when i click on checkboxes in multiple rows, and i click on any button i need to use those content to next view...
              my problem is if i select only one row , i can use onlead select property of table..but when i select multiple rows  through check box how should i read contents of table....?
    Plz solve it.
    Thanks,
    Saurin Shah

    Hello Saurin,
    You are right using LeadSelection you can select only 1 row at a time. You will have to make use of Selection for achieving this. First you will have to change the selection mode of the table to multiple & also change the selection property for the related context to 0..n . Please find a code extract which might help you. (However this facility is only available from SP 14.) The main part is using the set_selected method of if_wd_context_node.
    data: node_zcourse_details type ref to if_wd_context_node,
             node_course_assign type ref to if_wd_context_node,
             elem_course_assign type ref to if_wd_context_element,
             stru_course_assign type if_v_details=>element_course_assign ,
             item_popin_selected like stru_course_assign-popin_selected.
    "     navigate from <CONTEXT> to <ZCOURSE_DETAILS> via lead selection
    node_zcourse_details = wd_context->get_child_node( name = if_v_details=>wdctx_zcourse_details ).
    "     navigate from <ZCOURSE_DETAILS> to <COURSE_ASSIGN> via lead selection
    node_course_assign = node_zcourse_details->get_child_node( name = if_v_details=>wdctx_course_assign ).
    "     @TODO handle not set lead selection
    if ( node_course_assign is initial ).
    exit.
    endif.
    data elem_set type wdr_context_element_set.
    field-symbols <wa_elem> like line of elem_set.
    elem_set = node_course_assign->get_elements( ).
    loop at elem_set assigning <wa_elem>.
       <wa_elem>->set_selected( TRUE OR FALSE ). " Supply either TRUE/FALSE in here
    endloop.

Maybe you are looking for

  • I need help with syncing

    Hello, I recently downloaded Itunes on my computer for back up reasons. when it finished downloading I had to log off on my user and went on a different one on the same computer. I synced my Ipod touch on this user cuz I thought it would be synced on

  • What are the database resources when collecting stats using dbms_stats

    Hello, We have tables that contain stale stats and would want to collect stats using dbms_stats with estiamte of 30%. What are the database resources that would be consummed when dbms_stats is used on a table? Also, would the table be locked during d

  • Re-Using Java Business Layer in Flex

    I am new to flex and particulalry looking at this to use as front end for existing Web based Java Application as front end. We have comprehensive business layer written using POJOs and DAOs and want to reuse it. I will be using remote objects to call

  • Chart Link Checksum Error

    Apex 3.2 I have a chart with a link going to another page and setting some parameters. I am using APEX_UTIL.PREPARE_URL, as the page is protected by checksum. My second parameter needs to be the word CREATE My sql is select APEX_UTIL.PREPARE_URL('f?p

  • WSRP (register provider) error

    Hello,I try to register a provider to my portal (10.1.4) i deploy the war succesfull and now i testing this url to browser eg http://hostname:port/maping url/portlets?WSDL I see the xml succesfully... But when i try to register to portal i take the f