Skip to Content
author's profile photo Former Member
Former Member

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

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....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 06:58 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.