Application Development 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: 

regarding ADDONTABLE.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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>.

3 REPLIES 3

Former Member
0 Kudos

Please provide definitions of your tables. I do not know what ADDONTABLE means.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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>.