Hello all,
I have made a BSP application with MVC. In one of the views, I'm generating a tableview and I want to enable the user to select only <b>one </b> row at a time and once the "submit" button is clicked, I want to send all the values from the selected row to the next view via the controller. How can I achieve this ?
The following is the code that I'm using right now:
* Table Definition and Declarations
TYPES: BEGIN OF mytable,
sales_doc(20) TYPE c,
item(10) TYPE c,
material(20) TYPE c,
material_description(40) TYPE c,
qty(4) TYPE c,
left(4) TYPE c,
redemption_start(10) TYPE c,
redemption_end(10) TYPE c,
END OF mytable.
TYPES mytab TYPE STANDARD TABLE OF mytable WITH DEFAULT KEY.
DATA iterator TYPE REF TO IF_HTMLB_TABLEVIEW_ITERATOR.
DATA value TYPE mytable.
DATA itab TYPE mytab.
data: w_item2 like line of output2-t_zicib-item.
loop at output2-t_zicib-item into w_item2.
value-sales_doc = w_item2-vbeln.
value-item = w_item2-posnr.
value-material = w_item2-matnr.
value-material_description = desc.
value-qty = w_item2-lic_qty.
value-left = w_item2-tk_left.
value-redemption_start = page->to_string( value = w_item2-lis_date ).
value-redemption_end = page->to_string( value = w_item2-lie_date ).
APPEND value TO itab.
endloop.
* Tableview definition
<htmlb:tableView id = "tv1"
table = "<%=itab%>"
iterator = "<%=iterator%>"
visibleRowCount = "5"
width = "100"
selectionMode = "singleselect"
design = "STANDARD" />
I'm using the <b>singleselect</b> option in the tableview right now. But I have also read in some of the past threads that in such cases its better to use <b>LineEdit</b>. I tried using LineEdit but even that didn't help.
I did read a few threads before posting my question including Brian McKellar's blog /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator but still 'm not able to figure my way out.
Kindly help me out with this..
Thank you.
Vaibhav.