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

table control with SAVE

0 Likes
574

Hello All,

I Created Table control with save button.

WHEN 'SAVE'.

LOOP AT TVTTK CURSOR INTO V1 WHERE CH1 = 'X'.

VTTK-TEXT1 = V1-TEXT1.

UPDATE VTTK.

MODIFY TVTTK FROM V1.

ENDLOOP.

REFRESH TVTTK.

Problem is When I Update a record and click SAVE, Only last record of table control is updating rest of are old values.

eg:

T1

_________

20 --> (IF i update the value here the new values is going to change in last location it means 10; 20 value is remaining same

30

49

10

___________________

Experts please help.

Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
529

Hi Ravindra,

Try using the sy-tabix value to modify the record.

Data : v_tabix type st-tabix.

WHEN 'SAVE'.

LOOP AT TVTTK CURSOR INTO V1 WHERE CH1 = 'X'.

v_tabix = sy-tabix.

VTTK-TEXT1 = V1-TEXT1.

UPDATE VTTK.

MODIFY TVTTK FROM V1 index v_tabix.

clear : v_tabix.

ENDLOOP.

REFRESH TVTTK.

for a better performance you can use a field symbol.

field-symbol : <wa_vttk> type vttk.

WHEN 'SAVE'.

LOOP AT TVTTK assigning <wa_vttk> CURSOR INTO V1 WHERE CH1 = 'X'.

<wa_VTTK>-TEXT1 = V1-TEXT1.

UPDATE VTTK.

ENDLOOP.

REFRESH TVTTK.

Please try it out, this might work.

Regards,

Phani.

Read only

0 Likes
529

none of them are working