Application Development and Automation 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: 
Read only

insert data from itab to database table

Former Member
0 Likes
1,239

hallow

what isthe best way to insert the data from itab to database table with same structre.

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,211

hi antonio,

Try this,

 INSERT/MODIFY ZTABLE FROM TABLE ITAB.

11 REPLIES 11
Read only

Former Member
0 Likes
1,211

make use of keyworkds

Modify/Insert/Update.

Regards

Peram

Read only

0 Likes
1,211

hi Prabhu Peram

i try with

loop at itab.

insert zdatatab

endloop.

but its not working?

Regards

Read only

Former Member
0 Likes
1,212

hi antonio,

Try this,

 INSERT/MODIFY ZTABLE FROM TABLE ITAB.

Read only

Former Member
0 Likes
1,211

Hi,

Use Modify it is the best one insted of using INSERT or UPDATE.

MODIFY will do both the functions of INSERT and UPDATE.

<b>Reward if helpful.</b>

Read only

0 Likes
1,211

Hi,

Change the code

loop at itab.

insert into zdatatab values itab.

endloop.

<b>Reward if helpful.</b>

Read only

Former Member
0 Likes
1,211

Hi Antonio,

Make use of the following statement in a similar way as shown below,

INSERT <DATABASE TABLE NAME> FROM TABLE <INTERNAL TABLE>.

<b>Note that the internal table has the same structure as the database table.</b>

<b>No need of looping at the internal table.</b>

<b>Reward points if this helps,</b>

Kiran

Read only

0 Likes
1,211

hi kiran

i try like that but i have eroorr

INSERT ZINTAB_A1 FROM TABLE intab_a1.

The work area "INTAB_A132" is not long enough. long enough.

but intab its not work area.

DATA : intab_a1 TYPE TABLE OF t_a1 WITH HEADER LINE .

TYPES: BEGIN OF t_konp,

knumh LIKE konp-knumh,

kstbm LIKE konp-kstbm,

kbetr LIKE konp-kbetr,

konwa TYPE konp-konwa,

END OF t_konp.

Regards

Read only

Former Member
0 Likes
1,211

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/c4/93d942f7ca45b69dfdfd424c38332e/content.htm">refer this link</a>

regards,

srinivas

<b>*reward for useful answers*</b>

Read only

Former Member
0 Likes
1,211

hi

good

ATA: WA_ZSAMPTAB1 TYPE ZSAMPTAB1.

DATA: T_DATA TYPE STANDARD TABLE OF ZSAMPTAB1.

WA_ZSAMPTAB1-CUSTNO = 'TEST'.

WA_ZSAMPTAB1-CUSTNAME = 'TEST CUSTOMER'.

WA_ZSAMPTAB1-CUSTADD = '44 TEST'.

APPEND WA_ZSAMPTAB1 TO T_DATA.

WA_ZSAMPTAB1-CUSTNO = 'TEST2'.

WA_ZSAMPTAB1-CUSTNAME = 'TEST CUSTOMER 2'.

WA_ZSAMPTAB1-CUSTADD = '44 TEST 2'.

APPEND WA_ZSAMPTAB1 TO T_DATA.

  • INsert the records.

INSERT ZSAMPTAB1 FROM TABLE T_DATA.

  • Commit.

COMMIT WORK.

thanks

mrutyun^

Read only

0 Likes
1,211

hi Mrutyunjaya Tripathy

itry like u tell but i always get i database table first line empty end the second line data but just one row way?

i also try like below and i have the same results

i declare the table like

data calss APPL0

size 1

dlivery class A

LOOP AT intab_a13 INTO wa_intab_a13.

INSERT zintab_a13 FROM wa_intab_a13.

COMMIT WORK.

.

ENDLOOP.

Regards

Read only

abapdeveloper20
Contributor
0 Likes
1,211

Hi..

DATA : ITAB TYPE STANDARD TABLE OF ZMATL

INITIAL SIZE 0 WITH HEADER LINE.

INSERT ZMATL FROM TABLE ITAB.

Regards,

Lakshmiraj

Reward points if helpful