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

Former Member
0 Likes
566

what i sthe purpose of modify statement?if we try to modify the record which does not exist in internal table what happens if possible explain with examples.

4 REPLIES 4
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
540

Hi

Modify is used to modify the records in the Internal table.

Yes...ur assumption is correct. To overcome those kinds of assumptions we can modify only the required data of the Internal table by using Transporting filed1...fieldn addition.

Regards,

Sreeram

Read only

Former Member
0 Likes
540

Hi,

MODIFY:

To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following:

MODIFY <target> <lines>.

If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, that is, the line is added.

If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE, that is, the line is changed.

For performance reasons, you should use MODIFY only if you cannot distinguish between these two options in your ABAP program.

UPDATE:

The Open SQL statement for changing data in a database table is:

UPDATE <target> <lines>.

It allows you to change one or more lines in the database table <target>. You can only change lines in an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table <target> either statically or dynamically.

Hope this info would be helpful.

Regards,

Varun.

Read only

Former Member
0 Likes
540

Simply if your condition in modify fail that is you donot have record in the internal table that you want to modify the sy-subrc will be 4.

Also ... please try to use tranporiting whenever you use modify statement..

Regards,

Jayant

Read only

Former Member
0 Likes
540

hi,

modify wil work in 2 ways <b>either it will enter a new record if its not in the DB </b><b>otherwise it will update it if the data is there in the DB.

</b>

reward if helpful

ravi