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: 

changing address number in KNA1

Former Member
0 Kudos

hi there,

adress for customer is stored in ADRC, ADR6, etc................with adrnr as key.

Adress number is stored in table KNA1.

how can i 'connect' another adress number to KNA1 without doing 'hardcoded' table-update (which is dirty).

reg, Martin

16 REPLIES 16

former_member196079
Active Contributor
0 Kudos

Hi Martin.

You can do an extension af kna1 table...

you enter end with a "structure append" you add your z field....

regards

Marco

0 Kudos

sorry, but i don't understand your response why should i do an append in KNA1 ? what for ??? Which Z-field ????

0 Kudos

HI...

so you would to add another address number on a customer anagraphic right?

so, if you add a custom field, in the customer anagraphic table (kna1), you have another field for store the new address number.

if you enter in kna 1, on the upper bar you find the button "append structure", if you press it you can add the new field for the new address number.

regards

0 Kudos

hi marco,

NO, i don't want to hava another adress. i want to change the existing one in ADRNR !

I have customer A with its adress data with e.g. adrnummer 123.

I have customer B with its adress data with e.g. adrnummber 321.

I want customer B to have the adress of customer A, so customer B needs the adrnr 123 .

reg, Martin

0 Kudos

HI...

Ok sry

You must modify trought abap code the table kna1.

i think is the only way....because if you changhe the address on xd02,

the system will create a new address number for the customer.

regards

Marco

0 Kudos

thats a big problem, because:

the fields in KNA1 will remain with the old values. e.g. name, street, .................

when i change the adress-number.

so i have kind of inconsistency in my data.

reg, Martin

0 Kudos

Hi

you should update also the value in kna1....it's no difficult, because the stras,regio, land and others are also in adrc table, so when you read the adrc, you can update the old value in kna1.


select single * from adrc 
    into corresponding fields of ls_kna1
  where adrc eq ls_kna1-adrc.

is an example.

regards

Marco

0 Kudos

well, okay, but thats getting more dirtier and more dirtier if you know what i mean

what about change-logs, ............

i am looking for a 'standard'-solution without hardcoded table updates

0 Kudos

Just be careful, and sure that the code is the less dirty

anyway yes is a dirty way....

i don't know if exist a standard.....

regards

Marco

0 Kudos

I have customer A with its adress data with e.g. adrnummer 123.

I have customer B with its adress data with e.g. adrnummber 321.

I want customer B to have the adress of customer A, so customer B needs the adrnr 123

I'd strongly suggest to refrain from such changes that are not supported by the data model. I.e. within standard SAP you cannot create two customers with a reference to the same address. The storage of addresses via central address management (i.e. ADR* tables) is completely transparent to the user and not visible.

Let's assume that you'd implement what you're trying to do. Now changing the address of customer A, automatically changes the address of customer B. Thus in order to show the link you'd have to somehow make a grouping indicator visible that ensures that customers with the same address reference can be identified via the user interface (i.e. XD03, VD03, etc. transaction and not SE16 on KNA1). Using a grouping indicator other than the address number would require to keep the two in sync. Possible, but a maintenance issue.

So without further information your data model sounds quite strange, as it's unclear why you'd have to reference addresses instead of syncing up addresses automatically. I.e. if you have a program that somehow can identify customers A and B as customers, which should share an address, then it shouldn't be too hard to update the address fields instead using standard SAP functionality.

I do understand that you'd have possibly trouble ensuring address consistency when addresses are changed (i.e. simultaneously on A and B), but if you think about your model, you can see the same issue. I.e. customers are not locked on address level, so two people could change the address for A and B at the same time. Since they share the address, the last update would win and overwrite the other updates. I can see already the help desk getting all those calls from users asking why the system doesn't work...

Long story short, my simple recommendation is Don't do it!.

Cheers, harald

0 Kudos

@Harald,

my speak ! you are absolutely right ! thats the reason why i DON't DO it in that dirty way ! thats also the reason i have asked if there is anything in 'standard' to archive this ! the answer seems to be: NO !

so.......i have to compare cust. A and B and change the fields on cust B with standard tools like batch-input -> so the changes are also logged, which is important.

is there any better way then do it with batch input ??

reg, Martin

0 Kudos

Hi Martin ,

as you said ,

you have a customer A with its adress data with e.g. adrnummer 123 ,

customer B with its adress data with e.g. adrnummber 321.

why dont you create a CUSTOM TABLE and maintain this mapping over there. i.e., ( B = A ) ?

whenever you need address of B you can refer the address of A through this mapping table .

Edited by: Prasath Arivazhagan on Apr 9, 2010 3:05 PM

0 Kudos

Check out BAPI_CUSTOMER_CHANGEFROMDATA1; if you want to do it on lower level (i.e. <em>business address services</em>) use functions from function group SZA0 (but make sure to add proper locking).

0 Kudos

well, the only way i find out is to do it with batch-input.

there is NO function module /class where it is possible to change a customer including all the adress-data (email-adress, tel.numbers, etc.......).

Former Member
0 Kudos

Try Enhancement "SAPMF02D" / component : "exit_sapmf02d_001" (Customers: User Exit for Checks prior to Saving).

Regards

Vinod

0 Kudos

hello,

i can't use SAPMF02D for that. i have a batch-night run for this. there is a reading of all customers and under certain circumstances the adress has to be changed. NOT in dialog-mode, in background mode !!

reg, Martin