‎2008 Oct 10 8:00 AM
hi experts,
in open sql, as far i know, when we use modify <internal table> from <wa>.....
if record already exits it modifies, bt if not than it insert new in internal table bt its not working...
is there any simple example....?
Thanks,
Saurin Shah
‎2008 Oct 10 8:02 AM
Hi,
Modify on an internal table will only modify an existing entry. Modify DBTAB from an internal table will modify or insert entries into the database table.
Darren
‎2008 Oct 10 8:02 AM
Hi,
Modify on an internal table will only modify an existing entry. Modify DBTAB from an internal table will modify or insert entries into the database table.
Darren
‎2008 Oct 10 8:06 AM
Hi,
MODIFY statement will have 2 faces.
1) while you are using it on internal tables, if the entry is available then that perticular entry will be get updated.
2) while you are using it on database tables, if that perticular entry is available then it get modified. else a record will be inserted.
thanks & regards
Kishore M
‎2008 Oct 10 8:08 AM
Do like this to achieve what you want:
INSERT wa INTO TABLE itab.
if sy-subrc ne 0. "record is in
MODIFY TABLE itab FROM wa.
endif.
‎2008 Oct 10 8:11 AM
hi,
before modifying u can check whether the internal table is blank or not...if its not blank i.e. it contains data then modify the internal table....
modify <internal table> from <wa> or
modify <internal table> index < > from <wa> transporting .....
(in transporting only those fields which r to be modified).
if internal table is blank then...
append <wa> into <internal table>.
that will work....
‎2008 Oct 10 8:13 AM
hi,
Refer to this link.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/modify_d.htm
hope it will be helpful.
regards,
sreelakshmi