Capture the rows selected in a multiselect table view (BSP)

Hi,
My requirement is:
I have a table view in which I can select multiple rows.
I will be selecting some rows, and pressing a button.
Functionality of button is written in Javascript, to open a popup window.
But how will I capture which all rows were selected ?
Should I use a Java code or ABAP code ?
And where should I put that code ?
I tried calling the method cl_hrrcf_iterator=>get_tv_attr in the Javascript of the button. But it doesnt work. But if its in DO_HANDLE_DATA it works. Why is it like that ?
Is it possible in BSP, to use the function htmlbevent.obj.getSelectedRows() ? If so, how should the code be ?
Could you please tell me some of the possible solutions.
Would definitely appreciate quick replies.
Thanks,
Nisha Vengal.

Hi Nisha,
You can have the ABAP code itself. I had also faced with then same issue. Use the below piece of code form your requirements.
In *IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START*
*  Data : M_ROW_REF type <Structure type>
*m_row_ref ?= p_row_data_ref*
In *IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START*
* DATA : CHK TYPE FLAG
*case p_column_key.*
   when ' <Column Name>'.*
     CHK = m_row_ref-><Column Name>.*
      p_replacement_bee = CL_HTMLB_CHECKBOX=>FACTORY(
                            id                = p_cell_id
                          checked         = CHK ).
In *Do Request*
Data : loc_table_event type ref to cl_htmlb_event_tableview
call method cl_hrrcf_iterator=>get_tv_attr
    exporting
      p_tv_id               = '<Tabe View ID'
      p_component_id        = me->component_id
      po_request            = me->request
    importing
      po_tv_event           = loc_table_event.
The above methods are used to get the values which are selected in the table view and operated further.
Reward points if useful.
Regards,
Gokul.N

