Starting with Basis Release 6.1, SAP introduced its Business Address Services (BAS) which is central to the SAP Central Address Management (CAM) functionality.
Originally, SAP stored address information directly in master records for customers, vendors etc. However, it soon became clear that there needed to be a central method for handling addresses across the SAP platform.
The SAP Address Solution
Therefore, SAP came up with this new method for storing address information. It is a flexible way to maintain address and communication information across the range of customers, vendors and business interests.
Instead of storing this information directly in the customer master records, for instance, a record is created in a central address table called ADRC and the unique Address Number ADRNR is stored in the master record.
SAP SmartForms – Address Node
SmartForms makes it quick and easy to access the correct address information and display it properly on your SmartForms document. There are basically three simple steps that you need to take to print address information formatted according to the postal regulations of the sender country. The SmartForms Address node will do the rest for you.
- Create a Window node that will contain the printed address information
- Under the Window node, create a Program Lines node and write code to abtain the correct Address Number
- Create an Address node and populate it with the Address Number and specific formating options.
Basic ABAP code to obtain an address number might look something like this example.
* Get Sales Org Address Information SELECT SINGLE adrnr INTO z_adrnr FROM tvko "Organizational Unit: Sales Organizations WHERE vkorg = z_hd_org-salesorg. adrnr = z_adrnr.
There are three basic Address Types to choose from as shown below. Each address type requires a specific address number key. The field containing the Address number is determined dynamically using code similar to that shown above. A more detailed example is shown later in this article.
- Organization Address (Business) – Requires a single ten-digit address number
- Private Address (Specific person) – Requires a person number and an address number
- Workplace Address (Contact persons) – Require a person number and an address number
Note: The address number field must have a valid value at the time of output. If not, the output process is terminated with a runtime error that you may not be unitelligible. Therefore, use the Address Condition in the address node to check to see if there is an address number present.
This really makes it easy to access and display address information. You can get additional information on the Address Node in SmartForms and SAP’s Central Address Management on pages 119-123 in the SAP Press book entitled SAP Smart Forms by Werner Hertleif and Chistoph Wachter.
Multiple Phone and Fax Numbers
But what happens if there are muliple phone numbers, fax numbers or e-mail addresses associated with an address? Where are they stored and how can you access them?
This is handled in several different tables including the ADRT table which keys off of the same Address Number. It also contains fields for PERSNUMBER, COMM_TYPE and CONSNUMBER. These fields allow multiple records of the same type to be stored.
Business Address Services (BAS)
The actual phone numbers are stored in the ADR2 table with flags indicating the default number. Following is a list of tables that make up the Business Address Services (BAS).
|ADRT||Communication Data Text|
|ADR7||Remote Mail Addresses|
|ADR12||FTP and URL|
|ADR14-16||Reserved Communication Method|
Identifying and Retrieving Specific Numbers
In order to specify the purpose of each phone number you can enter an identifying text in the REMARK field such as Retail or Consumer. In this way you can write code to pull the exact phone number when multiple phone numbers are available.
Example SmartForm ABAP Code
The following ABAP code is an example of how to access address information from the Central Address Management (CAM) frame work within a program node in a SmartForms document.
Input Paramaters IS_BILL_INVOICE Output Parameters Z_ADRNR Z_TEL_NUMBER DATA: z_consnumber TYPE adrt-consnumber, lv_flagcomm2 TYPE adrc-flagcomm2, lv_flagcomm6 TYPE adrc-flagcomm6, lv_flagcomm12 TYPE adrc-flagcomm6. CLEAR: z_hd_org, z_adrnr, z_consnumber, lv_flagcomm2, lv_flagcomm6, lv_flagcomm12. MOVE-CORRESPONDING is_bil_invoice-hd_org TO z_hd_org. * Get Address Number for Sales Org SELECT SINGLE adrnr INTO z_adrnr FROM tvko WHERE vkorg = z_hd_org-salesorg. adrnr = z_adrnr. * Get Address Information for Sales Org SELECT SINGLE tel_number fax_number flagcomm2 flagcomm6 flagcomm12 INTO (z_tel_number, z_fax_number, lv_flagcomm2, lv_flagcomm6, lv_flagcomm12) FROM adrc WHERE addrnumber = z_adrnr. * Check for multiple Telephone Numbers IF lv_flagcomm2 = 'X'. SELECT SINGLE kunag vkorg vtweg spart INTO CORRESPONDING FIELDS OF vbrk FROM vbrk "Billing Document: Header Data WHERE vbeln = is_bil_invoice-hd_gen-bil_number. IF sy-subrc = 0. * Get Customer Group SELECT SINGLE kvgr1 INTO z_kvgr1 FROM knvv "Customer Master Sales Data WHERE kunnr = vbrk-kunag AND vkorg = vbrk-vkorg AND vtweg = vbrk-vtweg AND spart = vbrk-spart. ENDIF. CASE z_kvgr1. "Customer Group1. WHEN 'CC'. "Consumer SELECT SINGLE consnumber INTO z_consnumber FROM adrt "Communication Data Text (Business Address Services) WHERE addrnumber = z_adrnr AND comm_type = 'TEL' AND remark = 'Consumer'. WHEN OTHERS. "Retail SELECT SINGLE consnumber INTO z_consnumber FROM adrt "Communication Data Text (Business Address Services) WHERE addrnumber = z_adrnr AND comm_type = 'TEL' AND remark = 'Retail'. ENDCASE. * Get Phone Number SELECT SINGLE tel_number INTO z_tel_number FROM adr2 "Telephone Number WHERE addrnumber = z_adrnr AND consnumber = z_consnumber. ENDIF. * Get E-mail Address IF lv_flagcomm6 = 'X'. SELECT SINGLE smtp_addr INTO z_smtp_addr FROM adr6 "E-mail Addresses WHERE addrnumber = z_adrnr. ENDIF. * Get Internet Address #1 IF lv_flagcomm12 = 'X'. SELECT SINGLE uri_srch INTO z_uri_srch1 FROM adr12 "FTP or URL Addresses WHERE addrnumber = z_adrnr AND consnumber = '001' AND uri_type = 'HPG'. * Get Internet Address #2 SELECT SINGLE uri_srch INTO z_uri_srch2 FROM adr12 WHERE addrnumber = z_adrnr AND consnumber = '002' AND uri_type = 'HPG'. ENDIF.
The SAP Central Address Management (CAM) system puts all addressing information in the same location. This makes it quick and convenient to access and print address information on SAP SmartForms and other output.
Special Note: All user addresses, external addresses and communication partner addresses (maintained with transaction SAD0) have been converted to the new central address management (Business Address Services) for Release 4.0. The transaction SAD0 is no longer supported.
User addresses and their company addresses can be maintained in the user maintenance (transaction SU01). The user address can also be changed in the SAPoffice settings.
External company addresses and contact person addresses can be maintained with the transactions SOAD and SOCP respectively.
These transactions are in the SAPoffice menu under Administration -> Company addresses or Administration -> Contact person addresses.
The SAPoffice menu is under System -> Services -> Office or the transaction code SOFF.
Addresses of other objects (e.g. Organizational units such as Plant or Company code) can no longer be maintained directly, but only in the object-specific maintenance transactions (Plant addresses e.g. in the Plant maintenance in the customizing transaction OX10).
You can get a more detailed description of Text Administration in SAP by consulting the SAP Press book entitled “SAP Smart Forms” by Werner Hertleif and Chistoph Wachter.