2

How to Update and Fetch customer address from sales order.

 1 year ago
source link: https://blogs.sap.com/2023/03/25/how-to-update-and-fetch-customer-address-from-sales-order./
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
March 25, 2023 2 minute read

How to Update and Fetch customer address from sales order.

Customer address we used in many scenarios in O2C flows we use customer addresses to print on the smart form (Output). send it through idoc etc.

I am bringing this topic to you based on my experience in the implementation project _

Some of you already know how to change a customer address in a Sales order and how to put logic to fetch details for the same however some are not still aware that we can change a customer address and we can fetch the address of the customer at sales order level as well_

So let’s begin… I will cover the below points_

  1. Fetching the customer address from the customer master.
  2. How to change the Customer address in the sales order?
  3. Fetching the customer address from the Sales order.
  4. Workaround proposal for the customer address if it’s fetched from the order level.

1. Fetching address from customer master:

Many consultants follow this approach to fetch data from the KNA1 table and use it in output,

the report, idoc etc.

the logic to fetch the customer address from KNA1 is_

Pass KUNNR field into a table KNA1 and get ADRNR field

Pass ADRNR field as ADDRNUMBER into a table ADRC and get customer address

(NAME, STRRET, House Number, City, Pin code)

2. How to change the customer address in the Sales Order?

go to sales document (VA01/VA02) Header – Partners tab and double click on the

partner function for which you want to change the address details_

Tes01.jpg

and after completing changes save the order.

So before changing the customer address in the sales order the address number at sales order

VBPA and KNA1 table level will be same_

KNA1-VBPA-1.jpg

After changing address of customer in sales order your sales order level address number get

change and new address number will contain address from your sales order.

VBPA-Change.jpg

3. Fetching the customer address from the Sales order.

Pass VBELN field into a table VBPA and get ADRNR field

Pass ADRNR field as ADDRNUMBER into a table ADRC and get customer address

(NAME, STRRET, House Number, City, Pin code)

4. Workaround proposal for the customer address if it’s fetched from the order level.

In implementation project we have seen some scenario where customer address is not correctly updated into a system and user want to issue invoice, delivery, order to customer with correct address details so we can advice user to change it in the order itself and system will fetch expected details and user need not to wait till there master data get corrected.

Conclusion:

You can change the customer address only in sales order and delivery. when you update customer address in order or delivery it will automatically reflect in both place. however SAP have not given this functionality for invoice.

Change in customer address can be done in sales order even after the subsequent document are created.

Customer address change will be applicable only for particular Order and subsequent delivery.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK