cancel
Showing results for 
Search instead for 
Did you mean: 

editable table

former_member199125
Active Contributor
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

former_member184578
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

former_member199125
Active Contributor
0 Kudos

Hi kissnas,

Without button can we achieve this functionality?

Table should be able to allow the as many entries as user want. Number of entries is unknown initially.

Thanks and Regards

Srinivas

Former Member
0 Kudos

Hi,

Without any event you can't perform any action right?

If you dont want button means, you have to think when you want to add new row, for example when you select one row in table or you can decide .

Cheers,

Kris.