Skip to Content
author's profile photo Former Member
Former Member

Search Result View Multi selection

Hi,

I have a Search Result View which allows users to select multiple rows. To process, user clicks the custom button "Submit" added on the Tool bar. In the event handler i wrote the below code. This is selecting only last record. But i want to read all selected rows.

--- htm page

<chmlb:configTable id = "Table"
reset = "<%= controller->get_reset_flag( ) %>"
actions = "<%= controller->gt_button %>"
navigationMode = "BYPAGE"
table = "//RESULT/Table"
visibleRowCount = "<%= lv_visiblerows %>"
usage = "SEARCHRESULT"
downloadToExcel = "<%= lv_export %>"
selectedRowIndexTable = "<%= RESULT->SELECTION_TAB %>"
selectionMode = "<%= RESULT->SELMODE_MULTI %>"
onRowSelection = "SELECT"
showNoMatchText = "FALSE" />

method submit.

data: lv_collection TYPE REF TO if_bol_bo_col,

lv_property_access TYPE REF TO if_bol_bo_property_access.

lv_collection ?= me->typed_context->result->collection_wrapper->get_marked( ).

lv_property_access = lv_collection->get_first( ).

WHILE lv_property_access IS not INITIAL.

lv_property_access = lv_collection->get_next( ).

endwhile.

endmethod.

Thanks

Tim

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Apr 30, 2012 at 05:24 AM

    Hi,

    method DO_INIT_CONTEXT.

    *CALL METHOD SUPER->DO_INIT_CONTEXT

    * .

    ME->typed_context->NODENAME->set_selection_mode(

    IV_SELECTION_MODE = CL_BSP_WD_CONTEXT_NODE_TV=>SELMODE_MULTI

    ).

    endmethod.

    Try this and let me know once.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2012 at 07:08 AM

    Hi,

    Add the fallowing line in do_prepare_output or do_init_context.

    typed_context->item->set_selection_mode( iv_selection_mode = cl_bsp_wd_context_node_tv=>selmode_multi ).

    Add the fallowing line .htm .

    selectionMode = "<%= ITEM->SELECTION_MODE %>"

    Now To get the selected/marked entries write the fallowing code in needed event.

    <code>

    lr_col = me->typed_context->item->collection_wrapper->if_bol_bo_col_multi_sel~get_marked( ).

    if lr_col is not initial.

    lr_ent ?= lr_col->get_first( ).

    WHILE lr_ent IS BOUND.

    lr_ent ?= lr_col->get_next( ).

    ENDWHILE.

    endif.

    </code>

    Hope this will be help to you..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.