‎2006 Jan 07 9:57 AM
hi all
i am using modify syntax to modify z table. following is the code:
modify deblo from table debloque.
it is showing sy-subrc = 0, but the changes are not reflecting in z table when i view it through se11 tc.
could anyone explain or suggest any syntax to solve this.
thanx
‎2006 Jan 07 9:59 AM
try writing commit work after modify
modify deblo from table debloque.
commit work.
‎2006 Jan 07 10:00 AM
hi raj,
check there is any entry already exists with the data which you are going to modify..
vijay
‎2006 Jan 07 10:02 AM
Hi Raj,
DOn't forget to use commit work
after if sy-subrc = 0.
commit work.
endif.
‎2006 Jan 07 10:03 AM
hi
i have tried commit work after modify syntax. the prob is, for some record there is difference of line data, so these records are multiple. i want to modify z table with single record.
‎2006 Jan 07 10:08 AM
modify will compare the key fields from internal table to that of database table.If the key fields are same then only it will update the database table
‎2006 Jan 07 10:09 AM
Hi,
USe UPDATE and try....
UPDATE deblo FROM TABLE debloque.
Vijay
Message was edited by: Vijay Babu Dudla
‎2006 Jan 07 10:12 AM
hi
update syntax is also not updating the z table with single record.
‎2006 Jan 07 10:14 AM
You can specify the where clause
using update and try with where clause.
vijay
‎2006 Jan 07 10:31 AM
can u give an example by specifying some records in internal table with vales , and what u r expecting those records to get updated in Z TABLe
‎2006 Jan 07 10:36 AM
Hi
I think the problem is how you have create your z-table, you should give us the structure of your z-table too.
Max
‎2006 Jan 08 5:33 PM
hi raj,
i hope you are talking about the ztable,
then as our friends said you need to commit work,
else if its an internal table, you wont see the data, unless you insert it into the ztable.
if your query is answered by any of our friends or me, please reward points
cheers,
Aditya.
‎2006 Jan 09 4:28 AM
Hi Raj,
Modify statement acts as INSERT + UPDATE. If the record is does not exist then it will inserted. If it is already exist, it will update the custom table.
Regarding your problem,
MODIFY <ztable> from table <internal table>
The above statement returns sy-subrc when alteast one record of internal table is modified/inserted. So in your case it was updated atleast one record. Analyze the data in se11/se16 with respect to internal table.
Still you are not able to find it out, you can follow the below code to get the correct error.
Loop at <internal table> into <work area>
MODIFY <Ztable> from <work area>
IF sy-subrc <> 0.
write: / 'fail'.
ELSE.
write: / 'Success'.
ENDIF.
ENDLOOP.
COMMIT WORK.
I think your problem may be solved in the above way.
Reward points if it really helps you
Regards
Ganesh N