cancel
Showing results for 
Search instead for 
Did you mean: 

Read table context data into Internal table

Former Member
0 Kudos

Hi All,

I created a table and filled it with values and bind it to output.

i have a field in ouput when i change the value in the output i need to change the values in my table.

how to get the entie table(table context node ) into my method.

is it possible to get the output table data when "On action " event is triggered.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello.

I guess you want to do that with Web Dynpro.

So you need a function which is called, when your click-event is triggered.

And within your function you need something like that:

DATA lo_node_of_table TYPE REF TO if_wd_context_node.

DATA lo_some_other_node TYPE REF TO if_wd_context_node.

DATA lo_element TYPE REF TO if_wd_context_element.

DATA ld_counter TYPE i.

DATA ld_value TYPE i.

DATA ld_sum TYPE i.

lo_node_of_table = wd_context->path_get_node( path = `PATH_TO.CONTEXT_NODE` ).

ld_counter = lo_node_of_table->get_element_count( ).

DO ld_counter TIMES.

lo_element = lo_nd_in->get_element( index = sy-index ).

lo_element->get_attribute(

EXPORTING name = 'FIELD_NAME'

IMPORTING value = ld_value ).

ld_sum = ld_sum + ld_value.

ENDDO.

lo_some_other_node->set_attribute( name = 'SUM_OF_SOMETHING' value = ld_sum ).

Please reply if you meant something else.

Regards

Thomas

Answers (0)