‎2010 Apr 22 10:16 AM
Hi,
i am working on a list output where if user is editing a field and that field need to be updated in the data base. table is a z table .
the table has 5 fields .
mandt key field
matnr key field
werks key field
charg key field
lgpla key field
usnam
edate
in the list output , the user will change the values in the lgpla field and that field need to be changed in the data base table.
i have used the stmt :
modify< table> from <internal table> ,
but a new record is added in the data base instead of overwriting the existing one.
but the record can be seen modified in the internal table.
kinldy let me know the method of updating or modifying the existing value in the data base.
thanks and regards,
vikram.
‎2010 Apr 22 11:04 AM
Hi,
Its not possible to change Primary Key contents in the database.
it mention in documentation of MODIFY Statement,
a line is searched for in the database table that has the same content
in the primary key as the corresponding beginning part of the work area.
If such a line is not found,
a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found,
this line is overwritten according to the same rules as for the UPDATE statement
if you want insert the modified line first Delete from database,Then Use Modify Statement
Regards,
Raghava Channooru
‎2010 Apr 22 10:22 AM
Hi
Use the Below syntax and see whether table gets modified instead of added new rows.
MODIFY dbtab FROM TABLE itab.
‎2010 Apr 22 10:25 AM
Please hit F1 on MODIFY and UPDATE statements and check the documentation. That should give you a solution
‎2010 Apr 22 10:56 AM
Hi,
try using below code-
MODIFY scarr_tab INDEX idx FROM scarr_wa
TRANSPORTING currcode.
or modify db from table itab transporting lgpla.
hope this helps
‎2010 Apr 22 11:04 AM
Hi,
Its not possible to change Primary Key contents in the database.
it mention in documentation of MODIFY Statement,
a line is searched for in the database table that has the same content
in the primary key as the corresponding beginning part of the work area.
If such a line is not found,
a new line is inserted according to the same rules as for the INSERT statement.
If such a line is found,
this line is overwritten according to the same rules as for the UPDATE statement
if you want insert the modified line first Delete from database,Then Use Modify Statement
Regards,
Raghava Channooru
‎2010 Apr 22 1:03 PM
Hi raghava ,
thanks for the update ..really helpful answer.
regards,
vikram.