SELECTION OF MULTIPLE ROWS

Hi all,
i am using FM REUSE_ALV_GRID_DISPLAY TO display records.
I am able to select only one row ata time .
i need to use ctrl or shift key to select multiple rows
is there a way that i can select multiple rows with just using mouse and without using shift or ctrl KEYS
tHANKS

Hi,
Use the following function in user_command subroutine to know the selected coloumn in ALV.
FORM user_cmd   USING ucomm1 LIKE sy-ucomm
                       selfield TYPE slis_selfield."#ec *
DATA ref1 TYPE REF TO cl_gui_alv_grid.
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = ref1.
  CALL METHOD ref1->check_changed_data.
    CASE ucomm1 .
    WHEN 'SAVE'.
      UPDATE ekko FROM TABLE itab.
      COMMIT WORK.
ENDFORM.                    "user_cmd

Similar Messages

  • Reg Selection of  Multiple Rows in a Table

    Hi all,
    I have to select multiple rows from a table and have to display those selected records in another table in the next screen.
    The problem is, when I am selecting the records in a table, selection should not be allowed on some records based on a condition. Is it possible with the default selection mode of webdynpro. If so, Please tell me how can we disable the selection of certain records in a table(using the default selection mode provided by webdynpro)
    Else, if we have to use check boxes for selection(in case of my problem), please do help me out in how to disable the selection of certain records in a table(using check boxes for selection).
    Please help me out. Its urgent...
    Reward points guranteed.
    Regards,
    Murthy.

    HI Narayana,
    Multiple selection  property is specific to a table, not for a tableElment(ie. for a row), so u cant set some of the rows as multi selected and some as node
    U can use Checkbox for this purpose. Based on the condition u can make the check box as enabled and disabled
    To achieve this, Create 2 boolean variables inside table node, one for checkbox value(Let it be <b>CBValue</b> .Bind this to checked property of Checkbox) and other for enabling and disabling Checkbox(Let it be <b>CBReadOnly</b>. Bind this to readonly property of CheckBox).
    At the time of creation of table elements, as per the condition, u can control the selection as
    IPrivate<View>.I<Table>Node tNode=wdContext.node<Table>();
    for(int i=0;i<5;i++)
    IPrivate<View>.I<Table>Element tEl=tNode.create<Table>Element();
    tNode.addElement(tEl);
    tEl.setCBValue(false);//Unchecking Checkboxes initially
    if(condition=non selectable)
      tEl.setCBReadOnly(true);
    else
      tEl.setCBReadOnly(false)
    Regards
    Fahad Hamsa

  • Selection of multiple rows w.o using ctrl key

    Hi,
    I have to select multiple rows of ALV w/o using ctrl key.
    is it possible ????
    Iam displaying ALV using set_table_for_first_display.
    Thanks in advance,
    Regards
    Anagha Deshmukh

    hi
    check this thread
    Re: Selecting multiple rows in ALV grid display
    hope it helps you.
    thanks
    Sachin

  • SELECTing from multiple rows and different tables

    Basically, I have a table with a primary key and some other columns of data. The second table has a foreign key that points to the first table then has a columns with related data. I want to write construct a SQL query where one of the columns is the primary key from the first table and the second column is a concatenation of all the rows in the second table that have the same foreign key.
    I need this in the form of one SQL statement so that I can use it to create a report in Application Express

    Just in case my first post was a bit unclear.
    My first table has a primary key, INTERACTION_ID, and several other columns of data.
    My second table has a foreign key, INTERACTION_ID, and one extra column, USER_NAME.
    There are several rows in the second table that share the same INTERACTION_ID as each interaction can have many user names. I want to construct a SQL query where I pull the interaction id in one column and concatenate all the relevant rows of USER_NAME as the second column.

  • Stored procedure with select return multiple rows

    hi,
    in transact the stored procedure is . .
    CREATE PROCEDURE MIPROCEDIMIENTO @CODE INT AS
    BEGIN
    SELECT COD, NAME, LASTNAME FROM EMPLOYE WHER COD = @CODE;
    END
    in oracle how?
    please, i speak spanish. .
    thanks

    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10767/procedures_plsql.htm#TDPNG60035
    Sybrand Bakker
    Senior Oracle DBA

  • ABAP WD, Multiple Row selection in table control

    Hi all,
            I am populating and displaying the records using the table control, i have to select the multiple records in the list and want do some deletion,selection,so i could not select the more than one record.
    How do i solve this?
    Please give me your valuable suggestions.
    Thanks

    Hi ulli,
    thanks for your quick reply,
    now its working for me but i have to press the 'CTRL' key and select the row, for selecting the multiple rows.
    one more thing i wanted some methods for "DELETION", "SELECTING ALL RECORDS","DESELECTING",in the displayed list.
    plz suggest me..,
    thanks and regards
    kamal

  • Selecting multiple rows from jsf datatable

    Hi
    i am working on jsf,ejb3.0 .my requirement is to select the multiple rows usng checkboxes from jsf datatable. i am workng on this for last two days. early response is appreciated.please hel me.
    Thanks
    KRamu

    Hi!
    You could enhance your collection item with a boolean. On your interface you then insert a checkbox column that you bind to the boolean property. on any given action you can go thru your collection and check which item has been selected. In case of doubt go to [http://balusc.blogspot.com/] -i'm sure you'll find some samples/tuts there.

  • Multiple row selection in Table

    Hi Experts,
    I have created one popup with a table inside that.
    My question is how can i add multiple rows, enter value in those rows and on clicking the
    copy button all the value in the rows will be copied into the main view.
    All the rows should be editable.

    Hi Armin,
    Thanks a lot for the reply.
    In my application when i am selecting the multiple rows which i entered earlier in the popup window, it's getting populated into main window.
    But in main window only one input field is there,so only the fiest record is getting displyed after selection.
    Rest of the records i am not able to display in the main window.And the problem is i can't add more than one input field in main window. Rest of the values will be passed into R3 through coding but it can't be displayed on screen.
    So please advice me on these two scenarios.
    1 . How to populate multiple row values(input fields in popup window with value enterd by user) into 
         main view. In main view only one input field is there.
    2 .  How to pass all the selected values from main window to R3 by webdynpro coding.
          All the values coming from popup need to be passed even though  only one value is displayed.
    Here the input field in main window is mapped to one model attrribute.
    Thanks a lot.

  • Highlight multiple rows with coding

    Hi all,
    Can anybody solved my problem?
    I have 3 JTable which are dependent of each other.
    Hence if i select a row in one of them, the other 2 need to highlighted
    respectively.
    I understand that using
    JTable.setRowSelectionInterval(int index0, int index1)
    can highlight rows by code, but it needs to be in a running order.
    I need to accomodate selection of multiple rows, some not in a running order.
    Anyway, thanks for your help in advance...

    Hi,
    Try compiling what I wrote below and running it. I'm pretty sure this is what you are trying to do?! Let me know if this is what you want.
    Thanks,
    code below
    package mypackage;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    import java.util.EventObject;
    public class Dialog1 extends JDialog {
    JPanel _mainPanel;
    JTable _table1;
    JTable _table2;
    JTable _table3;
    MyListSelectionListener _table1Lstnr;
    MyListSelectionListener _table2Lstnr;
    MyListSelectionListener _table3Lstnr;
    Object[] _tablecol = {"Column1", "Column2", "Column3"};
    Object[][] _tablerow = { {"row1", "row1", "row1"},
    {"row2", "row2", "row2"},
    {"row3", "row3", "row3"},
    {"row4", "row4", "row4"},
    {"row5", "row5", "row5"},
    {"row6", "row6", "row6"}};
    Dimension TABLE_DIM = new Dimension( 50, 100 );
    public Dialog1() {
    this.setTitle("Test Frame");
    this.setModal(true);
    init();
    public void init() {
    _mainPanel = new JPanel( new GridBagLayout() );
    GridBagConstraints gbConstraints = new GridBagConstraints( 0,0,1,1,1,0,
    GridBagConstraints.NORTHWEST,GridBagConstraints.HORIZONTAL,
    new Insets(5,5,5,5),0,0);
    table1 = new JTable(tablerow, _tablecol);
    _table1.setName("table1");
    _table1.setColumnSelectionAllowed(false);
    _table1.setRowSelectionAllowed(true);
    table1.setSelectionMode(ListSelectionModel.MULTIPLEINTERVAL_SELECTION);
    table1Lstnr = new MyListSelectionListener(table1);
    table1.getSelectionModel().addListSelectionListener( table1Lstnr );
    JScrollPane table1SP = new JScrollPane( _table1 );
    table1SP.setPreferredSize( TABLE_DIM );
    _mainPanel.add( table1SP, gbConstraints );
    gbConstraints.gridy = 1;
    table2 = new JTable(tablerow, _tablecol);
    _table2.setName("table2");
    _table2.setColumnSelectionAllowed(false);
    _table2.setRowSelectionAllowed(true);
    table2.setSelectionMode(ListSelectionModel.MULTIPLEINTERVAL_SELECTION);
    table2Lstnr = new MyListSelectionListener(table1);
    table2.getSelectionModel().addListSelectionListener( table2Lstnr );
    JScrollPane table2SP = new JScrollPane( _table2 );
    table2SP.setPreferredSize( TABLE_DIM );
    _mainPanel.add( table2SP, gbConstraints );
    gbConstraints.gridy = 2;
    gbConstraints.weighty = 1;
    table3 = new JTable(tablerow, _tablecol);
    _table3.setName("table3");
    _table3.setColumnSelectionAllowed(false);
    _table3.setRowSelectionAllowed(true);
    table3.setSelectionMode(ListSelectionModel.MULTIPLEINTERVAL_SELECTION);
    table3Lstnr = new MyListSelectionListener(table1);
    table3.getSelectionModel().addListSelectionListener( table3Lstnr );
    JScrollPane table3SP = new JScrollPane( _table3 );
    table3SP.setPreferredSize( TABLE_DIM );
    _mainPanel.add( table3SP, gbConstraints );
    this.getContentPane().add( _mainPanel );
    class MyListSelectionListener implements ListSelectionListener {
    JTable selectedTable;
    MyListSelectionListener(JTable table) {
    selectedTable = table;
    public void valueChanged(ListSelectionEvent e) {
    String tableName = selectedTable.getName();
    int[] selectedRows;
    if( tableName.equals(_table1.getName()) ) {
    selectedRows = _table1.getSelectedRows();
    table2.getSelectionModel().removeListSelectionListener( table2Lstnr );
    table3.getSelectionModel().removeListSelectionListener( table3Lstnr );
    _table2.clearSelection();
    _table3.clearSelection();
    for( int i=0;i<selectedRows.length;i++){
    _table2.addRowSelectionInterval(selectedRows,selectedRows[i]);
    _table3.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    table2Lstnr = new MyListSelectionListener(table2);
    table3Lstnr = new MyListSelectionListener(table3);
    table2.getSelectionModel().addListSelectionListener( table2Lstnr );
    table3.getSelectionModel().addListSelectionListener( table3Lstnr );
    } else if( tableName.equals( _table2.getName()) ) {
    selectedRows = _table2.getSelectedRows();
    table1.getSelectionModel().removeListSelectionListener( table1Lstnr );
    table3.getSelectionModel().removeListSelectionListener( table3Lstnr );
    _table1.clearSelection();
    _table3.clearSelection();
    for( int i=0;i<selectedRows.length;i++){
    _table1.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    _table3.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    table1Lstnr = new MyListSelectionListener(table1);
    table3Lstnr = new MyListSelectionListener(table3);
    table1.getSelectionModel().addListSelectionListener( table1Lstnr );
    table3.getSelectionModel().addListSelectionListener( table3Lstnr );
    } else if( tableName.equals( _table3.getName()) ) {
    selectedRows = _table3.getSelectedRows();
    table1.getSelectionModel().removeListSelectionListener( table1Lstnr );
    table2.getSelectionModel().removeListSelectionListener( table2Lstnr );
    _table1.clearSelection();
    _table2.clearSelection();
    for( int i=0;i<selectedRows.length;i++){
    _table1.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    _table2.addRowSelectionInterval(selectedRows[i],selectedRows[i]);
    table1Lstnr = new MyListSelectionListener(table1);
    table2Lstnr = new MyListSelectionListener(table2);
    table1.getSelectionModel().addListSelectionListener( table1Lstnr );
    table2.getSelectionModel().addListSelectionListener( table2Lstnr );
    public static void main(String[] args) {
    Dialog1 dialog = new Dialog1();
    dialog.setSize( new Dimension( 400, 400 ) );
    dialog.setVisible(true);

  • 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

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

  • How can i select some row from multiple row in the same group of data

    I want to select some row from multiple row in the same group of data.
    ColumnA        
    Column B
    1                  OK
    1                   NG
    2                   NG
    2                          NG
    3                          OK
    3                          OK
    I want the row of group of
    ColumnA if  ColumnB contain even 'NG'
    row , select only one row which  Column B = 'NG'
    the result i want = 
    ColumnA         Column B
    1                         NG
    2                   NG
    3                          OK
    Thank you

    That's some awful explanation, but I think this is what you were driving at:
    DECLARE @forumTable TABLE (a INT, b CHAR(2))
    INSERT INTO @forumTable (a, b)
    VALUES
    (1, 'OK'),(1, 'NG'),
    (2, 'NG'),(2, 'NG'),
    (3, 'OK'),(3, 'OK')
    SELECT f.a, MIN(COALESCE(f2.b,f.b)) AS b
    FROM @forumTable f
    LEFT OUTER JOIN @forumTable f2
    ON f.a = f2.a
    AND f.b <> f2.b
    GROUP BY f.a

  • 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

  • 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

  • JDev 11g-Multiple Row Selection Table-Ctrl+A error

    Hello All,
    Jdeveloper : Studio Edition Version 11.1.1.2.0, Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    ADF Business Components : 11.1.1.55.36
    Java(TM) Platform : 1.6.0_11
    Oracle IDE: 11.1.1.2.36.55.36
    SOA Composite Editor: 11.1.1.2.0.12.16
    Versioning Support: 11.1.1.2.36.55.36
    I am trying to remove the selected rows from the table with RowSelection property set to Multiple. I am able to select the rows using by holding key board Ctrl key and click on the rows. The following code in backing bean successfully deletes the rows selected using this step.
    public void removeGeoSpecs(ActionEvent actionEvent)
    RowKeySet rowKeySet = getGmemTbl().getSelectedRowKeys();
    CollectionModel collectionModel =
    (CollectionModel) getGmemTbl().getValue();
    for (Object facesTreeRowKey: rowKeySet)
    collectionModel.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData =
    (JUCtrlHierNodeBinding) collectionModel.getRowData();
    rowData.getRow().remove();
    But when i select all the rows in the table using Ctrl+A, all the rows got selected. I hit the Remove button, then after deleting the first row, getting the following error.
    javax.servlet.ServletException: ADFv: Could not find row: USA 548 with key: oracle.jbo.Key[] inside parent: GeoSpecTVOIterator with key: null.
    Caused by: java.lang.IllegalStateException: ADFv: Could not find row: USA 548 with key: oracle.jbo.Key[] inside parent: GeoSpecTVOIterator with key: null.
    Here USA 548 is my first row's data. Please let me know if you want complete error stack.
    During design time, While drag and drop the table i have not selected Row Selection check box as it sets property for single row selection. Table is inside the <af:panelCollection> . Here is the table source.
    <af:table value="#{bindings.GeoSpecTVO.collectionModel}" var="row"
    rows="#{bindings.GeoSpecTVO.rangeSize}"
    emptyText="#{bindings.GeoSpecTVO.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.GeoSpecTVO.rangeSize}"
    rowBandingInterval="0" id="GmemTbl"
    partialTriggers=":::AddRowsBtn :::AddRangeBtn ::RemoveBtn :::SaveBtn"
    rowSelection="multiple"
    binding="#{backingBeanScope.GeoGrpSpecBean.gmemTbl}">
    Here GeoSpecTVO is a transient view object which is not having query and not attached with EO.
    I tried to fix this issue by myself and also searched for similar issues in the FORUM and google. But no luck... I very much appreciate all your inputs/pointers. Kindly let me know if you need additional information.
    Thanks
    Annadurai.

    Hi Annadurai
    I tried the same work around but still i am facing the issue, could you please help me.
    public void deleteRec(ActionEvent actionEvent) {
    // Add event code here...
    RowKeySet rowKeySet = (RowKeySet)this.embossTB.getSelectedRowKeys();
    CollectionModel cm = (CollectionModel)this.embossTB.getValue();
    Row specRow = null;
    ArrayList rowList = new ArrayList();
    int listLength = 0;
    ArrayList<Number> printReqLST=new ArrayList<Number>();
    ViewObject vo1=null;
    boolean flag=false;
    for (Object facesTreeRowKey : rowKeySet) {
    cm.setRowKey(facesTreeRowKey);
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData();
    specRow = rowData.getRow();
    rowList.add(specRow);
    listLength++;
    for (int index = 0; index < listLength; index++){
    specRow = (Row)rowList.get(index);
    Number printReqID = (Number)specRow.getAttribute("PrintRequestId");
    String PrintState = specRow.getAttribute("PrintState").toString();
    if (PrintState.equalsIgnoreCase("PRINTED")) {
    System.out.println("cann't delete");
    FacesContext fctx = FacesContext.getCurrentInstance();
    FacesMessage message =
    new FacesMessage("Cann't Delete the selected row:" + printReqID);
    message.setSeverity(FacesMessage.SEVERITY_ERROR);
    fctx.addMessage(null, message);
    } else {
    System.out.println("delete");
    flag=true;
    specRow.remove();
    if(flag){
    System.out.println("before commit");
    commitRows();
    }

Maybe you are looking for