01-26-2008 2:12 PM
Is it possible to copy the entire table with its contents to a new table. If so, pls explain. Thank you.
01-26-2008 8:35 PM
hi SRK
assumptions: both the table structures are the same.
the primary keys are the same.
data: begin of itabA.
include structure A.
data: end of itabA.
data: begin of itabB.
include structure B. <<<<< if needed.
data: end of itabB.
select * from A into table itab.
delete table B.
modify table B by itab.
The structure of Itab will the same structure of the Ztable we are updating.
in the above case it will be of type B,
Edited by: Jackandjay on Jan 27, 2008 6:09 PM
01-26-2008 7:40 PM
Hi,
Its possible to copy one table to another with records but there are few limitations.
The table structure of both the internal tables should be exactly same i.e the field names and the field length.
Then define the new table and just use the assignment statement to copy.
For E.g. - A[] = B[]
Here table B is copied on to table A[]. The contents of internal table A are completely overwritten by the contents of internal table B.
01-26-2008 8:35 PM
hi SRK
assumptions: both the table structures are the same.
the primary keys are the same.
data: begin of itabA.
include structure A.
data: end of itabA.
data: begin of itabB.
include structure B. <<<<< if needed.
data: end of itabB.
select * from A into table itab.
delete table B.
modify table B by itab.
The structure of Itab will the same structure of the Ztable we are updating.
in the above case it will be of type B,
Edited by: Jackandjay on Jan 27, 2008 6:09 PM
01-27-2008 10:07 AM
Hi Jackandjay
what is the structure of itab.. i mean it is declared of which type?
01-26-2008 9:09 PM
Hi srk,
this is a typical "If I don't know how top press F1 I have to try" question.
[Conversion Rules for Internal Tables (SAP Library - ABAP Programming (BC-ABA)):|http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb34d0358411d1829f0000e829fbfe/content.htm]
Regards,
Clemens