on 06-01-2011 7:26 AM
Hi guys,
I have an editable table. In order to enter 10 rows of values, i have passed 10 workareas and bind it to table. so i can enter up 10 rows.
I want this number should be dynamic, user should be able to enter as many records as he want. Pleas let me know how to achieve this.
Regards
Srinivas
Check the application 'WDR_TEST_TABLE', view 'TABLE_CELL_EDITORS' if it helps.
You have to recommend use of buttons just like Table Control in ABAP.
Regards,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.,
In WDDOINIT method ,
do 100 times. " expecting that the user enters maximum 100 records., if u want u can increase or decrease
append initial line to lt_table.
enddo.
lo_nd_table->bindtable( lt_table ).
Now your table contains 100 editable rows..
In OnactionSave method.,
read the internal table lt_table.
delete lt_table where id is initial. " this is to delete the empty records id is any key field in the table. ,
" suppose if the user enters 10 rows to insert only 10 rows into table use above statement . else 100 records with 90 empty rows will be inserted.
hope this helps u.,
Thanks & Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sana,
You can create one button say ADD and write to add one record whenever click on that button.
Or you want any otehr requirement let me know.
Check sample code...
DATA lo_nd_segment1 TYPE REF TO if_wd_context_node.
DATA lo_el_segment1 TYPE REF TO if_wd_context_element.
DATA ls_segment1 TYPE wd_this->Element_segment1.
data lt_segment1 type wd_this->Elements_segment1.
* navigate from <CONTEXT> to <SEGMENT1> via lead selection
lo_nd_segment1 = wd_context->get_child_node( name = wd_this->wdctx_segment1 ).
lo_el_segment1 = lo_nd_segment1->bind_structure( new_item = ls_segment1
set_initial_elements = abap_false ).
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.