on 12-18-2009 1:35 AM
Hi,
I have a table and below the table i have a button. So now my requirement is need to have a first column of table UI element (not ALV) as checkbox's. Whenever users tick that check box the row of that table get's selected and i need to get all selected checkbox rows in the button event. How can we acheive this? Any suggestions and sample codes?
Thanks
venkat
Hi,
In the node to whcih the table is bound, create an attribute CHKBOX of CHAR1 type..
Create a TABLE UI element and rightclick choose CREATEBINDING option for the TABLE in the layout,
Now, it will ask for the node, select that node ....And for the first column/attribute select the cell editor as CHECKBOX...and bind the seleceted is automatically bound to that attribute..
Now In the button handler,
After user select/checks those rows...
loop at lt_table into ls_table where ls_table-chkbox = 'X'. "Ticked/checked rows
endloop.
Check the WDR_TEST_TABLE, TABLE_CELL_EDITORS view for example...
Regards,
Lekha.
Edited by: Lekha on Dec 18, 2009 9:39 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is simple:
1.add an attribute of type abap_bool in the node of the table
2.on the click of the button action caal the method to modify the view in which alv will be modify as per the code below
read the context node
just set the variable as ABAP_TRUE to dispaly of the checkbox with the chcked box or false with the empty chekbox
3. to read the checked lines..simple on the click of the button write the code that actually read the node with the abap-bool type variable as 'X', read all the lines ina internal table , and finally bind that table to the ndoe.
* read the itab where check box is checked
loop at itab into wa where readonly = 'X'.
** read table ls_alv with key readonly = 'abap_true'.
move:
wa-ebeln to wa1-ebeln,
wa-matnr to wa1-matnr,
wa-bukrs to wa1-bukrs,
wa-matkl to wa1-matkl,
wa-menge to wa1-menge,
wa-meins to wa1-meins,
wa-netpr to wa1-netpr.
append wa1 to itab1.
clear wa1.
endloop.
Hope this might solve your problem
Pooja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.