Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

filling table

hi experts

i have a program that each time delete a database table end fill it back with new data, right now i do it with loop and insert one row in each iteration:

DELETE FROM zcontracts.

commit WORK.

LOOP at i_data.

z_contracts-kunnr = i_data-kunnr.

z_contracts-name1 = i_data-name1.

z_contracts-vkgrp = i_data-vkgrp.

z_contracts-bezei = i_data-bezei.

z_contracts-eq_inv = i_data-total.

z_contracts-invest = i_data-invest.

z_contracts-zmeng = i_data-zmeng.

z_contracts-zieme = i_data-zieme.

z_contracts-vbeln = i_data-vbeln.

z_contracts-guebg = i_data-guebg.

z_contracts-gueen = i_data-gueen.

z_contracts-tot_inv = i_data-total_inv.

z_contracts-exp_mon_rev = i_data-exp_revenue.

z_contracts-exist = i_data-exflag.

INSERT zcontracts FROM z_contracts.

clear z_contracts.

ENDLOOP.

i want to do it in one time to insert all the inner table

my question is how can i do this?

thanks

amit

Tags:
replied

Hi Amit,

Yes. That is possible

check the below syntax

INSERT dbtab FROM TABLE itab

populate all the data into the itab and then use

INSERT zcontracts FROM TABLE itab.

But there is one disadvantage.If there is some error in inserting a certain row, it cannot show which line has the error.

Cheers,

Kothand

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question