SAP ADDRESS_INTO_PRINTFORM Function Module for Address Format According to Post Office Guidelines
ADDRESS_INTO_PRINTFORM is a standard address into printform SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Address Format According to Post Office Guidelines processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for address into printform FM, simply by entering the name ADDRESS_INTO_PRINTFORM into the relevant SAP transaction such as SE37 or SE38.
Function Group: SADR
Program Name: SAPLSADR
Main Program: SAPLSADR
Appliation area:
Release date: 04-Mar-1999
Mode(Normal, Remote etc): Normal Function Module
Update:
Function ADDRESS_INTO_PRINTFORM pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'"Address Format According to Post Office Guidelines.
EXPORTING
* ADRSWA_IN = "Structure: Address data/control parameter (type ' ')
* SENDER_COUNTRY = ' ' "Sender country (for type 1,2,3) - important !
* RECEIVER_LANGUAGE = ' ' "Recipient language (for type 1,2,3)
* NUMBER_OF_LINES = 10 "Max. line length for the formatting (type 1,2,3)
* STREET_HAS_PRIORITY = ' ' "Flag: Street has priority over PO Box
* LINE_PRIORITY = ' ' "Line suppresion sequence
* COUNTRY_NAME_IN_RECEIVER_LANGU = ' ' "Flag: Output country in recipient language
* LANGUAGE_FOR_COUNTRY_NAME = ' ' "Country name language
* NO_UPPER_CASE_FOR_CITY = ' ' "Flag: No upper case letters for District and Country
* IV_NATION = ' ' "International Version for Formatting
* IV_NATION_' ' = ' ' "Flag: Use international version ' ' in all cases
* ADDRESS_1 = "Transfer structure: Address data (type 1)
* IV_PERSON_ABOVE_ORGANIZATION = ' ' "Print Person Above Organization
* IS_BUPA_TIME_DEPENDENCY = ' ' "Transfer Structure for Time Dependency BUT000
* IV_COUNTRY_NAME_SEPARATE_LINE = ' ' "Indicator: Always Ouput Country Name in its Own Line
* IV_LANGU_CREA = ' ' "Language Key
* IV_DISPLAY_COUNTRY_IN_SHRTFORM = ' ' "Display Country Key in Short Form
* ADDRESS_2 = "Transfer structure: Address data (type 2)
* ADDRESS_3 = "Transfer structure: Address data (type 3)
* ADDRESS_TYPE = ' ' "Address type: 1,2,3 or ' '(default)
* ADDRESS_NUMBER = ' ' "Address number (data is read directly)
* ADDRESS_HANDLE = ' ' "
* PERSON_NUMBER = ' ' "Person number (data are read directly)
* PERSON_HANDLE = ' ' "
IMPORTING
ADRSWA_OUT = "Transfer record: formatted address (type ' ')
ADDRESS_PRINTFORM_TABLE = "Formatted address in table form
ADDRESS_SHORT_FORM_WO_NAME = "Short Form Street and City (Type 1,2,3)
EV_NATION = "Actual version used if IV_NATION was transmitted
ADDRESS_PRINTFORM = "Formatted address (type 1,2,3)
ADDRESS_SHORT_FORM = "Short form of the formatted address (type 1,2,3)
ADDRESS_SHORT_FORM_S = "Short form incl. street (type 1,2,3)
ADDRESS_DATA_CARRIER = "Data carrier address (type 1,2,3)
ADDRESS_DATA_CARRIER_0 = "Second line for the data medium (type 1,2,3)
NUMBER_OF_USED_LINES = "Number of lines occupied (type 1,2,3)
NAME_IS_EMPTY = "Flag: Name fields empty, no formatting
ADDRESS_NOT_FOUND = "Address not found (when entering address no.)
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLSADR_001
IMPORTING Parameters details for ADDRESS_INTO_PRINTFORM
ADRSWA_IN - Structure: Address data/control parameter (type ' ')
Data type: ADRSOptional: Yes
Call by Reference: No ( called with pass by value option)
SENDER_COUNTRY - Sender country (for type 1,2,3) - important !
Data type: SZAD_FIELD-SEND_CNTRYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RECEIVER_LANGUAGE - Recipient language (for type 1,2,3)
Data type: T002-SPRASDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NUMBER_OF_LINES - Max. line length for the formatting (type 1,2,3)
Data type: ADRS-ANZZLDefault: 10
Optional: Yes
Call by Reference: No ( called with pass by value option)
STREET_HAS_PRIORITY - Flag: Street has priority over PO Box
Data type: SZAD_FIELD-STREETPRIODefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LINE_PRIORITY - Line suppresion sequence
Data type: SZAD_FIELD-PRIORITYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
COUNTRY_NAME_IN_RECEIVER_LANGU - Flag: Output country in recipient language
Data type: SZAD_FIELD-FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE_FOR_COUNTRY_NAME - Country name language
Data type: T002-SPRASDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_UPPER_CASE_FOR_CITY - Flag: No upper case letters for District and Country
Data type: SZAD_FIELD-FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_NATION - International Version for Formatting
Data type: ADRC-NATIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_NATION_SPACE - Flag: Use international version SPACE in all cases
Data type: T_BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESS_1 - Transfer structure: Address data (type 1)
Data type: ADRS1Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_PERSON_ABOVE_ORGANIZATION - Print Person Above Organization
Data type: T_BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_BUPA_TIME_DEPENDENCY - Transfer Structure for Time Dependency BUT000
Data type: ADBUPA_TDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COUNTRY_NAME_SEPARATE_LINE - Indicator: Always Ouput Country Name in its Own Line
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: Yes
IV_LANGU_CREA - Language Key
Data type: T002-SPRASDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_DISPLAY_COUNTRY_IN_SHRTFORM - Display Country Key in Short Form
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESS_2 - Transfer structure: Address data (type 2)
Data type: ADRS2Optional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESS_3 - Transfer structure: Address data (type 3)
Data type: ADRS3Optional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESS_TYPE - Address type: 1,2,3 or ' '(default)
Data type: SZAD_FIELD-ADDR_TYPEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESS_NUMBER - Address number (data is read directly)
Data type: ADRC-ADDRNUMBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ADDRESS_HANDLE -
Data type: SZAD_FIELD-HANDLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERSON_NUMBER - Person number (data are read directly)
Data type: ADRP-PERSNUMBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERSON_HANDLE -
Data type: SZAD_FIELD-HANDLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for ADDRESS_INTO_PRINTFORM
ADRSWA_OUT - Transfer record: formatted address (type ' ')
Data type: ADRSOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_PRINTFORM_TABLE - Formatted address in table form
Data type: SZADR_PRINTFORM_TABLEOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_SHORT_FORM_WO_NAME - Short Form Street and City (Type 1,2,3)
Data type: SZAD_FIELD-ADDR_SHORTOptional: No
Call by Reference: No ( called with pass by value option)
EV_NATION - Actual version used if IV_NATION was transmitted
Data type: ADRC-NATIONOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_PRINTFORM - Formatted address (type 1,2,3)
Data type: ADRS_PRINTOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_SHORT_FORM - Short form of the formatted address (type 1,2,3)
Data type: SZAD_FIELD-ADDR_SHORTOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_SHORT_FORM_S - Short form incl. street (type 1,2,3)
Data type: SZAD_FIELD-ADDR_SHORTOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_DATA_CARRIER - Data carrier address (type 1,2,3)
Data type: SZAD_FIELD-ADDR_DCOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_DATA_CARRIER_0 - Second line for the data medium (type 1,2,3)
Data type: SZAD_FIELD-ADDR_DCOptional: No
Call by Reference: No ( called with pass by value option)
NUMBER_OF_USED_LINES - Number of lines occupied (type 1,2,3)
Data type: ADRS-ANZZLOptional: No
Call by Reference: No ( called with pass by value option)
NAME_IS_EMPTY - Flag: Name fields empty, no formatting
Data type: SZAD_FIELD-FLAGOptional: No
Call by Reference: No ( called with pass by value option)
ADDRESS_NOT_FOUND - Address not found (when entering address no.)
Data type: SZAD_FIELD-FLAGOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for ADDRESS_INTO_PRINTFORM Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_adrswa_in | TYPE ADRS, " | |||
lv_adrswa_out | TYPE ADRS, " | |||
lv_sender_country | TYPE SZAD_FIELD-SEND_CNTRY, " SPACE | |||
lv_address_printform_table | TYPE SZADR_PRINTFORM_TABLE, " | |||
lv_receiver_language | TYPE T002-SPRAS, " SPACE | |||
lv_address_short_form_wo_name | TYPE SZAD_FIELD-ADDR_SHORT, " | |||
lv_ev_nation | TYPE ADRC-NATION, " | |||
lv_number_of_lines | TYPE ADRS-ANZZL, " 10 | |||
lv_street_has_priority | TYPE SZAD_FIELD-STREETPRIO, " SPACE | |||
lv_line_priority | TYPE SZAD_FIELD-PRIORITY, " SPACE | |||
lv_country_name_in_receiver_langu | TYPE SZAD_FIELD-FLAG, " SPACE | |||
lv_language_for_country_name | TYPE T002-SPRAS, " SPACE | |||
lv_no_upper_case_for_city | TYPE SZAD_FIELD-FLAG, " SPACE | |||
lv_iv_nation | TYPE ADRC-NATION, " SPACE | |||
lv_iv_nation_space | TYPE T_BOOLE, " SPACE | |||
lv_address_1 | TYPE ADRS1, " | |||
lv_address_printform | TYPE ADRS_PRINT, " | |||
lv_iv_person_above_organization | TYPE T_BOOLE, " SPACE | |||
lv_is_bupa_time_dependency | TYPE ADBUPA_TD, " SPACE | |||
lv_iv_country_name_separate_line | TYPE XFELD, " SPACE | |||
lv_iv_langu_crea | TYPE T002-SPRAS, " SPACE | |||
lv_iv_display_country_in_shrtform | TYPE XFELD, " SPACE | |||
lv_address_2 | TYPE ADRS2, " | |||
lv_address_short_form | TYPE SZAD_FIELD-ADDR_SHORT, " | |||
lv_address_3 | TYPE ADRS3, " | |||
lv_address_short_form_s | TYPE SZAD_FIELD-ADDR_SHORT, " | |||
lv_address_type | TYPE SZAD_FIELD-ADDR_TYPE, " SPACE | |||
lv_address_data_carrier | TYPE SZAD_FIELD-ADDR_DC, " | |||
lv_address_number | TYPE ADRC-ADDRNUMBER, " SPACE | |||
lv_address_data_carrier_0 | TYPE SZAD_FIELD-ADDR_DC, " | |||
lv_address_handle | TYPE SZAD_FIELD-HANDLE, " SPACE | |||
lv_number_of_used_lines | TYPE ADRS-ANZZL, " | |||
lv_name_is_empty | TYPE SZAD_FIELD-FLAG, " | |||
lv_person_number | TYPE ADRP-PERSNUMBER, " SPACE | |||
lv_person_handle | TYPE SZAD_FIELD-HANDLE, " SPACE | |||
lv_address_not_found | TYPE SZAD_FIELD-FLAG. " |
  CALL FUNCTION 'ADDRESS_INTO_PRINTFORM' "Address Format According to Post Office Guidelines |
