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

Internal table error

Former Member
0 Likes
1,100

Hi Friends...

I am updating the database from Internal table with this syntax.

data: itab type standard table of ztab with header line.

loop at itab.

update ztab from itab.

endloop.

it gives me the error "the work area Itab is not long enough. "

i have used explicit work area as well here then i found the same erro as well. please tell me what is the problem here... any help appreciated.

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
780

Amee,

Use:

UPDATE ZTAB FROM TABLE itab.

No loop is required then as well.

5 REPLIES 5
Read only

Former Member
0 Likes
781

Amee,

Use:

UPDATE ZTAB FROM TABLE itab.

No loop is required then as well.

Read only

Former Member
0 Likes
780

HI,

this works fine.. check with ur ztab is it exist or not and also ensure that you declare this

tables : ztab.

data: itab type standard table of ztab with header line.

loop at itab.

update ztab from itab.

endloop.

or

update ztab from table itab[].

thanks

Mahesh

Read only

Former Member
0 Likes
780

Hello Amee,

Your error message is due to that:

Your internal table structure is not same as the database table.

The syntaxt you are using, the internal table should have exact structure as the database table.

TABLES: ztab

DATA: itab type table of ztab initial size 0.

1. update ztab from table itab.

This will update whole line of your ZTAB by comparing the key fields from itab.

If you want to update only one or two fields, you can use SET along with UPDATE,

please refer to the doc.

Regards,

A.Singh

Read only

0 Likes
780

Hi,

First make sure that sturcutre of internal table and ztab is same.

Instead of modifying table in loop.

Modify internal table itself and then make mass update to customized table.

Check below,

LOOP AT itab.

MODIFY itab INDEX sy-index.

ENDLOOP.

MODIFY ztab FROM TABLE itab.

Regards,

Amit R.

Read only

Manoj_Mahajan78
Active Contributor
0 Likes
780

I hope error would have solved...

Regds

MM