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: 

How to update the address number in table KNA1 when changing Customer name

Former Member
0 Kudos

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

7 REPLIES 7

former_member404244
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hello,

I don't know why you want to do that, but you can do it with user-exit EXIT_SAPMF02D_001.

0 Kudos

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

0 Kudos

Hi,

Please find the bellow thread where you will get some idea in using the required user exit for changing address.

Regards,

Goutam Kolluru.

0 Kudos

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

Former Member
0 Kudos

This message was moderated.

gaurav3110
Member

Please use Maintenance view - V_KNA1_CORE to update KNA1 information.