‎2007 Apr 10 5:57 AM
Hi All,
Can u please gimme the syntax of updating a field from tcode to database table.
Regards,
Parvez.
‎2007 Apr 10 5:59 AM
HI,
1. use like this.
loop at itab.
modify DBTAB from itab.
endloop.
2. This will take care of two things automatically :
3. Depending upon the primary key of that table,
if the record is found, then UPDATE will
be done AUTOMATICALLY
4. If the record is not found,
then APPEND will be done automatically.
Kishi.
‎2007 Apr 10 6:05 AM
Hi,
write the word UPDATE in se38 program. keep the cursor on that UPDATE field and press F1. SAP help will be displayed with different syntaxes and with some examples;that is the easiest way of finding syntax for any command in SAP.
reward if useful
regards,
ANJI
‎2007 Apr 10 6:08 AM
hi,
i think its better to use modify statement.
Normally we will never use update statement in standard SAP table. if it is ZTABLE, then its fine. but better to avoid it.
chk this modify statement.
how to update it
method 1.
REPORT ztestreport .
*itab declarations...
loop at itab_ztable into wa_ztab.
modify ztable from wa_ztab.
clear wa_ztab.
endloop.Rgds
Anver
‎2007 Apr 10 7:04 AM
Use modify statement to update the field in db table.
Get the values from ur internal table and modify it.
Depending upon the primary key ,if it founds it will update it and if it doent finds then it will insert or update the data.
loop at itab into wa.
modify db from wa.
clear wa.
endloop.
Regards,
Ponraj.s.