‎2006 Mar 13 9:29 AM
Hi to all.
i wanna insert records from itab into dbtab/
when i use this command:
INSERT dbtab FROM TABLE itab.
the program is fall on this line and i get this msg:
"It is too big".
what i wanna do is just transfer from itab the corresponding fields to the dbtab.
plz help me.
thanks.
‎2006 Mar 13 9:33 AM
Hi gil,
1. Simple.
2. declare your itab EXACTLY like dbtab.
3. then use this logic.
LOOP AT ITAB.
MODIFY DBTAB FROM ITAB.
ENDLOOP.
(THIS WILL TAKE CARE OF ADD/EDIT
BASED UPON THE PRIMARY KEY,
AUTOMATICALLY)
regards,
amit m.
‎2006 Mar 13 9:34 AM
use workarea instead oof whole internal table data.
INSERT INTO dbtab VALUES wa.
‎2006 Mar 13 9:34 AM
use Modify statement of Inserting or Updating records.
The MODIFY statement changes existing lines and inserts lines which do not exist.
Syntax is :
Modify dbtablename from itab(internal table name).
‎2006 Mar 13 9:34 AM
Hi Gil,
You can insert record in DB table using.
<b>Insert statement</b>
INSERT dbtab FROM TABLE itab
<b>Modify Statement</b>.
MODIFY dbtab FROM wa
If record doesn't exsist it will insert a new record in that.
Cheers
Sunny
‎2006 Mar 13 9:34 AM
Use
MODIFY dbtab FROM TABLE itab. or
MODIFY (dbtabname) FROM TABLE itab.
befor modify populate all data into itab.
Regards
vinod
‎2006 Mar 13 9:35 AM
Hi,
Your itab must match with the dbtab.
Have you declared the internal table as dbtable.
If yes, then your command is perfect.
Just check the structures are matching or not.
Regards,
Shashank
‎2006 Mar 13 9:39 AM
Hi,
Such type of errors pops up when you are trying to upload entire data of Internal table in to database table... So as to overcome such situation use work area
i.e,
<b>INSERT INTO dbtab VALUES wa.</b>
‎2006 Mar 13 9:44 AM
i know that t itab have more fields the the dbtab ,
i just wanna insert the corresponding fields to the dbtab.
thanks.
‎2006 Mar 13 9:49 AM
Hi,
If the itab has more fields, then check the sequence of fields. It should match with that in the actual dbtab.
Regards,
Shashank
‎2006 Mar 13 9:53 AM
declare an internal table (say itab1) like dbtab.
then use move-corresponding to copy lines of itab into this internal table.
now use the insert statement using itab1.
‎2006 Mar 13 9:38 AM
Hi,
INSERT dbtab FROM TABLE itab.The structure of itab must be at least as wide as the table work area dbtab and its alignment must correspond to that of the table work area, otherwise a runtime error will occur.
Riyaz
‎2006 Mar 13 9:41 AM
PROBABLY THE INTERNAL TABLE STRUCTURE AND DBTAB ARE NOT SIMILAR
‎2006 Mar 13 9:52 AM
if ur itab is not matching the dbtab then u go for modify statement.
i thought it was
itab like DBTAB occurs 0 with header line.
but as per ur reply it is not.
so now ur option has to be this one.
see that u r itab is containg all the primary keys as that of the DBtab.
if this is not so then there may be a CONFLICT OF INSERTING DUPLICATE ENTIRES.
say ur DBTAB has primary keys P1, P2, P3.
so ur ITAB has to contain the three keys .
then get the content into itab.
loop at itab.
modify table DBTAB from ITAB.
endloop.
hope this helps ,
vijay.
‎2006 Mar 13 10:28 AM
Hi Gil
U have to declear the same structure as dtab and then try to insert.
u can use move corresponding itab to dbtab.
it will move all the fields that are matching in itab or else i wont move.
i think this will solve u r prob
Thanks
Vikranth Khimavath
‎2006 Mar 13 12:37 PM
ok...
the problem is that the itab that i read from is declare like this:
DATA: BEGIN OF invctab OCCURS 0,
k LIKE vbrk,
p LIKE vbrp,
x LIKE extras.
DATA: END OF invctab.
and i need to move-corresponding fields to dbtab.
i try to move-corresponding to my dbtab.
and the msg its to big return.
any idea?
‎2006 Mar 13 12:41 PM
loop at invctab.
move-coresponding invctab to dbtab.
append dbtab.
clear dbtab.
endloop.Message was edited by: Sekhar