EXPORTING | ||
ADRSWA_IN | = lv_adrswa_in | |
SENDER_COUNTRY | = lv_sender_country | |
RECEIVER_LANGUAGE | = lv_receiver_language | |
NUMBER_OF_LINES | = lv_number_of_lines | |
STREET_HAS_PRIORITY | = lv_street_has_priority | |
LINE_PRIORITY | = lv_line_priority | |
COUNTRY_NAME_IN_RECEIVER_LANGU | = lv_country_name_in_receiver_langu | |
LANGUAGE_FOR_COUNTRY_NAME | = lv_language_for_country_name | |
NO_UPPER_CASE_FOR_CITY | = lv_no_upper_case_for_city | |
IV_NATION | = lv_iv_nation | |
IV_NATION_SPACE | = lv_iv_nation_space | |
ADDRESS_1 | = lv_address_1 | |
IV_PERSON_ABOVE_ORGANIZATION | = lv_iv_person_above_organization | |
IS_BUPA_TIME_DEPENDENCY | = lv_is_bupa_time_dependency | |
IV_COUNTRY_NAME_SEPARATE_LINE | = lv_iv_country_name_separate_line | |
IV_LANGU_CREA | = lv_iv_langu_crea | |
IV_DISPLAY_COUNTRY_IN_SHRTFORM | = lv_iv_display_country_in_shrtform | |
ADDRESS_2 | = lv_address_2 | |
ADDRESS_3 | = lv_address_3 | |
ADDRESS_TYPE | = lv_address_type | |
ADDRESS_NUMBER | = lv_address_number | |
ADDRESS_HANDLE | = lv_address_handle | |
PERSON_NUMBER | = lv_person_number | |
PERSON_HANDLE | = lv_person_handle | |
IMPORTING | ||
ADRSWA_OUT | = lv_adrswa_out | |
ADDRESS_PRINTFORM_TABLE | = lv_address_printform_table | |
ADDRESS_SHORT_FORM_WO_NAME | = lv_address_short_form_wo_name | |
EV_NATION | = lv_ev_nation | |
ADDRESS_PRINTFORM | = lv_address_printform | |
ADDRESS_SHORT_FORM | = lv_address_short_form | |
ADDRESS_SHORT_FORM_S | = lv_address_short_form_s | |
ADDRESS_DATA_CARRIER | = lv_address_data_carrier | |
ADDRESS_DATA_CARRIER_0 | = lv_address_data_carrier_0 | |
NUMBER_OF_USED_LINES | = lv_number_of_used_lines | |
NAME_IS_EMPTY | = lv_name_is_empty | |
ADDRESS_NOT_FOUND | = lv_address_not_found | |
. " ADDRESS_INTO_PRINTFORM |
ABAP code using 7.40 inline data declarations to call FM ADDRESS_INTO_PRINTFORM
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single SEND_CNTRY FROM SZAD_FIELD INTO @DATA(ld_sender_country). | ||||
DATA(ld_sender_country) | = ' '. | |||
"SELECT single SPRAS FROM T002 INTO @DATA(ld_receiver_language). | ||||
DATA(ld_receiver_language) | = ' '. | |||
"SELECT single ADDR_SHORT FROM SZAD_FIELD INTO @DATA(ld_address_short_form_wo_name). | ||||
"SELECT single NATION FROM ADRC INTO @DATA(ld_ev_nation). | ||||
"SELECT single ANZZL FROM ADRS INTO @DATA(ld_number_of_lines). | ||||
DATA(ld_number_of_lines) | = 10. | |||
"SELECT single STREETPRIO FROM SZAD_FIELD INTO @DATA(ld_street_has_priority). | ||||
DATA(ld_street_has_priority) | = ' '. | |||
"SELECT single PRIORITY FROM SZAD_FIELD INTO @DATA(ld_line_priority). | ||||
DATA(ld_line_priority) | = ' '. | |||
"SELECT single FLAG FROM SZAD_FIELD INTO @DATA(ld_country_name_in_receiver_langu). | ||||
DATA(ld_country_name_in_receiver_langu) | = ' '. | |||
"SELECT single SPRAS FROM T002 INTO @DATA(ld_language_for_country_name). | ||||
DATA(ld_language_for_country_name) | = ' '. | |||
"SELECT single FLAG FROM SZAD_FIELD INTO @DATA(ld_no_upper_case_for_city). | ||||
DATA(ld_no_upper_case_for_city) | = ' '. | |||
"SELECT single NATION FROM ADRC INTO @DATA(ld_iv_nation). | ||||
DATA(ld_iv_nation) | = ' '. | |||
DATA(ld_iv_nation_space) | = ' '. | |||
DATA(ld_iv_person_above_organization) | = ' '. | |||
DATA(ld_is_bupa_time_dependency) | = ' '. | |||
DATA(ld_iv_country_name_separate_line) | = ' '. | |||
"SELECT single SPRAS FROM T002 INTO @DATA(ld_iv_langu_crea). | ||||
DATA(ld_iv_langu_crea) | = ' '. | |||
DATA(ld_iv_display_country_in_shrtform) | = ' '. | |||
"SELECT single ADDR_SHORT FROM SZAD_FIELD INTO @DATA(ld_address_short_form). | ||||
"SELECT single ADDR_SHORT FROM SZAD_FIELD INTO @DATA(ld_address_short_form_s). | ||||
"SELECT single ADDR_TYPE FROM SZAD_FIELD INTO @DATA(ld_address_type). | ||||
DATA(ld_address_type) | = ' '. | |||
"SELECT single ADDR_DC FROM SZAD_FIELD INTO @DATA(ld_address_data_carrier). | ||||
"SELECT single ADDRNUMBER FROM ADRC INTO @DATA(ld_address_number). | ||||
DATA(ld_address_number) | = ' '. | |||
"SELECT single ADDR_DC FROM SZAD_FIELD INTO @DATA(ld_address_data_carrier_0). | ||||
"SELECT single HANDLE FROM SZAD_FIELD INTO @DATA(ld_address_handle). | ||||
DATA(ld_address_handle) | = ' '. | |||
"SELECT single ANZZL FROM ADRS INTO @DATA(ld_number_of_used_lines). | ||||
"SELECT single FLAG FROM SZAD_FIELD INTO @DATA(ld_name_is_empty). | ||||
"SELECT single PERSNUMBER FROM ADRP INTO @DATA(ld_person_number). | ||||
DATA(ld_person_number) | = ' '. | |||
"SELECT single HANDLE FROM SZAD_FIELD INTO @DATA(ld_person_handle). | ||||
DATA(ld_person_handle) | = ' '. | |||
"SELECT single FLAG FROM SZAD_FIELD INTO @DATA(ld_address_not_found). | ||||
Search for further information about these or an SAP related objects