‎2007 Jul 20 5:08 PM
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.
‎2007 Jul 20 5:20 PM
Amee,
Use:
UPDATE ZTAB FROM TABLE itab.
No loop is required then as well.
‎2007 Jul 20 5:20 PM
Amee,
Use:
UPDATE ZTAB FROM TABLE itab.
No loop is required then as well.
‎2007 Jul 20 5:27 PM
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
‎2007 Jul 21 3:52 AM
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
‎2007 Jul 21 5:21 AM
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.
‎2007 Aug 19 11:41 AM