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: 

hi. inserting data into a table from internal table

Former Member
0 Kudos

Hi,

i am trying to mass update to the database table

from the internal table.

it is giving an error that the internal table is not long enough..

can anyone help.

ADVance Thanks & Regards

Guhapriyan Subrahmanyam

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check with this code......

****************

data ITAB like standard table of TABLE with header line.

After getting all you data into ITAB....

loop at ITAB.

update TABLE from ITAB.

if sy-subrc eq 0.

commit work.

else.

rollback work.

endif.

THANKS

If this helps you reward with points and close the thread.

17 REPLIES 17

Former Member
0 Kudos

Hi,

Check whether the internal table is been declared as that of the database table,

Hope this helps,

Rgds,

Former Member
0 Kudos

Hi Subrahmanyam ,

Assign the field symbol to internal table and then update the table .

Ex:

ASSIGN itab TO <F>. 
UPDATE dbtab FROM TABLE <F>.

<i>Reward Points If It Helps YOU.</i>

Regards,

Raghav

Former Member
0 Kudos

hi.

thank you very much

it is declared same as the database table

but the table has an appended structure

i dont know how to insert data in this table.

thanks & regards

Guhapriyan subrahmannyam

0 Kudos

hi can you give the code

how you are doing..insert

regards

vijay..

0 Kudos

if your itab is same structure as the dbtable, youcan simply use

modify <db table> from table <itab> .

Regards

Raja

0 Kudos

modify ZGLSTPM_DEPLSCHD FROM TABLE i_in_data.

if sy-subrc <> 0.

  • Error in inserting data to table ZGLSTPM_DEPLSCHD

Message i137.

endif.

0 Kudos

Hi,

Define the line type of the internal table similar to your database table.

For eg.

DATA itab LIKE TABLE OF mara.

REgards,

Abdul

0 Kudos

Hi

are you using all the fields..

regards

vijay

0 Kudos

can you give us your declaration for

i_in_data

Regards

Raja

0 Kudos

hi..

i have used all the fields

and i cannnot use the like statement according to standards

i have declared manually.

Thanks & Regards

Guhapriyan

0 Kudos

why dont you simply declare as below.

data: itab type standard table of <your dbtable> .

Regards

Raja

0 Kudos

Hi

Can you paste ur piece of code for itab declaration here?

REgards,

Abdul

Former Member
0 Kudos

Hi,

Probably you have missed out some fields while declaring your itab.

Check it.

<b>

but the table has an appended structure

i dont know how to insert data in this table</b>.

For this you just insert those fields which are in appending structure to your itab then it should work.

Hope this helps

Reagrds

Amit

Message was edited by: Amit Kumar

Former Member
0 Kudos

If inserting new entries is what you are trying, try this:

insert <dbtable> from itab.

Also if you want to remove the previous entries do this first:

delete from <dbtable>

Message was edited by: Feroz Buksh

Former Member
0 Kudos

Hi Subrahmanyam,

First Declare the internal Table like below:

Data: <Internal-table> type standard table of <database-table> with header line.

Then use the below code to modify the Database table based on your conditions.

modify <database-table> from table <internal-table>.

I hope this help's you.

Regards,

Raja

Former Member
0 Kudos

Hi,

Check with this code......

****************

data ITAB like standard table of TABLE with header line.

After getting all you data into ITAB....

loop at ITAB.

update TABLE from ITAB.

if sy-subrc eq 0.

commit work.

else.

rollback work.

endif.

THANKS

If this helps you reward with points and close the thread.

Former Member
0 Kudos

thank you all for the valuable suggestions..