Similar Messages

  • Capture the rows selected ,tableView

    Hi Friends,
    I have a requirement and i was searching in the forum and i have seen the same question been asked 
    Capture the rows selected in a multiselect table view (BSP)   but i couldn't able to judge how the thread is closed
    We have a tableView that is filled on selecting a value from a dropDownListBox.
    and now i select some rows from the table view and click on a button(say btn_ok)
    now the data is processed .
    now what is my requirement is when   i again run the page and select the same drop down value i want to see the rows to be already selected for which i have done before
    example
    dropdown -
    > a is selected
    table view
    1----> selected
    2
    3---->selected
    4
    5---->selected
    6
    btn ok
    next time i want to c these selected rows already as SELECTED
    Regards
    Bhavana

    Hi,
    Are you able to fetch single row? If yes then debug and try to solve it. I don't have SAP System right now but this will help you. First change your table selection mode "Multiple". After that write following code in your "OnInputProcessing"
    Sending Selected Field to the calling Screen
    DATA : tv      TYPE REF TO cl_htmlb_tableview,
           tv_data TYPE REF TO cl_htmlb_event_tableview,
           event   TYPE REF TO cl_htmlb_event.
    tv ?= cl_htmlb_manager=>get_data(
            request = runtime->server->request
            name    = 'tableView'
            id      = 'tv_field' ).
         RECEIVING
           data    = tv.
    tv_data = tv->data.
    w_field = tv_data->row_key.
    Where w_field is your field name. By the way this I used to get one row. Try debugging and may be you will find your way.
    Thanks,
    Muhammad Usman

  • To determine the number of rows selected in a table view (BSP)

    Hi,
    My requirement is:
    I would be selecting 1 row from a table view ( which is made multiselect for another requirement) , and press a button.
    The functionality of button is to open a popup window based on the row selected.
    I want to display an error message if more than 1 row is selected, and button is clicked.
    Message will say that "you cannot select more than 1 row".
    For this,  I need to know how I can get the number of selected rows in a table view.
    I tried using the below code.
    But I feel this will work only in DO_HANDLE_DATA method.
    The popup would open, even before control comes in this method.
      CALL METHOD cl_hrrcf_iterator=>get_tv_index
        EXPORTING
          p_id               = p_tableview_id
          pt_form_fields = table_form_fields
        IMPORTING
          pt_indices      = sel_row_index_tab.
    Could you please provide me with a solution.
    Quick replies will be highly appreciated.
    Thanks,
    Nisha Vengal.

    Hi ,
    Your TV :
    <htmlb:tableView id              = "tv1l"
                                   design          = "alternating"
                                   visibleRowCount = "10"
                                   fillUpEmptyRows = "true"
                               onRowSelection  = "MyEventRowSelection" <----This is the event you have to use
                                   selectionMode   = "MULTILINEEDIT"
                                  filter          = "SERVER"
                                   table           = "<%= some table %>" >
    in DO_REQUEST:
    DATA:  tv                  TYPE REF TO cl_htmlb_tableview,
           tv_event          TYPE REF TO cl_htmlb_event_tableview ,
           event             TYPE REF TO if_htmlb_data.
    event = cl_htmlb_manager=>get_event( request ).
    IF event IS NOT INITIAL AND event->event_name = htmlb_events=>tableview.
      tv_event ?= event.
      CASE event->event_server_name.
        WHEN 'MyEventRowSelection'.
    count = count + 1 .
    if count ne 1 .
    errmsg = 'Your message'.
    endif.
    ENDCASE.
    ENDIF.
    in View/Layout:
    <% if errmsg is not initial. %>
    <s cript t y p e   =   t e x t / j a v a s c r i p t >
    a l e r t ("<%= errmsg %>") .
    </ s c r i p t>
    <% clear errmsg. %>
    <% endif. %>
    errmsg is a class attribute of type string and count is also a class attribute of type c .
    Regards,
    Anubhav.
    Reward if useful
    Edited by: Anubhav Jain on Sep 19, 2008 3:08 PM

  • How to capture the row  value in Advanced Table on OAF ?

    Hi:
    I was wondering, if anyone has any idea as to how to capture a row value on an advanced table on a OAF Page.
    I am currently trying to capture the Expense Report Number ( first column) on the Track Expenses Reports table on the page /oracle/apps/ap/oie/webui/HomePG.
    Any idea would be helpful ?
    Thank You

    Hi,
    856070 wrote:
    This is what I am looking for :
    Default Functionality
    On the expenses home page there is a table for the Submitted expenses Table ( advanced table) with multiple Expense Number rows , which has a link associated with every expense number. When the user clicks the expense number link , EBS takes you to a more detail information page. ---As per default functionality :::whene ever user clicks on link it will takes u to details info page based expense no right.
    ---Check the property of the Destination URL of the ExpensionNumber column.
    ---In this property u can find the page path and paramam ex:pexpencenumber.
    Customized functionality
    I would like to capture the Expense number on the detailed page to call another application based on the expense number. The expense number on the
    detailed page is not available on the request-parameter or on the VO.
    I was thinking of capturing the ExpenseNumber when the user clicks it and save the expense number on a >transientvalue to retrieve it on the detaile dpage..but unable to do so.---Here get the paramereter pexpencenumber and pass it to another appilcation.
    Regards
    Meher Irk

  • What happens when the row selection of a table is set as 'none'?

    I have a page, with a Search box, Departments and Employees tables. The user will enter a departmentId and click on Search button. Departments will be displayed. The departmentId column in Departments table is surrounded with a link. So when the user will click on the link, the desired employees will be displayed in the Employees table, if there is a view link between the VOs.
    Now suppose I have removed the view link. And the row selection of the Departments table is set as 'none'. So is it possible to get the desired employees of the chosen departmentId in this scenario, as because row selection has been disabled in the Departments table?
    I also dont want to use the Set Property Listener in this use case.

    Hi,
    If you have disabled rowselection and also are not implementing the selection listener? How will you find which row did the user select?
    Ramandeep

  • Need to get the row selected in table control without ay action

    Dear Team,
    I have a requirement in which I need to pass the row selected of a table control to a variable.
    Here I need to get the row selected with out any other action
    then the action of selection of a row.
    Is it possible to read table control values using FM DYNP_VALUES_READ.
    thanks in advance,
    regards,
    Sai

    HI,
    Sai Kumar Potluri
    I tried in IDES it working.
    Here is the code.
    REPORT  ZPRA_TC_D.
    TABLES : SCARR.
    CONTROLS TC TYPE TABLEVIEW USING SCREEN 1.
    DATA : SELLINE TYPE I,
           SELINDEX TYPE I.
    DATA : ACT LIKE SCARR-CARRID,
           ANT LIKE SCARR-CARRNAME.
    DATA : ITAB LIKE SCARR OCCURS 0 WITH HEADER LINE.
    CALL SCREEN 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
      SET PF-STATUS 'ME'.
    *  SET TITLEBAR 'xxx'.
    SELECT * FROM SCARR INTO TABLE ITAB.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  MOV  OUTPUT
    *       text
    MODULE MOV OUTPUT.
      MOVE-CORRESPONDING ITAB TO SCARR.
    ENDMODULE.                 " MOV  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK' OR 'UP' OR 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'SEL'.
      GET CURSOR FIELD SCARR-CARRID LINE SELLINE.
      SELINDEX = TC-TOP_LINE + SELLINE - 1.
      READ TABLE ITAB INDEX SELINDEX.
      ACT = ITAB-CARRID.
      ANT = ITAB-CARRNAME.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    In Flow Logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0001.
    LOOP AT ITAB WITH CONTROL TC.
      MODULE MOV.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.

  • How to capture the value selected in the drop down box

    Hi all,
    I am populating values in  drop down box by using FM vrm_set_values in module pool.
    like below
    01  ABC
    02 ACB
    03 BCA
    04 CAB
    in module pool drop down box element name is RQGM-VALUE.
    Problem is what ever the value is select in the drop down box from above element RQGM-VALUE is not filling any value.
    i need to capture the value selected in the drop down box and pass it to another variable.

    Hi,
    Refer this standard code. Your issue will be resolve.
    REPORT demo_dynpro_dropdown_listbox.
    TYPE-POOLS vrm.
    DATA: name  TYPE vrm_id,
          list  TYPE vrm_values,
          value LIKE LINE OF list.
    DATA: wa_spfli TYPE spfli,
          ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    TABLES demof4help.
    name = 'DEMOF4HELP-CONNID'.
    CALL SCREEN 100.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE init_listbox OUTPUT.
      CLEAR demof4help-connid.
      SELECT  connid cityfrom cityto deptime
        FROM  spfli
        INTO  CORRESPONDING FIELDS OF wa_spfli
       WHERE  carrid = demof4help-carrier2.
        value-key  = wa_spfli-connid.
        WRITE wa_spfli-deptime TO value-text USING EDIT MASK '__:__:__'.
        CONCATENATE value-text
                    wa_spfli-cityfrom
                    wa_spfli-cityto
                    INTO value-text SEPARATED BY space.
        APPEND value TO list.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id     = name
                values = list.
    ENDMODULE.
    MODULE user_command_100.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok = 'CARRIER' AND NOT demof4help-carrier2 IS INITIAL.
        LEAVE TO SCREEN 200.
      ELSE.
        SET SCREEN 100.
      ENDIF.
    ENDMODULE.
    MODULE user_command_200.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok = 'SELECTED'.
        MESSAGE i888(sabapdocu) WITH text-001 demof4help-carrier2
                                            demof4help-connid.
      ENDIF.
    ENDMODULE.

  • HOW to emphasize the row selected in a different colour

    Hi all,
    there is any way to set the selected row in a table in a different background-colour?
    i want to emphasize the row selected by user, i try this:
    <af:column headerText="#{res['abogados.nombre']}"
    sortProperty="Nombre" sortable="true"
    binding="#{backing_app_Abogados.column14}"
    id="column14">
    <af:outputText value="#{row.Nombre}"
    binding="#{backing_app_Abogados.outputText14}"
    id="outputText14"
    inlineStyle="background-color:#{bindings.AbogadosView1.currentRow.codigo == row.Codigo ? 'red' : 'transparent'};"/>
    </af:column>
    but this sets the outputText's background to red, i want to set in red all the row..
    any idea?

    Does Rado's following blog entry help: http://adf-rk.blogspot.com/2007/01/adf-oracle-form-like-overflow-in-adf.html

  • Capturing the row count

    How can we capture the row count of the rows affected by executing an update statement?

    If you are doing this by PLSQL block:
    declare
    v_num pls_integer := 0;
    begin
    for c_rec in (select id
    from table_name
    where ...)
    loop
    update other_table
    set col_name = ...
    where fk_id = c_rec.id;
    v_num := v_num + 1;
    end loop;
    dbms_output.put_line ('Total count is '||v_num);
    end;

  • How do I change the row selection by mouse movement

    How do I change the row selection on a jtable by mouse over events?
    Thanks, Randy

    got it thanks...

  • How to get the previous row selected index of a table....

    Hi friends,
    I have a table. i have a action/event handler defined on its onLeadSelect event.
    In this event, if i use node_code->get_lead_selection_index( ) .. i m getting the newly clicked row index.
    ex: table has 3 rows.
    Row 1 is by default selected. Now if i select the row 3, in my event by using node_code->get_lead_selection_index( ). im getting index 3. which i sel
    But i want to get index 1. 
    kindly help me.. i dont have any other option as i m very new to this.
    hope i gave u correct inputs on my problem.
    thanks in advance,
    Niraja

    One way to achieve this is to maintain an attribute in the assistance class or a node element , called OldLeadSelection , at the Component controller level which stores the value of the lead selection index.
    On LeadSelect action handler method, in the first line, read the value of the attribute/element defined above. For the first time a row is lead selected, this value will be initial. After exexcuting the code in the LeadSelection event handler method, store the LeadSelection index value in the attribute defined above. The next time when the LeadSelection event method is called, when the value of this attribute is read in the initial line, it will house the value of the index of the previous LeadSelection.
    There could be other ways to achieve this. This is one of the methods.
    Best Regards,
    Rashmi.

  • How do we capture the record selected in the table control?

    Hi,
      In the table control when the user selects a record we need to capture that record and pass it to the next screen.how can we do this?
    Thanks,
    Rakesh.

    Hello
    First of all you need a 'mark' column in your TC structure.This should be char1.
    This column has to be put into the TC Attributes as mark column.
    Then to get back the info from the TC go the following way:
    PAI
    loop at <fs_it> .               "Field symbol of your table.
        MODIFY <fs_it> FROM wa_basic
        INDEX tc_maintenance-current_line.
    endloop.
    Message was edited by:
            Werner Gerbert

  • Changing row selection of a af:table component in a managed bean

    Hi,
    how can ich programmatically change the selected row of a <af:table> component within a managed bean class?
    I have a table which depends on the date settings of a <dvt:timeSelector> of a <dvt:lineGraph> component. Now when the timeSelector is moved to new dates the table should be refreshed by executing the query for the table again with the new dates. The problem is when the query of the table's view object is executed again the first row will be automatically selected after executing.
    Now I want to achieve that the last row I have selected will be selected again after moving the time selector.
    I searched already in the OTN Discussion Forum but didn't find a fitting solution.
    Thanks in advance!

    The problem is that executing the query moves the current roe to the first one.
    What you can do is to save the current row (its pk), execute the query and then set the current row to the pk of the saved selected one. Set the table attribute displayRow="selected" and set the selected row of the table to the now current row.
    One problem is that you have to be sure the last selected row is still in the record set of the new query result.
    Here are some pointers with code:
    Keep the scroll position on partial commit in <af:table>
    Jdev 11G ADF BC: rollback and keeping current row problem
    How can I programmatically select row to edit in ADF - 11g
    Timo

  • How to capture the values selected at selection screen

    Hi.
    I need some basic idea  reg.  to capture the selected values at selection screen into an internal table.
    for example.
    Selection-screen  having the following fields,
    Grade1....a1
    grade2..a2
    grade3..a3
    grade4..a4
    grade15--a15
    Now i want to get the values of grade into an internal table.. so that i can create dynamic  table  based on selected values
    a1 a2 a3 a4 a5...

    use function moduel
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
       EXPORTING
          CURR_REPORT = repname   " Your report name
       TABLES
          SELECTION_TABLE = it_sels.
    you can get all values from the selection screen

  • HI All Capturing the error records in an internal table

    Hi All,
             I am retrieving the data from application server .
            My requirement is to :
         Check if the Measurement Point Id provided in the file is a valid one or not. Query the table EUITRANS by passing the Measurement point Id in the EXT_UI field. If the query is successful, then proceed to next step. If not, log it in the error log with error message DM-001 and proceed with the next Measurement point id.
    so i nee the code for capturing the error log with error message.
    pls provide me ASAP.
    Thanks&Regards,
    Bharat

    Hi,
    if you like do display all messages online have a look at FM:
    'MESSAGES_INITIALIZE'
    'MESSAGE_STORE'
    'MESSAGES_SHOW'
    If you want to write application log look at function group SBAL modules BAL_LOG*. There is also a good documentation in SAPDOCU..
    Kind regards,
    HP

Maybe you are looking for

  • Failed to start Apache Web Server

    I can not start apach aftre the upgrade of the system /etc/httpd/conf/httpd.conf: # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apac

  • Why isn't the iMessage working on my phone? Up until 1:45pm today it was fine, but now it isn't working.

    Why isn't the iMessage on my iPhone 4s working? Up until about 1:45PM today it was working just fine but now it sends it as a text message. I have tried everything in the setting but it still is not working. Any tips would be great! Thanks!

  • ExternalInterface is not working?

    Hi all, I have an issue with ExternalInterface.call, it's working fine in IE but not in Chrome I don't know why? is there any solution? please let me know. Bellow you can find the code. Thanks in advance. AS Code: import flash.external.ExternalInterf

  • How FaceTime icon get in iPhone 5

    hi . i used facetime after ios 7.0.4 update its missing , but i found in notificatication . please say way

  • Interactive Reports: filter operators restriction

    Hi, I was wondering if the list of filter operators offered by the IR could be easily restricted, for example I can see scenarions when we do not want users to use operators like "contains", "like"... Many thanks