‎2007 May 08 5:42 AM
how to convert this update stat to a modify stat?
Message was edited by:
Ashwin A
‎2007 May 08 5:49 AM
HI Ashwin,
Do it this way,
LOOP AT I_YIBRK_EARNINGS.
MODIFY YIBRK_EARNINGS FROM I_YIBRK_EARNINGS.
CLEAR I_YIBRK_EARNINGS.
ENDLOOP.
Regards,
Jayant
‎2007 May 08 6:02 AM
Hi..
tables:
ZSRMTST .
data:
itab like standard table of ZSRMTST with header line.
select * from ZSRMTST
into table itab.
loop at itab.
itab-unam = sy-uname.
itab-uzeit = sy-uzeit.
modify itab.
endloop.
modify ZSRMTST from itab.
‎2007 May 08 6:05 AM
Hi
MODIFY <DB TABLE> FROM <INTERNAL TABLE>
To insert or change a single line in a database table, use the following:
MODIFY <target> FROM <wa> .
The contents of the work area <wa> are written to the database table <dbtab>. The work area <wa> must be a data object with at least the same length and alignment as the line structure of the database table. The data is placed in the database table according to the line structure of the table, and regardless of the structure of the work area. It is a good idea to define the work area with reference to the structure of the database table.
If the database table does not already contain a line with the same primary key as specified in the work area, a new line is inserted. If the database table does already contain a line with the same primary key as specified in the work area, the existing line is overwritten. SY-SUBRC is always set to 0.
A shortened form of the above statement is:
MODIFY <dbtab>.
In this case, the contents of the table work area <dbtab> are inserted into the database table with the same name. You must declare this table work area using the TABLES statement. In this case, it is not possible to specify the name of the database table dynamically. Table work areas with the same name as the database table (necessary before Release 4.0) should no longer be used for the sake of clarity.
Reward points if useful
Regards
Anji
‎2007 May 08 6:16 AM
hi ashwin,
update->it is used for only internal tables
modify->used fro both internal and database tables.
generally modify = update + insert which means if no record exists then modify will create a record and places
‎2007 May 08 6:18 AM
Hi Ashwin,
Refer this code :
loop at itab.
itab-matnr = '00000000000001'.
itab-mtart = 'FERT'.
modify itab.
clear itab.
endloop.
Reward points if helpful.
Regards,
Hemant