cancel
Showing results for 
Search instead for 
Did you mean: 

Save data to a table (In the View method)

Former Member
0 Kudos

Hi,

I am new to Webdynpro.We have a requirement in BW to update user config tables using webdynpro.I got the retrieve data part working.

Now I am trying to save data back to the table.I got the following code in the save method which will be called when the save button is clicked.

method ONACTIONSAVEDATA .

data:

TABLE_NODE type ref to IF_WD_CONTEXT_NODE,

varTable type standard table of ZUSRCONFIG.

TABLE_NODE = WD_CONTEXT->GET_CHILD_NODE( 'TABLE_N1' ).

endmethod.

How can I get the data from the TABLE_NODE so that I can use a update command subsequently.TABLE_NODE in the context is bound to ZUSRCONFIG table.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Siva,

Try this code.

data lo_nd_flight type ref to if_wd_context_node.

  • Get Reference to the Node flight

lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ).

  • Structure to hold table value.

data : lt_flight type SFLIGHT. * table

lo_nd_flight->get_static_attributes_table( importing table = lt_flight ).

Now you will have table value in lt_flight. From here u can update.

Reward Point if this answers your post.

With kind Regards,

Arjun

Former Member
0 Kudos

Hi Siva,

Simply call the method get_static_attributes_table on your node. You would get the desired result.

Regards,

Neha

Former Member
0 Kudos

hi siva...

here is the code :

DATA lo_nd_node_table TYPE REF TO if_wd_context_node.

DATA lo_el_node_table TYPE REF TO if_wd_context_element.

DATA ls_node_table TYPE wd_this->element_node_table.

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

lo_nd_node_table = wd_context->get_child_node( name = wd_this->wdctx_node_table ).

  • @TODO handle not set lead selection

IF lo_nd_node_table IS INITIAL.

ENDIF.

  • get element via lead selection

lo_el_node_table = lo_nd_node_table->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_node_table IS INITIAL.

ENDIF.

  • alternative access via index

  • lo_el_node_table = lo_nd_node_table->get_element( index = 1 ).

  • @TODO handle non existant child

  • IF lo_el_node_table IS INITIAL.

  • ENDIF.

  • get all declared attributes

lo_el_node_table->get_static_attributes(

IMPORTING

static_attributes = ls_node_table ).

ls_node_table will containe the values of your table.

---regards,

alex b justin