‎2007 May 14 2:48 PM
hi guys,
anyone can tell about modify statement with an example.
‎2007 May 14 3:00 PM
‎2007 May 14 2:50 PM
Hi,
check this link
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba4b235c111d1829f0000e829fbfe/content.htm
rgds,
bharat.
‎2007 May 14 2:50 PM
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
‎2007 May 14 2:53 PM
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
‎2007 May 14 2:53 PM
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.
‎2007 May 14 3:00 PM
‎2007 May 14 3:02 PM
‎2007 May 14 3:03 PM