02-01-2012 7:28 AM
Hi,
I have a requirement that whenever users change customer name or address using tcode vd02/xd02. I need to generate a new address number(ADRNR) in table KNA1 for that customer.
Do you have any advice how can I make it happen?
Thanks,
Hung
02-01-2012 7:46 AM
Hi,
I doubt if you can create a new address but you can modify the existing address.
Try the funtion module ADDR_MAINTAIN_COMPLETE.
Regards,
Nagaraj
02-01-2012 8:18 AM
Hello,
I don't know why you want to do that, but you can do it with user-exit EXIT_SAPMF02D_001.
02-01-2012 8:55 AM
Hi,
The reason I need to do that is:
When I change the customer address of a customer at master level(xd02/vd02). For all the sales order that ship-to this customer, the address is updated to the new one automatically. However, for the sales that's already completed, business users don't want to have the updated data. they just want every thing keep remain unchanged.
As I do investigation, the sales order will get ship to address based on address number ( in table vbap), then the system will use this address number to get the ship-to address from table ADRC.
Currently, If I change the address of a customer at master level, then the address number is not changed but the address is changed ( in table ADRC). As a result, the updated address is assigned to the sales order.
In order to solve the problem, the business analyst provide a solution that whenever updating address of a customer at master level, there should be a new address number assigned to this customer.
By this way the ship-to address of the completed sales orders that are shipped to the customer will not be changed because it gets the ship to address based on the old address number.
To fulfill the requirements I need to do the following things:
1. Generate a new valid address number
2. Update the new address number to the corresponding customer ( KNA1-ADRNR) after modifying customer's address in tcode vd02/xd02.
I tried the user exit EXIT_SAPMF02D_001. But it's not the place where I can change the address number.
Thanks,
Hung
02-01-2012 8:58 AM
Hi,
Please find the bellow thread where you will get some idea in using the required user exit for changing address.
Regards,
Goutam Kolluru.
02-02-2012 6:34 AM
Hi,
Thanks for your information. I checked the solution that you adviced.
However, even I can change the adrnr of the structure KNA1 here. It will not update the updated value to the table KNA1.
Thanks,
Hung
05-19-2015 9:21 AM
10-25-2021 11:17 AM
Please use Maintenance view - V_KNA1_CORE to update KNA1 information.