Normally we pick the Customer Address in Smartforms by taking Address Number from KNA1 & passing the same in ARDC Table. This will give Customer’s address as entered in Customer Master Record.
But think of a scenario where User has changed Customer Address in Sales Order & the same need to be printed in Print-Outs. How to ensure that this new (One-time) address is Printed in Sales Document Print-Outs.
Just like system assigns a address number to each Customer Master, similarly whenever the Address is changed in Sales Documents, system stores the new Address in ADRC Table with new Address number.
Ask your ABAPer to include the following logic in Smartform program:
Go to SE16N & Explore Table VBPA
Enter the relevant Sales Document Number & Partner Function & Execute.
Pick the Address Number (ADRNR) & pass the same to ADRC Table to get the changed address.
Also in VBPA the indicator (Address Indicator) – ADRDA is set to E if Address is changed in Sales Document Manually.
This will ensure that system will print the correct address in Sales Document Print-Outs.