Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem in updsting fields

Former Member
0 Likes
597

hi friends,

i have 2 fields for editing in alv output.when user enter some value in fields

then i save that value in ztable.

my problem is same value get updated in both field what is the problem?

IF r_ucomm = '&DATA_SAVE'.

READ TABLE final INDEX rs_selfield-tabindex.

UPDATE zstatus SET cform = rs_selfield-value

WHERE vbeln = final-vbeln.

UPDATE zstatus SET remark = rs_selfield-value

WHERE vbeln = final-vbeln.

MESSAGE i000(su) WITH 'saved'.

clear rs_selfield-value.

thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
579

Hi Sonu,

It is very clear that your code will update the same value in both the field.

Before the two update statement you are reading the table with one specified index now in the rs_selfield-value you will get the value which corresponds to that index and you are updating the table with this value!!!!,hope you got the mistake.

reward if helpful.

shibu

Read only

0 Likes
579

tnx for reply .

can u correct my mistake .what i have correct .plz suggest me solution.

thanx

Read only

former_member404244
Active Contributor
0 Likes
579

Hi,

Problem with this statement

UPDATE zstatus SET cform = rs_selfield-value

WHERE vbeln = final-vbeln.

UPDATE zstatus SET remark = rs_selfield-value

WHERE vbeln = final-vbeln.

Here rs_selfield-value has same value which is assigned to cform and remark.so u r getting same value...

Regards,

Nagaraj

Read only

Former Member
0 Likes
579

Check the below methods this will be use full to you

IF grid IS INITIAL.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = grid.

ENDIF.

*To get back the user entered data on the grid

IF NOT grid IS INITIAL.

CALL METHOD grid->check_changed_data.

ENDIF.

Check the method this will update the same data user entered on the grid in the same table

this will automatically get back the user enterd data to the table