cancel
Showing results for 
Search instead for 
Did you mean: 

problem in editing the table and again saving back to database through web

Former Member
0 Kudos

hi ,

can any one create step by step simple scenario on table which can be editable and after editing again saving back to database .

i have done all the approches , i can display the table through webdynpro but uable to edit and save , may be iam doing wrong some where .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sarfaraj,

You can edit the table in 2 ways.

one is changing the cell editor manually and the other one is by programatically.

1.go to layout->table->select column(textview) which one you want to make editable,right click on that select remove cell editor.

Again right click on the column to insert the cell editor, a pop up will appears to insert cell editor which is input field.

thats all your column will be editable.

2.make cell editable by programatically.

data: obj_table type ref to cl_wd_table,

lr_column type ref to cl_wd_table_column,

lr_column1 type ref to cl_wd_table_column,

lr_input type ref to cl_wd_input_field,

lr_input1 type ref to cl_wd_input_field.

obj_table ?= view->get_element( 'TABLE1' ).

obj_table->set_visible_row_count( value = 50 ).

lr_column = obj_table->get_column(

id = 'TABLE1_PRICE'

  • INDEX = INDEX

).

lr_input = cl_wd_input_field=>new_input_field(

bind_value = 'FLIGHTS.PRICE'

id = 'IP1'

).

lr_input->set_read_only( value = abap_false ).

to update the editable entries to db.

create new button in the table UI element.write logic to update the values to db in the event of button.

thanks

Suman

Former Member
0 Kudos

thanks suman the first option was forking but with progring

the error with following statements like obj_table ?= view->get_element( 'TABLE1' ) it is uable to find the view.

and for update i have created the button as save and mark it into event . then

data: obj_table type ref to cl_wd_table,

lr_column type ref to cl_wd_table_column,

lr_column1 type ref to cl_wd_table_column,

lr_input type ref to cl_wd_input_field,

lr_input1 type ref to cl_wd_input_field.

obj_table ?= view->get_element( 'TABLE1' ).

obj_table->set_visible_row_count( value = 50 ).

lr_column = obj_table->get_column(

id = 'TABLE1_PRICE'

INDEX = INDEX

).

lr_input = cl_wd_input_field=>new_input_field(

bind_value = 'FLIGHTS.PRICE'

id = 'IP1'

).

lr_input->set_read_only( value = abap_false ).

Former Member
0 Kudos

Hi Sarfraz,

obj_table ?= view->get_element( 'TABLE1' ).

TABLE1 is my Table UI element ID.I posted my sample program code.sorry if i was confused you..

for button you can find the button event i.e onACtion in the properties.So create an action for the button when you click button write the logic for updating the data to DB.

Thanks

Suman

Answers (0)