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: 

Add records to KNA1

Former Member
0 Kudos

Hi , everyone!

I'm a beginner, and I want to add some records into KNA1, but I don't know how to do it.

Please help me!

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

no it not only the way you can use insert or modify command also from your ABAP code, But it is not the correct way to update the standard table .

the insert command is like that.

INSERT INTO dbtab VALUES wa.

or from int table

INSERT dbtab FROM TABLE itab.

for modify

MODIFY dbtab FROM wa.

or from int table

MODIFY dbtab FROM TABLE itab.

regards

shiba dutta

11 REPLIES 11

Former Member
0 Kudos

Hi,

KNA1 is a standard table. Why do you want to add some fields to it?

You can use APPEND or INCLUDE for doing this but it is not recommended unless solid business reason for it.

Regards,

Atish

0 Kudos

Thanks , Atish.

I don't want to add some fields , I only want to add some records. Can I use INSERT ? Or

must I use a T-code?

Regards.

0 Kudos

Hi,

Now adding new records to standard table using SQL is also not recommended.

You should use standard transactions to do so.

As it is a customer master data table you shold create customer it will automatically fill this table.

Regards,

Atish

0 Kudos

hi,

if u want to move records from ur program or internal table.then use...

LOOP AT ITAB.

MOVE ITAB-KUNNR TO KNA1-KUNNR.

MOVE ITAB-NAME1 TO KNA1-NAME1.

INSERT KNA1.

ENDLOOP.

if u want to add records from t-code then use XD01 t-code. automatically it will add to ur table.

Senthil kumar

Former Member
0 Kudos

hi,

do u want to add records or fields.explain your question briefly.

senthil kumar

Former Member
0 Kudos

i think you are asking to enter some data in kna1 . if it is so then run the tcode XD01 or FD01 create customer and save the data. It will update the kna1 table

regards

shiba dutta

0 Kudos

Thanks , SHIBA.

Yes, I want to enter some data in KNA1. And I want to ask if the tcode is the only way to add data?

0 Kudos

Hi,

The t-code is not the only way.

you can use BAPI_CUSTOMER_CREATE for the same.

but don't do direct table updates.

Regards,

Atish

Former Member
0 Kudos

no it not only the way you can use insert or modify command also from your ABAP code, But it is not the correct way to update the standard table .

the insert command is like that.

INSERT INTO dbtab VALUES wa.

or from int table

INSERT dbtab FROM TABLE itab.

for modify

MODIFY dbtab FROM wa.

or from int table

MODIFY dbtab FROM TABLE itab.

regards

shiba dutta

Former Member
0 Kudos

Hi Feng,

When we add data through a transaction it will be updating many table which will be linked. Thats why we normally go for transaction. You can update that through UPDATE command from the internal table whoch contains data to be updated.

The better way to update or append an SAP table is to find a correpsonding Bapi or Function module which can update the table. The function module or Bapi will have the code for updating the corresponding tables which are linked.

regards

Avi...

Former Member
0 Kudos

Hi,

It is not advisable to do direct table inserts to the table KNA1..

You should use the transaction XK01 or VD01 to created records to the tbale KNA1

Thanks

Naren