Handle multiple rows selection on Matrix

Hi all,
i'd like to know if someone could help me with multiple selections on matrix via shift + left mouse button on a matrix.
I got a matrix with one column containing a checkbox for selection. The matrix, on a UDO Form, is defined as auto selecting, so multiple selection of rows is allowed.
I want to add the rows selected by the checkbox (using shift + left mouse button on the selection start and selection end) column to the matrix selected rows collection.
Is there any chance to catch an event handling this situation?
I can add the rows in the matrix selected rows collection clicking the checkboxes one by one, but when i use the multiple selection i can't get any event handling this.
I know i couldn't use the checkbox for the selection and use instead the native function of sap b1 matrix., but this way is faster (and more clear, because you see the check when a row is selected) when you have multiple rows selected one by one
I hope i've been clear enough, and hope somene can give me an hint.
Thanks in advance.

Hi Cesidio,
if I understand you correctly you want to select one row than shift+mouseclick some rows lower and the result should be, that all rows are selected ?
You can achieve this by catching the itempressed event and querying pVal.Modifiers.
This is an example for Grid :
private void Grid0_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
            if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_SHIFT)
                int lastRowSelected =Grid0.Rows.SelectedRows.Item(Grid0.Rows.SelectedRows.Count-1,SAPbouiCOM.BoOrderType.ot_RowOrder);
                if (lastRowSelected < pVal.Row)
                    for (int i = pVal.Row; i > lastRowSelected; i--)
                        Grid0.Rows.SelectedRows.Add(i);
regards,
Maik

