2

Sequence issue of address line for contact person

 3 years ago
source link: https://blogs.sap.com/2021/06/26/sequence-issue-of-address-line-for-contact-person/
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
Technical Articles
Posted on June 26, 2021 3 minute read

Sequence issue of address line for contact person

0 Likes 9 Views 0 Comments

1. The normal format of the address line

Generally, when the contact person been selected or changed in order, the contact person’s first name &last name always been concatenated as name1 like below.

1-22.jpg

If contact details been changed it’ll create new entries at table ADR* accordingly meanwhile VBPA-ADRDA been changed from ‘D’ to ‘E’. Then usually we need to sync those new master data to external systems like SFDC etc.

2. The unusual format of the address line

One user surprised to find out the contact person’s first name and last name not always on the first line of the Name sector like below as Name3, which impacts the further processing at the external system side.

2-10.jpg

I thought this could be controlled by customer user exit like SZAD0001 (refer to this), but I find no customized logic. Actually, the contact details screen in order shares the same sequence at the print preview like VAP3 as well. So no need to check at order processing at all.

3-12.jpg

The root of this format

It depends on the field Formatting routine keys for printing addresses (T005-ADDRS). You can check the standard document for data element ADDRS_005 (or here).

Tips of format determination

The key function module is ‘ADDRESS_INTO_PRINTFORM’ and all address lines added by the method ‘ADD_PRINTFORM_lINE’ of CL_ADDR_PRINTFORM. The best point to set a breakpoint here to check when the address line been inserted especially for the 1st line.

2-9.jpg

Then will found out different sub-method been called like address_layout_001, etc. The layout number controlled by is_t005_rec-ADDRS at method address_layout.

3-11.jpg

Field is_t005_rec-ADDRS fetched by method t005 at if_addr_printform~printform from T005 table.

5-12.jpg

For my case, the contact’s customer which country is Netherland, ADDRS is 003. So the address layout will use the method ‘address_layout_003′.

6-7.jpg

Here the flag iv_person_above_organization controls whether a person’s address should be above the organization or below the organization.

8-6.jpg

The flag IV_PERSON_ABOVE_ORGANIZATION is input parameters of FM: ADDRESS_INTO_PRINTFORM and it’s blank.

6-8.jpg

Then everything became clear inside this method ‘PRINT_PERSON_BELOW_ORG’. This is why the first name and last name from the contact master became the 3rd line as Name3 at that order.

7-8.jpg

So different country has those pre-defined layouts against it, and each process method  ‘method ‘address_layout_XXX’ has specific logic inside. If some formatting issue for address lines, check the country of the customer and key field T005-ADDRS first!

Maybe trace back the logic pure from debugging is workable, but along with business knowledge will make you more efficient for sure! otherwise, it’ll lead to hair loss for sure!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK