on 2007 Jul 19 7:07 PM
I am using a tableview iterator to edit a particular column. I am trying to edit a column and post it to a table in BW. Once I enter a new value and submit, it goes to oninputprocessing page with the following code. However, the new value is not getting posted. The itab3 doesn't even get populated with the new value I enter. What's wrong with this code? Thanks.
CLASS cl_htmlb_manager DEFINITION LOAD.
DATA: event TYPE REF TO cl_htmlb_event.
DATA TEST TYPE P DECIMALS 2.
event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
if event->id = 'Update' and event->event_type = 'click'.
DATA: tv TYPE REF TO cl_htmlb_tableview.
FIELD-SYMBOLS <i> LIKE LINE OF selectedrowindextable.
tv ?= cl_htmlb_manager=>get_data( request = runtime->server->request
name = 'tableView'
id = 'tv1' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
tv_data = tv->data.
refresh itab2.
refresh itab3.
call method tv_data->GET_ROWS_SELECTED
receiving selected_rows = itab2.
endif.
data : ind type SELECTEDROW,
row_s type row.
if itab2 is not initial.
data: rw LIKE LINE OF itab.
loop at itab2 into ind.
READ TABLE itab INDEX ind-index into
rw.
if rw is not initial.
row_s = rw.
append row_s to itab3.
clear row_s.
endif.
endloop.
MODIFY ZNCNO013 FROM table itab3.
if sy-subrc = 0.
COMMIT WORK.
endif.
ENDIF.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all dont duplicate the post..
Do you modify the key fields of the table via tableview? If so it will create new rows,
it will not change the old record in table since you have changed the key fields.
apart of key fields, if you change other fields, as per your code, it should update the same line in DB.
Check it out.
<i>*Reward each useful answer</i>
Raja T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
59 | |
11 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.