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

Modify statement!

Former Member
0 Likes
920

Hello all,

I am trying to update a ztable which is having the following key fields.

1. MANDT

2. BUKRS

3. BELNR

4. GJAHR

I am moving some the following values in to the workarea 1st time.

110 200 0019000001 2006

Using MODIFY statement I am inserting this record into the ztable. Next I am trying to insert another record in to the ztable with the following values.

110 300 0019000001 2006

But this is not getting inserted into the ztable. I believe as long as the key combination is not same, it should insert a record in to a table using MODIFY statement.

Why is it not happening here? Any ideas?

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
881

Hi Somen,

Can you please try to use 'INSERT' inplace of 'MODIFY' and then let me know if it dumps during second instance of insert of the record you mentioned.

Regards

Nishant

6 REPLIES 6
Read only

Former Member
0 Likes
881

Hi Somen,

I think if you use the MODIFY with correct workarea then it should insert.

This cases only happens when the system tries to do a key comparison using the characeter fields as the key.

Cheers

VJ

Read only

ferry_lianto
Active Contributor
0 Likes
881

Hi Somen,

It is strange ...

There are two possibilities:

- If your custom table contains no line with the same primary key as the line/record to be inserted, MODIFY works like INSERT, i.e the line/record is added.

- If the custom tables already contains a line/record with the same primary key as the line/record to be inserted, MODIFY works like UPDATE, i.e the line/record is changed.

Can you double check the data for 110 300 0019000001 2006 in your custom table again?

Is it possible the custom table corrupted? Perhaps you may want to run database utitlity.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
881

It's pretty hard to say without seeing the code. Would you please post it? Also let us know the return code after the modify.

Rogb

Read only

Former Member
0 Likes
882

Hi Somen,

Can you please try to use 'INSERT' inplace of 'MODIFY' and then let me know if it dumps during second instance of insert of the record you mentioned.

Regards

Nishant

Read only

0 Likes
881

What is BUKRS field declared as in your z program.

Read only

0 Likes
881

Sorry folks...my oversight. The MODIFY statement is works correctly but one the fields is been over written at some point. Hence the record is not getting inserted.

Thanks. Points awarded.