Application Development 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: 

How to copy complete internal table into main dababase table

Karan_Chopra_
Active Participant
0 Kudos

please tell me how to copy complete internal table into main dababase table by overwriting all the entries of the main DBtable.

5 REPLIES 5

Former Member
0 Kudos

Hi Karan,

If you are modifying the existing entries then use MODIFY statement, but if you want to delete earlier entries and insert the new one then you have to first use DELETE and then eithe INSERT or UPDATE statement.

Reward points if useful.

Regards,

Atish

Former Member
0 Kudos

hi,

Use <b>Modify</b> statement.

i.e,


MODIFY dbtab FROM TABLE itab. 

Refer

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/modify.htm.

Message was edited by:

Santosh Kumar Patha

former_member223537
Active Contributor
0 Kudos

MODIFY ZTABLE USING TABLE ITAB.

former_member588853
Active Contributor
0 Kudos

HI,

you can use<b> Insert Or Modify statement ..</b>

<b>Modify updates the existing record, insert creates a new one. ...</b>

insert ZDBTAB from table itab.

Modify ZDBTAB from table Itab.

The structure of itab should be exactly the same as the z table.

You should not update standard tables directly though.

rewards if usefuyl

regards,

nazeer

Former Member
0 Kudos

The follwing command overwrites the all entries.

UPDATE DBTAB FROM TABLE ITAB.

For this action the internal table should contain all the key field values.