cancel
Showing results for 
Search instead for 
Did you mean: 

how to update multiple records in a table created in view (web dynpro)

Former Member
0 Kudos

Here is my coding......

*******************************************************************

*coding to get the district value

DATA lo_nd_district TYPE REF TO if_wd_context_node.

DATA lo_el_district TYPE REF TO if_wd_context_element.

DATA ls_district TYPE wd_this->element_district.

DATA lv_district_txt LIKE ls_district-district_txt.

  • navigate from <CONTEXT> to <DISTRICT> via lead selection

lo_nd_district = wd_context->get_child_node( name = wd_this->wdctx_district ).

  • get element via lead selection

lo_el_district = lo_nd_district->get_element( ).

  • get single attribute

lo_el_district->get_attribute(

EXPORTING

name = `DISTRICT_TXT`

IMPORTING

value = lv_district_txt ).

*******************************************************************

*coding to diplay records when clicking a button(Submit)

DATA lo_nd_table TYPE REF TO if_wd_context_node.

  • DATA lo_el_table TYPE REF TO if_wd_context_element.

  • DATA ls_table TYPE wd_this->element_table.

DATA lv_district LIKE ls_table-district.

  • navigate from <CONTEXT> to <TABLE> via lead selection

lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).

  • get element via lead selection

lo_el_table = lo_nd_table->get_element( ).

  • get single attribute

lo_el_table->set_attribute(

EXPORTING

name = `DISTRICT`

" IMPORTING

value = lv_district_txt ).

*******************************************************************

The above coding updates only one record to that

table created in view.

If i enter 2nd district value means then the first record

in the table is overwritten.

So my need is the record should not be overwritten.

it(2nd record ) should be displayed after the 1st record.

Any one can help me and send the coding plz....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

instead of using set attribute you should use bind table method to display/update the records in table view.

step1 ) collect all the data in a local table

step2 ) and the bind that lacal table with your node

search1 = wd_context->get_child_node( name = `TABLE1` ).

search1->bind_table( lt_detail)

here lt_detail is your local table and TABLE1 is node which is bound with table ui element.

Answers (0)