Similar Messages

  • Multiple rows selection handling in Tableview

    Hi guys,
    ..Good morning ..
    I have developed one page for displaying Employees(pernr and Ename) under CEO/VP/Managers using <b>TableView</b>.
    Here i have some difficulties.
    <b>1.</b> I managed to show Multiple row selection menu
       (Selectall/deselectall) right upper corner of
       Tableview. but i can also select multiple rows not all
       at a time .So in this case ,those selected employees
       Overtime amount i want to show in the next page.here
       my question is How do i capture selected rows(not all
       at a time).
       I am using this code ..
    <htmlb:tableView id     = "tvX"
             headerText     = "Employee List"
              headerVisible = "true"
              idth          = "30%"
        selectedRowKeyTable = "<%= selectedRowKeyTable %>"
        onRowSelection      = "MyEventRowSelection"
        sort                = "server"
        keepSelectedRow     = "TRUE"
        selectionMode       = "MULTISELECT"
        table               = "<%= i_emp_1 %>" >
    <htmlb:tableViewColumns>
    <htmlb:tableViewColumn columnName          = "pernr"
                           width               = "10"
                           sort                = "server"
                           horizontalAlignment = "center"
                           title               = "Emp No"
                           type                = "TEXT" >
    </htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName          = "ename"
                           width               = "40"
                           sort                = "server"
                           horizontalAlignment = "center"
                           title               = "Emp Name"
                           type                = "TEXT" >
    </htmlb:tableViewColumn>
    </htmlb:tableViewColumns>
    </htmlb:tableView>
    <b>2</b>. How to send one Itab data from one page to
       another page.Presently i am using EXPORT/IMPORT
       statements.Is this right way or any other method is
       there for?. 
    Could you please look in to this ..
    <b>Best regards,
    Venkat.O</b>

    Hi Venkataiah,
    See page <b>TableViewMultiSelect.bsp</b> in BSP application SBSPEXT_TABLE.
    There is an attribute <b>selectedRowIndexTable</b> in tableView element. you have to assign a table of type INT4_TABLE, and you can fill this table by table_event->PREVSELECTEDROWINDEXTABLE in OnInputProcessing event. For more details see the above mentioned bsp application.
    To Export/Import is ok,  you can use server-side cookies also, But best way is using model binding. Learn MVC for that.
    Hope it solves your problem.
    Regards,
    Narnder Hartala

  • ALV Grid multiple row selection, disabling some

    Does anyone know if it is possible to have an ALV grid with multiple row selection allowed but for some rows the row selection is disabled?
    Kind regards,
    John.

    Hi John,
    You can add a check box and select multiple rows. I am using the same technique. I have used OO.
    a) Use Even handler "Double Click"
    b)Using "SELECT_ALL_ENTRIES  CHANGING PT_OUTTAB TYPE STANDARD TABLE" and I am sorting based Check box selection.
    Need more help please let me know. I will send you the code.
    Lanka
    Message was edited by: Lanka Murthy

  • Disabling multiple row selection in JTable

    hi,
    I have a JTable and I want to disable the multiple row selection.
    I used
    getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);and this working fine with ctr+clicking on a row
    but if i am using shift key instead of Ctrl key multiple selection is possible....
    Any idea y?and how to resolve it??
    thnx
    ~neel

    Use table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);I don't know if it differs but I use it and I don't have the problems you describe. Might be a bug in your Java version?!
    Message was edited by:
    pholthuizen

  • Multiple row select for table not working..

    Hi Experts,
    I have a table in ABAP Web Dynpro where I have enabled the multiple row select functionality. I can select all and deselect all. I can also select a block of adjacent rows of table by choosing first and last by pressing Shift key.
    But I am not able to select multiple individual records for that table.
    I tried the same thing in different system and it works fine there.
    Please let me know if we are missing some standard plugin or we need to enable this in some settings.
    System where the issue is:
    SAP_APPL: release 600, level 18
    SAP_BASIS: Release 700, level 22
    System where it is working fine:
    SAP_APPL: release 604, level 8
    SAP_BASIS: release 701, level 8
    Regards,
    Anand Kolte

    Hi
    Press CTRL key and Select records, you can select multiple records, continuously or randomly your desired selection.
    Cheers,
    Kris.

  • ADF multiple row selection using checkbox

    One of the basic feature missing in ADF 11g is multiple row selection using checkbox (ADF supports multiple row selection by CTRL+CLICK) and business users doesn't like the idea of CTRL+CLICK especially when the volume of click is more. Our requirement is to show the records as selected, on click of checkbox. We implemented multiple row selection by giving a checkbox and on submission, iterate all the rows and filter only selected rows for further processing. The approach works fine,but it is very slow when the volume of data is more, say 10 thousand rows. For 4 thousand records, iterating everything takes more than 200 secs !
    Had the multiple row selection been the ADF standard way using CTRL+CLICK, and retrieving the selected rows using method theTable.getSelectedRowKeys() works much faster (completes in millisecs for 4 thousand records). Somehow ADF fetches the selected records much faster this way. Our requirement is on click of the checkbox, the ADF should select the records ( the same way it is doing CTRL+CLICK) and all such selected rows should be retrievable using the ADF method theTable.getSelectedRowKeys()
    Is there any way it can be done?
    Regards,
    Antony.

    Hi All,
    We have implemented the select and select all using check-box and it is working fine. Issue here is the performance is too slow
    Assume SelectValue is the VO coulmn for the checkbox to select the values. To filter out the selected rows, we use the following line
    Row[] pidRows = pidView.getFilteredRows("SelectValue", Boolean.TRUE);
    it is very taking more than 2 minutes if the total number of rows are *4 thousands* and only if 2 rows are selected.
    Whereas with the CTRL+CLICK standard approach, ADF has a built in API theTable.getSelectedRowKeys(); to get only the selected rows, and the built in API takes only few milliseconds to get the selected rows. Users are not agreeing to the CTRL+CLICK approach as it is not user friendly. Suggest if there is a way to make the select box to make it work the same way as CTRL+CLICK.
    code snippet to do the standard way :
    RowKeySet sk = theTable.getSelectedRowKeys();
    _logger.info("row count of select "+sk.getSize());;+
    Iterator selection =sk.iterator();
    EmpVORowImpl empRow = null;
    +while (selection.hasNext()) {+
    Object rowKey = selection.next();
    theTable.setRowKey(rowKey);
    rowdata = (JUCtrlHierNodeBinding)theTable.getRowData();
    empRow  = (EmpVORowImpl)rowdata.getRow();
    _logger.info("Emp # "+empRow.getEmpno() +" Emp Name : "+empRow.getEname() +" Is selected ? "+empRow.getisChecked());+
    +}+

  • Multiple row selection in ADF Table using addition column with checkbox

    I am using ADF table(Jdeveloper11g) and i want to selecte multiple rows it may be more than one OR all rows.
    For that i added one Column to the table with Header Delete and checkbox
    <af:table....
    <af:column sortProperty="Delete" headerText="Delete" width="100"
    sortable="false">
    <af:selectBooleanCheckbox label="#{row.favoriteId}"
    valueChangeListener="#{Mybean.onCheck}"
    id="checkbox" autoSubmit="true">
    </af:selectBooleanCheckbox>
    </af:column>
    </af:table>
    backing bean:Here i added code to get Value of one column with id favoriteId and use an arrayList(listForDelete) to monitor the state of the checkboxes
    public void onCheck(ValueChangeEvent valueChangeEvent) {
    BindingContainer bindings = getBindings();
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)bindings.get("getUserFavoritesByUserIDIterator");
    if (iterBind != null && iterBind.getCurrentRow() != null) {
    RichSelectBooleanCheckbox ch = (RichSelectBooleanCheckbox)valueChangeEvent.getSource();
    if (!ch.isSelected()) {
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.add(issueId);
    else
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.remove(issueId);
    Problem is that when i select single row checkBox, onCheck() method of backing bean gets called multiple times(equals to the number of rows)
    I think this is beacuse of <af:selectBooleanCheckbox id is same that is "checkbox" but i am not sure.Even i tried to assign some unique id but no any success in assigning Id with value Expression.
    I also find related post
    Re: ADF Table Multiple row selection by Managed Bean
    but that is related to Select All rows or Deselect all rows from table.
    From the simillar post i follow the steps given by Frank.but problem with below step
    ->have an af:clientAttribute assigned to the checkbox with the following EL #{row.key} ,here I added <af:clientAttribute name="#{row.key}"></af:clientAttribute> and i am getting error
    Error(64,37):  Static attribute must be a String literal, its illegal to specify an expression.
    Please let me know if any one had already implemented same test case.
    Thanks for all help
    Jaydeep
    Edited by: JaydeepJ on Aug 7, 2009 4:42 AM

    just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
    DCBindingContainer bc =
    (DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
    DCIteratorBinding profItr =
    bc.findIteratorBinding("ProfileSearchInstIterator");
    Row cRow = profItr.getRowAtRangeIndex(0);
    if(cRow != null){
    System.out.println("Current row is not null so fixed ");
    profItr.setCurrentRowIndexInRange(0);
    RowKeySetImpl rks = new RowKeySetImpl();
    ArrayList keyList = new ArrayList();
    keyList.add(cRow.getKey());
    rks.add(keyList);
    profileTable.setSelectedRowKeys(rks);
    AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
    }

  • Multiple row selection for table element

    Hi,
    I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
    I have defined a node with cardinality and selection set to 1..n.
    The contex node contains 4 fields : emp_name, pernr, manager and position.
    The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
    I have defined an action on the 'onleadselection' event.
    The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).' 
    When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
    Thanks in advance for any assistance.

    Hi raj,
    you can try the following code in the 'onleadselect' event of the table,
    create one attribute ' Flag'  of type WDY_BOOLEAN under the node which has been binded to the table.
    DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
      DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
      DATA  lo_elements TYPE wdr_context_element_set.
      DATA  lo_ele_select_new TYPE REF TO if_wd_context_element.
      DATA lv_deselect TYPE wdy_boolean.
      DATA lv_flag TYPE wdy_boolean.
      DATA lv_select TYPE wdy_boolean.
      DATA lv_index TYPE i VALUE 0.
      lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
    get the current selected element
      lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
      CHECK lo_ele_select_new IS NOT INITIAL.
    check whether it has been selected or not
      CALL METHOD lo_ele_select_new->is_selected
        RECEIVING
          flag = lv_select.
      lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
    check whether element has been previously selected or not,if not, set the flag to select it
    IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
        lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
    if selected currently and previously then set the flag as false,in order to delect it
      ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
        lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
      ENDIF.
      CALL METHOD lo_nd_node_tab1->get_elements
        RECEIVING
          set = lo_elements.
    according to the falg, select and delect the elements
    LOOP AT lo_elements INTO lo_el_node_tab1.
        lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
        IF lv_flag = 'X'.
          lo_el_node_tab1->set_selected( abap_true ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).  * this statement deselects the lead selection index*
        ELSE.
          lo_el_node_tab1->set_selected( abap_false ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).
        ENDIF.
      ENDLOOP.
    I hope this resolves your problem.
    Thanks,
    krishna

  • Multiple row selection capability in the table

    Hi
    I have a group with table layout style and I want to set the rowSelection property of the generated table to "multiple" but it seems that there is no way to do that from JHs unless using the group as LOV, which is not desired for me. Here is the code which sets this property in tableGroup.vm :
    #if (! ($JHS.current.group.useAsLov && $JHS.current.group.multiSelect))
    selectionListener="#{#BINDINGS_TABLE().collectionModel.makeCurrent}"
    rowSelection="single"
    #if( ! $JHS.current.group.useAsLov )
    selectedRowKeys="#{#TABLE_BEAN().selectedRow}"
    #end
    #else
    rowSelection="multiple"
    selectedRowKeys="#{#LOV_PAGE_BEAN().selectedRowKeySet}"
    selectionListener="#{#LOV_PAGE_BEAN().selectionListener}"
    #end
    Is there any reason to not allowing to have multiple row selection capability in the table when it is not in LOV mode?
    Thanks
    Ferez

    Ferez,
    No, but if you want to have multiple selection, there is typical a custom action you want to apply to the selected rows, which cannot be defined in the Jheadstart Application Definition editor.
    However, it is perfectly fine to use a custom tableGroup.vm template and enable multi-selection.
    Steven Davelaar,
    JHeadstart team.

  • Help req : alv grid with multiple row selection

    Hi all sap gurus,
    i have a alv list display program , in which i can select the o/p rows(multiple rows)
    and perform some actiom based on some icons .
    now i have to convert this in to grid display
    this is initial code i.e for list
    DATA :  BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE ztest.
    DATA :  checkbox type c.
    DATA : END OF itab.
    s_layout-box_fieldname = 'CHECKBOX'.
      ty_events-name = slis_ev_top_of_page.
      ty_events-form =  'TOP_OF_PAGE'.
      APPEND ty_events TO it_events.
    ALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = v_repid
                i_internal_tabname = 'ITAB'
                i_inclname         = v_repid
           CHANGING
                ct_fieldcat        = build_fieldcatalog.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
       I_INTERFACE_CHECK              = ' '
       I_BUFFER_ACTIVE                = ' '
         i_callback_program             = v_repid
         i_callback_pf_status_set       = 'SET_PF_STATUS'
         i_callback_user_command        = 'USER_COMMAND'
         i_structure_name               = 'ITAB'
         is_layout                      = s_layout
         it_fieldcat                    = build_fieldcatalog[]
       IT_EXCLUDING                   =
       IT_SPECIAL_GROUPS              =
       IT_SORT                        =
       IT_FILTER                      =
       IS_SEL_HIDE                    =
       I_DEFAULT                      = 'X'
       I_SAVE                         = ' '
       IS_VARIANT                     =
         it_events                      = 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
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER        =
       ES_EXIT_CAUSED_BY_USER         =
          TABLES
            t_outtab                    = itab
         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 user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
      IF ucomm = 'DELE'.
        LOOP AT iTAB WHERE CHECKbox = 'X' .
        ENDLOOP.
        MODIFY  ztEST FROM TABLE itAB.
      ENDIF.
      selfield-refresh = 'X'.
    ENDFORM.
    NOW I HAVE A LIST O/P WHERE I CAN SELECT THE BOX AND CLICK DELETE ICON.
    NOW I WANT TO CHANGE TO GRID, SO I KEPT EVERYTHING SAMRE AND I CHANGED  " LIST" TO "GRID"
    NOW TWO THINGS HAPPEND
    1) I SEE A EMPTY COLUMN IN THE O/P , I GUESS THATS BECAUSE CHECKBOSX IN INTERNAL TABLE , SO I REMOVED IT
    SO THIS MADE ME TO REMOVE
    IF ucomm = 'DELE'.
        LOOP AT iTAB." WHERE CHECKbox = 'X' .------PROBLEM
        ENDLOOP.
        MODIFY  ztEST FROM TABLE itAB.
      ENDIF.
      selfield-refresh = 'X'.
    NOW I DON'T SEE THE EMPTY COLUMN , BUT NOW PROBLEM  IS I CANNNOT DISTINGUISH AS TO WHICH IS SELECTED AND AT ANY POINT OF TIME I CANSELECT ONLY ROW.
    ALL I WANT IS
    1) I WANT TO SELECT MULTIPLE ROWS AND SHOULD BE ABLE TO KNOW WHICH ROWS WERE SELECTED IN THE O/P SCREEN.
    IN THE LIST DISPLAY I HAD CHECKBOX = 'X' FOR ALL THE ROWS THAT WERE SELECTED , I WANT THE SIMILAR THING in grid display
    LET ME KNOW whether this can be done without USING 00 LANG.
    thanks

    Hi Swati,
    Below code might help full for you. Description: is It selects multiple rows from ALV and display it on the next ALV.
    *************************Reward Point If help full********************************************
    *& Report   z7cc_alv_oops_show_next_alv                                *
    *&          DEVELOPERS NAME : CHIDANAND CHAUHAN
    *&          DATE: SATURDAY 08-07-2006
    *&          DESCRIPTION: TO CREATE AN OBJECT ORIENTED ALV
    REPORT      z7cc_alv_oops_show_next_alv MESSAGE-ID  z5hs .
    DATA : BEGIN OF it_mara OCCURS 0,
      mark  TYPE flag,
      matnr TYPE matnr,
      mtart TYPE mtart,
      meins TYPE meins,
    END OF it_mara.
    DATA : BEGIN OF it_mara1 OCCURS 0,
    *  mark  type flag,
      matnr TYPE matnr,
      mtart TYPE mtart,
      meins TYPE meins,
    END OF it_mara1.
    DATA : BEGIN OF it_mara2 OCCURS 0,
    *  mark  type flag,
      matnr TYPE matnr,
      mtart TYPE mtart,
      meins TYPE meins,
    END OF it_mara2.
    DATA : t_fieldcat TYPE lvc_t_fcat,
             t_fieldcat1 TYPE lvc_t_fcat,
          s_fieldcat LIKE LINE OF t_fieldcat.
    DATA : s_layout TYPE lvc_s_layo.
    DATA : control TYPE REF TO cl_gui_custom_container,
           grid  TYPE REF TO cl_gui_alv_grid.
    DATA: BEGIN OF wa ,
      mark  TYPE flag,
      matnr TYPE matnr,
      mtart TYPE mtart,
      meins TYPE meins,
    END OF wa.
    *       CLASS lcl_events_box DEFINITION
    CLASS lcl_events_box DEFINITION.
      PUBLIC SECTION.
        METHODS :
    *Handler_Data_Changed for event Data_Changed of cl_gui_alv_grid
    *imporTing er_data_changed,
        handler_user_command FOR EVENT user_command OF cl_gui_alv_grid
        IMPORTING e_ucomm,
        handler_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
        IMPORTING e_object e_interactive.
    ENDCLASS.                    "lcl_events_box DEFINITION
    *       CLASS lcl_events_box IMPLEMENTATION
    CLASS lcl_events_box IMPLEMENTATION.
    * method to handle the user command.
      METHOD handler_user_command.
        PERFORM form_usercommand CHANGING e_ucomm.
      ENDMETHOD.                    "Handler_user_command
    *& Mehod to handle the toolbar.
      METHOD handler_toolbar.
        PERFORM form_toolbar CHANGING e_object e_interactive
        e_object->mt_toolbar.
      ENDMETHOD.                    "Handler_ToolBar
    ENDCLASS.                    "lcl_events_box IMPLEMENTATION
    START-OF-SELECTION.
      DATA : w_events TYPE REF TO lcl_events_box.
      SELECT matnr mtart meins FROM mara INTO CORRESPONDING FIELDS OF TABLE
      it_mara.
      CALL SCREEN 100.
    *&      Module  pbo_module  OUTPUT
    *       text
    MODULE pbo_module OUTPUT.
      IF grid IS INITIAL.
        CREATE OBJECT control
          EXPORTING
            container_name     = 'CUST_CTRL'.
        CREATE OBJECT grid
          EXPORTING
            i_parent          = control.
        PERFORM build_catalog.
        PERFORM build_catalog1.
        PERFORM build_layout.
        CALL METHOD grid->set_table_for_first_display
          EXPORTING
            is_layout       = s_layout
          CHANGING
            it_outtab       = it_mara[]
            it_fieldcatalog = t_fieldcat.
        CREATE OBJECT w_events.
        SET HANDLER : w_events->handler_toolbar FOR grid,
                      w_events->handler_user_command FOR grid.
        CALL METHOD grid->set_toolbar_interactive.
      ELSE.
        CALL METHOD grid->refresh_table_display.
      ENDIF.
    ENDMODULE.                 " pbo_module  OUTPUT
    *&      Form  BUILD_CATALOG
    FORM build_catalog .
      s_fieldcat-col_pos = '1'.
      s_fieldcat-fieldname = 'MARK'.
      s_fieldcat-checkbox = 'X'.
      s_fieldcat-edit = 'X'.
      APPEND s_fieldcat TO t_fieldcat.
      CLEAR s_fieldcat.
      s_fieldcat-col_pos = '2'.
      s_fieldcat-fieldname = 'MATNR'.
      s_fieldcat-scrtext_m = 'MATERIAL'.
      APPEND s_fieldcat TO t_fieldcat.
      s_fieldcat-col_pos = '3'.
      s_fieldcat-fieldname = 'MTART'.
      s_fieldcat-scrtext_m = 'MATERL TYPE'.
      APPEND s_fieldcat TO t_fieldcat.
      s_fieldcat-col_pos = '4'.
      s_fieldcat-fieldname = 'MEINS'.
      s_fieldcat-scrtext_m = 'UOM'.
      APPEND s_fieldcat TO t_fieldcat.
    ENDFORM.                    " BUILD_CATALOG
    *&      Form  BUILD_LAYOUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_layout .
      s_layout-zebra = 'X'.
    * S_LAYOUT-CWIDTH_OPT = 'X'.
      s_layout-grid_title = 'Material Details'.
    ENDFORM.                    "BUILD_LAYOUT
    " BUILD_LAYOUT////////////////////////////////////
    " USER_COMMAND_0100  INPUT
    *&      Form  FORM_USERCOMMAND
    *       text
    *      <--P_E_UCOMM  text
    FORM form_usercommand  CHANGING p_e_ucomm.
      CASE p_e_ucomm.
        WHEN 'INT1'.
          DO.
            READ TABLE it_mara INDEX sy-index TRANSPORTING mark matnr.
            IF sy-subrc <> 0.
              EXIT.
            ENDIF.
            IF it_mara-mark = 'X'.
              READ TABLE it_mara INTO wa TRANSPORTING matnr mtart meins .
              MOVE-CORRESPONDING wa TO it_mara1.
              READ TABLE it_mara1 TRANSPORTING matnr mtart meins .
              MOVE-CORRESPONDING it_mara1  TO it_mara2.
              APPEND it_mara2.
              CALL METHOD grid->set_table_for_first_display
                EXPORTING
                  is_layout       = s_layout
                CHANGING
                  it_outtab       = it_mara2[]
                  it_fieldcatalog = t_fieldcat1.
    *       SET PARAMETER ID 'MAT' FIELD IT_MARA-MATNR.
    *       CALL TRANSACTION 'MM02'.
            ENDIF.
    *      ENDIF.
          ENDDO.
      ENDCASE.
    ENDFORM.                    " FORM_USERCOMMAND
    *&      Form  FORM_TOOLBAR
    *       text
    *      <--P_E_OBJECT  text
    *      <--P_E_INTERACTIVE  text
    *      <--P_E_OBJECT_>MT_TOOLBAR  text
    FORM form_toolbar  CHANGING p_e_object TYPE REF TO
    cl_alv_event_toolbar_set
    p_e_interactive
    mt_toolbar TYPE ttb_button.
      DATA wal_button TYPE stb_button.
    *WAL_BUTTON-ICON = ICON_status_reverse.
      wal_button-text = 'GO'.
      wal_button-quickinfo = 'PROCEED'.
      wal_button-function = 'INT1'.
      wal_button-butn_type = 0.
      wal_button-disabled = space.
      INSERT wal_button  INTO p_e_object->mt_toolbar INDEX 1.
    ENDFORM.                    " FORM_TOOLBAR
    *&      Module  PF-STATUS  OUTPUT
    *       text
    MODULE pf-status OUTPUT.
      SET PF-STATUS 'Z7CCSTAT'.
    ENDMODULE.                 " PF-STATUS  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_CATALOG1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_catalog1 .
      s_fieldcat-col_pos = '1'.
      s_fieldcat-fieldname = 'MATNR'.
      s_fieldcat-scrtext_m = 'MATERIAL'.
      APPEND s_fieldcat TO t_fieldcat1.
      s_fieldcat-col_pos = '2'.
      s_fieldcat-fieldname = 'MTART'.
      s_fieldcat-scrtext_m = 'MATERL TYPE'.
      APPEND s_fieldcat TO t_fieldcat1.
      s_fieldcat-col_pos = '3'.
      s_fieldcat-fieldname = 'MEINS'.
      s_fieldcat-scrtext_m = 'UOM'.
      APPEND s_fieldcat TO t_fieldcat1.
    ENDFORM.                    " BUILD_CATALOG1

  • How to capture indexes of multiple rows selected in Advance list

    Hi,
    - I have a prefilled advance list with multiselection enabled.
    - There is a button, associated with an action,which is bind to a eventHandler,that event Handler has script operation which conains the ruby scrpt code.
    - Now when i select multiple rows of that advance list and click on the action,I want to capture the indexes of all the selected rows.
    I tried using following ruby code:
    lead=$data.datalist.LeadSelectedIndex
    But it returns index of only first row selected out of various rows selected.
    So please anyone help me on that.
    Regards ,
    Saurabh Sharma.

    In FP2.6 there is no chance from SDK to have a mass enabled Action and bind to a mulli selection list as a BO Action in the UI Designer, as multiplicity will always be single and only lead selection would be selected.
    this feature comes only in FP3.0.
    So i am not sure what excatly Saurabh wants to do : maybe do some calculations based on multi seletions then i would do the following as also what Christian mentioned
    multiSelect =  ($data.DataList.GetSelectedRowsCount() > 1);
    NoOfRowsSelected = $data.DataList.GetSelectedRowsCount();
    SummationField = 0;
    if ( multiSelect )
       LeadSelection = $data.DataList.LeadSelectedIndex;
       RequiredDataField = $data.DataList.Get(LeadSelection).AnydataField;
       for i in 0..(NoOfRowsSelected - 1)
         currentRow = LeadSelection + i;
          RequiredDataField = $data.DataList.Get(currentRow).AnydataField;
    // imagine this is just add values of the RequiredDataField
         SummationField = SummationField +   RequiredDataField
       end
    end
    So i have not tried this directly - but i hope i make the idea clear.
    Regards,
    Nitesh Pai

  • Retrieving multiple rows selected from a table

    I want to retrieve selected multiple rows from a table and pass it to other views. Does anyone know how to implement this

    You could try a simple example:
    Create a context node "Rows" with a string attribute "Text". Create some node elements in wdDoInit().
    Create an action "ShowSelectedRowIndices" and implement the event handler as follows:
      //@@begin javadoc:onActionShowSelectedRowIndices(ServerEvent)
      /** Declared validating event handler. */
      //@@end
      public void onActionShowSelectedRowIndices(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionShowSelectedRowIndices(ServerEvent)
        StringBuffer msg = new StringBuffer("Multi-selected rows:");
        for (int i = 0; i < wdContext.nodeRows().size(); ++i)
          if (wdContext.nodeRows().isMultiSelected(i))
            msg.append(" ").append(i);
        wdComponentAPI.getMessageManager().reportSuccess(msg.toString());
        //@@end
    When executing the action (e.g. with a button) you will see the selected indices in the message area.
    Regards, Armin

  • 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();
    }

  • Multiple row selection & Send Email Code ? Need littel Help

    Dear All,
    I managed to insert a code which will enable me to select multiple rows (Artikel from the great Yann Duran),
    i also have a code which enables me to send a mail for each selected row (only one row).
    But now since I was able to select more rows, I need to to customize my "Send mail" code to send mail to all selected rows. I guess I will need a loop here but I am not sure.
    My code for multiy row selection :
    private const string _CONTROL = "vw_CustLedgerEntry" // This is my Data Grid;
    private DataGrid _ItemsList = null;
    private int _SelectedRowsCount = 0;
    partial void Part_2_CustomerItemDetail_InitializeDataWorkspace(List<IDataService> saveChangesTo)
    // Write your code here.
    this.FindControl(_CONTROL).ControlAvailable += Orders_ControlAvailable;
    private void Orders_ControlAvailable(object sender, ControlAvailableEventArgs e)
    _ItemsList = e.Control as DataGrid;
    //if the cast failed, just leave, there's nothing more we can do here
    if (_ItemsList == null)
    return;
    //set the property on the grid that allows multiple selection
    _ItemsList.SelectionMode = DataGridSelectionMode.Extended;
    _ItemsList.SelectionChanged += new SelectionChangedEventHandler(_ItemsList_SelectionChanged);
    private void _ItemsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
    switch (_ItemsList == null)
    case true:
    _SelectedRowsCount = 0;
    break;
    case false:
    _SelectedRowsCount = _ItemsList.SelectedItems.Count;
    break;
    This is my code for sending a mail for one selected row:
    partial void EMail_Execute() // EMAIL BUTTON FOR OPEN ENTRIES
    if (vw_CustLedgerEntry.SelectedItem.Report_Type == null)
    // throw new ArgumentNullException();
    this.ShowMessageBox("EMail Can't be sent,PDF generation is not possible for this Entry");
    this.Application.ShowPart_2_CustomerItemDetail(this.vw_CustomerItem.Costomer_No_, this.vw_CustomerItem.Company);
    else// if (vw_CustLedgerEntry.SelectedItem.Send_Mail== true)
    //do
    vw_CustLedgerEntryItem1 entryItem = this.vw_CustLedgerEntry.SelectedItem;
    InvSendbyMailRequestBody reqBody = new InvSendbyMailRequestBody(
    entryItem.Document_No_
    , entryItem.Report_Type
    , "DynNavHRS"
    , this.Application.User.Name.Replace(@"HRS\", "") + "@hrs.com" // HRS001
    , "Document"
    , false
    , false
    , this.vw_CustomerItem.ISO_Code // Change 7.8.2014 Bug in Email body text sprache
    , this.vw_CustomerItem.Salesperson_E_mail // Change 7.8.2014 Bug in Send E-mail
    , entryItem.Customer_No_.ToString()
    , false
    , "XYZ"
    , false);
    InvSendbyMailRequest req = new InvSendbyMailRequest(reqBody);
    HRSReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient();
    // wsHRS.InvSendbyMailCompleted += new EventHandler<InvSendbyMailCompletedEventArgs>(wsHRS_InvGetPDFCompleted);
    wsHRS.InvSendbyMailAsync(req);
    this.ShowMessageBox("Your email was successfully sent");
    // while (vw_CustLedgerEntry.SelectedItem.Send_Mail == true);
    Thaks a lot for your help.
    Zayed

    I tried the following but I donot know if its correct and Iam facing a problem with the "Foreach" function.
    private const string _CONTROL = "vw_CustLedgerEntry" // This is my Data Grid;
    private DataGrid _ItemsList = null;
    private int _SelectedRowsCount = 0;
    partial void Part_2_CustomerItemDetail_InitializeDataWorkspace(List<IDataService> saveChangesTo)
    // Write your code here.
    this.FindControl(_CONTROL).ControlAvailable += Orders_ControlAvailable;
    private void Orders_ControlAvailable(object sender, ControlAvailableEventArgs e)
    _ItemsList = e.Control as DataGrid;
    //if the cast failed, just leave, there's nothing more we can do here
    if (_ItemsList == null)
    return;
    //set the property on the grid that allows multiple selection
    _ItemsList.SelectionMode = DataGridSelectionMode.Extended;
    _ItemsList.SelectionChanged += new SelectionChangedEventHandler(_ItemsList_SelectionChanged);
    private void _ItemsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
    switch (_ItemsList == null)
    case true:
    _SelectedRowsCount = 0;
    break;
    case false:
    _SelectedRowsCount = _ItemsList.SelectedItems.Count;
    break;
    partial void Send_Multiple_Mail_CanExecute(ref bool result)
    //only enable rows have actually been selected
    result = (_SelectedRowsCount > 0);
    partial void Send_Multiple_Mail_Execute()
    if (_ItemsList == null) { return; }
    //StringBuilder names = new StringBuilder();
    //loop through the selected rows
    //we're casting each selected row as a DemoItem
    //so we get access to all the properties of the entity that the row represents
    foreach (_ItemsList.SelectedItems)
    vw_CustLedgerEntryItem1 entryItem = this.vw_CustLedgerEntry.SelectedItem;
    InvSendbyMailRequestBody reqBody = new InvSendbyMailRequestBody(
    entryItem.Document_No_
    , entryItem.Report_Type
    , "DynNavXYZ"
    , this.Application.User.Name.Replace(@"HRS\", "") + "@hrs.com" // HRS001
    , "Document"
    , false
    , false
    , this.vw_CustomerItem.ISO_Code // Change 7.8.2014 Bug in Email body text sprache
    , this.vw_CustomerItem.Salesperson_E_mail // Change 7.8.2014 Bug in Send E-mail
    , entryItem.Customer_No_.ToString()
    , false
    , "XYZ"
    , false);
    InvSendbyMailRequest req = new InvSendbyMailRequest(reqBody);
    XYZReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient();
    // wsHRS.InvSendbyMailCompleted += new EventHandler<InvSendbyMailCompletedEventArgs>(wsHRS_InvGetPDFCompleted);
    wsHRS.InvSendbyMailAsync(req);
    this.ShowMessageBox("Your email was successfully sent");

  • Multiple Row Selection in a data block

    In a datablock i can select a row by clicking on it or by using the arrow key.
    For this....
    I created a visual attribute(Background Color - Gray) and assigned it in the 'current record visual attribute' tab...which allows me to select a single row.
    Is there a way to select multiple rows using Ctrl Key or Shift Key.
    I tried one of the solutions provided earlier to a similar question but the multiple selection was only for a column not for the complete row.

    What you can do is take a recordgroup and loop from col 1 to col n to get all columns.
    Then if someone clicks on the next row (do the same again).
    This should work, there is an example in the ADVANCED FORMS AND REPORTS book.
    Also in the form builder course (University)
    Regards

Maybe you are looking for

  • IPhone 4 touch screen not working

    iPhone 4 touch screen not working properly. Sometimes it activates icon itself. After updating to iOS 6.12, it stop working totally.

  • Error message (-69)

    I have had iTunes for along time and now for the past 3 days I can't seem to log on to my jukebox. Everytime I go to log on from my short cut it reads The itunes application could not be opened. An unknown error occurred (-69). Please help me, I have

  • Understanding the difference of tcpdump

    Hey everyone! I just portscanned my server and also used a tcpdump which I grepped for the IP of my server to limit every results to information connected with my server. I basically am receiving two different answers: 13:07:43.733576 IP myIP-address

  • PL/SQL COMWRAP.SQL COM Automation in Windows

    Hello All, Mike here. I'm not sure which forum this should go in so I put it here. I'm writing a pl/sql procedure that calls ordcom (create by comwrap.sql) which uses orawpcom11.dll to work with com automation objects on windows. It appears that ther

  • Skype business for a call centre

    Hi....can I use skype business for my call centre. I have about 300 call centre consultants????