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

z table not getting modified

Former Member
0 Likes
2,154

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

12 REPLIES 12
Read only

Former Member
0 Likes
1,551

try writing commit work after modify

modify deblo from table debloque.

commit work.

Read only

Former Member
0 Likes
1,551

hi raj,

check there is any entry already exists with the data which you are going to modify..

vijay

Read only

0 Likes
1,551

Hi Raj,

DOn't forget to use commit work

after if sy-subrc = 0.

commit work.

endif.

Read only

0 Likes
1,551

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.

Read only

0 Likes
1,551

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

Read only

0 Likes
1,551

Hi,

USe UPDATE and try....

UPDATE deblo FROM TABLE debloque.

Vijay

Message was edited by: Vijay Babu Dudla

Read only

0 Likes
1,551

hi

update syntax is also not updating the z table with single record.

Read only

0 Likes
1,551

You can specify the where clause

using update and try with where clause.

vijay

Read only

0 Likes
1,551

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

Read only

0 Likes
1,551

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

Read only

former_member184495
Active Contributor
0 Likes
1,551

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.

Read only

Former Member
0 Likes
1,551

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