cancel
Showing results for 
Search instead for 
Did you mean: 

How to update Internal Table immedietely in webdynpro

Former Member
0 Kudos

In my requirement there is a add button if u press the button it will open a popup in that we have to select a jpg image and give upload means it should come into the table.But its not updating if u press the back button and come to the same view it is updating.

[http://prabhuabap.blogspot.in/2012/02/webdynpro_13.html]

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199125
Active Contributor
0 Kudos

if you want to add only one record, then use bind_element( new item = element setinitial_eleements = abap_false ).

Binding entire table again it will take more memory.

Regards

Srinivas

former_member184578
Active Contributor
0 Kudos

Hi,

In onAction Upload button you read the internal table using get_static_attributes of node and loop the internal table and modify it using modify statement and then rebind the table using bind_table( lt_tab ) method of internal table.

note: the reason why it is updating after back and coming to view is, I think you have return the code in WDDOINIT method. So you need to rebind the internal table to show immediate effect.

Hope this helps u.,

Thanks & Regards,

Kiran.

Former Member
0 Kudos

Give some sample code for my requirement..

former_member199125
Active Contributor
0 Kudos

Check my sample code, here per1 is the node name.in that there are four attributes say pernr, grade, organization, location.

I am passing some dummy values and it creates one new record.

LO_EL_N_PER1 = lo_nd_n_per1->create_element( ).

ls_n_per1-pernr = LV_AEMPID.

ls_n_per1-grade = 'NO VALUE FOUND'.

ls_n_per1-ORGANIZATION = 'NO VALUE FOUND'.

ls_n_per1-LOCATION = 'NO VALUE FOUND'.

lo_el_n_per1->set_static_attributes( exporting static_attributes = LS_N_PER1 ).

lo_nd_n_per1->bind_element( new_item = lo_el_n_per1

set_initial_elements = ABAP_FALSE ).

Regards

Srinivas

Former Member
0 Kudos

thanks a lot