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
916

hi guys,

anyone can tell about modify statement with an example.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
888

modify is update + insert.

7 REPLIES 7
Read only

Former Member
Read only

Former Member
0 Likes
888

Hello

This statement changes the content of one or several itab_line or itab_lines lines that can be specified using the table key or the table index.

loop at ti into wa_ti.

wa_ti-field = 'test'

modify it from wa_ti index sy-tabix.

endloop.

Hope this help

Gabriel

Read only

Former Member
0 Likes
888

Modify statment will work both insert and Update..

Modify ztable from table int_table.

if you are changing non primary key,then it works like update..

if you are creating new record then it works like insert command.

Reward Points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
888

hi,

Changing a Line Using the Table Key

To change a single line in a table, use the MODIFY statement:

MODIFY TABLE <itab> FROM <wa> [TRANSPORTING <f1> <f2> ...].

The work area <wa>, which must be compatible with the line type of the internal table, plays adouble role in this statement. Not only it is used to find the line that you want to change, but italso contains the new contents. The system searches the internal table for the line whose tablekey corresponds to the key fields in<wa>.

The system searches for the relevant lines as follows:

Standard tables

Linear search, where the runtime is in linear relation to the number of table entries. Thefirst entry found is changed.

Sorted tables

Binary search, where the runtime is in logarithmic relation to the number of table entries.The first entry found is changed.

Hashed tables

The entry is found using the hash algorithm of the internal table. The runtime is

independent of the number of table entries.

If a line is found, the contents of the non-key fields of the work area are copied into thecorresponding fields of the line, and SY-SUBRC is set to 0. Otherwise, SY-SUBRC is set to 4. Ifthe table has a non-unique key and the system finds duplicate entries, it changes the first entry.

Read only

Former Member
0 Likes
889

modify is update + insert.

Read only

Former Member
0 Likes
888

thanks for everyone

regards

vijay

Read only

Former Member
0 Likes
888

thnks yaar