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 modifying the existing record in table control

Former Member
0 Likes
1,094

Hi Experts,

I have one table control.I have entered one record and save it.When I am modifying the same record a duplicate record is created.I need if I modify the same record that record should only modify.How to delete the duplicate record.

Hi Experts,

I have one table control.I have entered one record and save it.When I am modifying the same record a duplicate record is created.I need if I modify the same record that record should only modify.How to delete the duplicate record.

7 REPLIES 7
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,066

Hi,

Check the index . Are you maintaining the key field .Read with that field and modify also with that field.Then your issue will be resolved.

Regards,

Madhu.

Read only

0 Likes
1,066

Hi Madhurao,

In table control all are key fields.If I edit and modify the record it takes as a new record.How to resolve it?

Read only

0 Likes
1,066

Hi,

If I modify the key fields of that record a new record is created of that same record.

Read only

0 Likes
1,066

HI,

Please post the code what you written behind the modify and insert buttons.

Regards,

Madhu.

Read only

0 Likes
1,066

Hi.,

Modify record from current_line index,.,

check this helps docu: http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac5e35c111d1829f0000e829fbfe/content.htm

also these threads :[Table Control Modifications|;

[Table Control Modify |;

hope this helps u.,

else post your code here.

Thanks & Regards,

Kiran

Read only

0 Likes
1,066

Hi,

In Flow logic.

LOOP .

MODULE tbc_modify ON CHAIN-REQUEST.

MODULE tbc_mark.

ENDLOOP.

In module.

MODULE tbc_modify INPUT.

MODIFY t_data

FROM fs_data

INDEX tbc-current_line.

IF sy-subrc NE 0.

APPEND fs_data TO t_data.

ENDIF.

ENDMODULE.

MODULE tbc_mark INPUT.

DATA: tbc_wa2 LIKE LINE OF t_data.

IF tbc-line_sel_mode = 1

AND fs_data-mark = 'X'.

LOOP AT t_data INTO tbc_wa2

WHERE mark = 'X'.

tbc_wa2-mark = ''.

MODIFY t_data

FROM tbc_wa2

TRANSPORTING mark.

ENDLOOP. .

ENDIF.

MODIFY t_data FROM fs_data

INDEX tbc-current_line

TRANSPORTING mark.

ENDMODULE.

Edited by: sapabap403 on Aug 31, 2011 9:29 AM

Read only

Kiran_Valluru
Active Contributor
0 Likes
1,066

Hi.,

Instead of Insert Statement .,use MODIFY statement.

MODIFY ZTABLE from table lt_tbl_ctrl.

so if you modify any record it will modify that record else if you add new entry it will create a new record.,

hope this helps u.,

Thanks & Regards,

Kiran