2011 Aug 30 2:00 PM
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.
2011 Aug 30 6:09 PM
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.
2011 Aug 31 6:17 AM
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?
2011 Aug 31 6:41 AM
Hi,
If I modify the key fields of that record a new record is created of that same record.
2011 Aug 31 6:55 AM
HI,
Please post the code what you written behind the modify and insert buttons.
Regards,
Madhu.
2011 Aug 31 6:55 AM
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|;
hope this helps u.,
else post your code here.
Thanks & Regards,
Kiran
2011 Aug 31 8:29 AM
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
2011 Aug 31 6:07 AM
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