04-09-2010 8:50 AM
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
04-09-2010 8:58 AM
Hi Martin.
You can do an extension af kna1 table...
you enter end with a "structure append" you add your z field....
regards
Marco
04-09-2010 9:05 AM
sorry, but i don't understand your response why should i do an append in KNA1 ? what for ??? Which Z-field ????
04-09-2010 9:16 AM
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
04-09-2010 9:19 AM
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
04-09-2010 9:24 AM
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
04-09-2010 9:27 AM
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
04-09-2010 9:34 AM
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
04-09-2010 9:38 AM
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
04-09-2010 9:41 AM
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
04-09-2010 12:38 PM
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
04-09-2010 1:41 PM
@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
04-09-2010 2:05 PM
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
04-09-2010 2:06 PM
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).
04-12-2010 10:00 AM
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.......).
04-09-2010 9:10 AM
Try Enhancement "SAPMF02D" / component : "exit_sapmf02d_001" (Customers: User Exit for Checks prior to Saving).
Regards
Vinod
04-09-2010 9:14 AM
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