‎2005 Jan 16 4:08 AM
hello,
I HAVE 15FIELDS IN MY ADDONTABLE ZXXX,
I HAVE 10FIELDS IN INTERNALTABLE, I want to insert
those 10Fields internal table records into ADDONTABLE ZXXX,
is it not possible to do? ..lets assume that remaining 5fields are empty. how to do it.
ambichan.
‎2005 Mar 31 7:27 AM
Hello ambichan,
I don't understand what is meant by an ADDONTABLE. Here's what I do understand. Crrect me if I have misunderstood.
1. ZXXX is a database table and it has 15 fields.
2. You have an internal table which has 10 of the fields in the table ZXXX.
3. Assuming that the other 5 fields are all initial, you want to transfer the contents of the internal table to the database table.
If that is what you are looking for, then it can be done. But not directly. here's how you do it -
data itab_new type ZXXX occurs 0 with header line.
loop at itab_old. " this is your table with 10 fields.
move-corresponding itab_old to itab_new.
append itab_new.
endloop.
insert ZXXX from table itab_new.Was that what you were looking for ?
Regards,
<a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=zwcc%2fwm4ups%3d">anand Mandalika</a>.
‎2005 Jan 16 7:20 PM
Please provide definitions of your tables. I do not know what ADDONTABLE means.
‎2005 Jan 17 6:04 AM
Hi Dear Ambi Chan,
1. What i understood is that from the internal
table, you want to transfer the records
to the database table without writing 10
lines for each field.
2. For this purpose, one can use
move-corresponding itab to dbtab.
append dbtab.
3. The first line will transfer fields
with the same name.
If you find it useful, pls give points.
Thanks & Regards,
Amit Mittal.
‎2005 Mar 31 7:27 AM
Hello ambichan,
I don't understand what is meant by an ADDONTABLE. Here's what I do understand. Crrect me if I have misunderstood.
1. ZXXX is a database table and it has 15 fields.
2. You have an internal table which has 10 of the fields in the table ZXXX.
3. Assuming that the other 5 fields are all initial, you want to transfer the contents of the internal table to the database table.
If that is what you are looking for, then it can be done. But not directly. here's how you do it -
data itab_new type ZXXX occurs 0 with header line.
loop at itab_old. " this is your table with 10 fields.
move-corresponding itab_old to itab_new.
append itab_new.
endloop.
insert ZXXX from table itab_new.Was that what you were looking for ?
Regards,
<a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=zwcc%2fwm4ups%3d">anand Mandalika</a>.