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

write data from itab to my table

Former Member
0 Likes
759

Hallow I build a stable in se11 and I wont write to it data from my itab how can I do that. I check in my debugger and itab is full with data how can I write it to my table becouse my insert dont do it .(my table is like itab).thankes.

*--


table with data from file(csv)--


LOOP AT itab1.

SPLIT itab1 AT ',' INTO:

itab-id_number

  • itab-pernr

itab-hagbla

itab-date_open_hagbla

itab-date_start_hagbl

itab-date_stop_hagbla

itab-date_open_hamora

itab-date_close_hamor.

APPEND itab.

ENDLOOP.

<b>LOOP AT itab.

INSERT yhr_ex_mushlach FROM itab.

ENDLOOP.</b>

Hallow I build a stable in se11 and I wont write to it data from my itab how can I do that. I check in my debugger and itab is full with data how can I write it to my table becouse my insert dont do it .(my table is like itab).thankes.

*--


table with data from file(csv)--


LOOP AT itab1.

SPLIT itab1 AT ',' INTO:

itab-id_number

  • itab-pernr

itab-hagbla

itab-date_open_hagbla

itab-date_start_hagbl

itab-date_stop_hagbla

itab-date_open_hamora

itab-date_close_hamor.

APPEND itab.

ENDLOOP.

<b>LOOP AT itab.

INSERT yhr_ex_mushlach FROM itab.

ENDLOOP.</b>

6 REPLIES 6
Read only

Former Member
0 Likes
732

Hi ,

Insert <Table name> from <b>Table</b> ITAB .

Regards ,

Senthil

Read only

Former Member
0 Likes
732

Hi

Try the below code.

tables lfa1.

data it_lfa1 like lfa1 occurs 0 with header line.

it_lfa1-lifnr = '90'.

it_lfa1-land1 = 'AU'.

it_lfa1-name1 = 'aaa'.

append it_lfa1.

it_lfa1-lifnr = '91'.

it_lfa1-land1 = 'IN'.

it_lfa1-name1 = 'bbb'.

append it_lfa1.

it_lfa1-lifnr = '92'.

it_lfa1-land1 = 'DE'.

it_lfa1-name1 = 'ccc'.

append it_lfa1.

loop at it_lfa1.

insert lfa1 from it_lfa1.

endloop.

if sy-subrc = 0.

write:/ 'Inserted'.

else.

write:/ 'Not'.

endif.

it is inserting records into database table.

Regards

Haritha.

Message was edited by:

Haritha

Read only

Former Member
0 Likes
732

Hello Antonio,

if value index of yhr_ex_mushlach is the same of value of t_itab

insert

don´t work. You must use

modify

: If register exist modify if not insert.

Also you may probe after insert or modify the sy-subrc

Regards...

An doubt You came from Israel but your name came from Spain.

Read only

0 Likes
732

hi olano navarro i born in brasil and now im in isreal

Read only

Former Member
0 Likes
732

Hi antonio,

Try this code .

loop at itab1 into wtab .

update yhr_ex_mushlach from wtab .

endloop.

Hope this helps you .

With regards ,

Thasneem.

Read only

Former Member
0 Likes
732

Hi Antonio,

Add the keyword 'TABLE' in this statement:

INSERT yhr_ex_mushlach FROM TABLE itab.

Regards,

Hendy