SAP ADDR_GET Function Module for Read an address without dialog









ADDR_GET is a standard addr get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read an address without dialog 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 addr get FM, simply by entering the name ADDR_GET into the relevant SAP transaction such as SE37 or SE38.

Function Group: SZA0
Program Name: SAPLSZA0
Main Program: SAPLSZA0
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ADDR_GET 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 'ADDR_GET'"Read an address without dialog
EXPORTING
ADDRESS_SELECTION = "Specification of an address (see long text)
* ADDRESS_GROUP = "Address group (see long text for special handling)
* READ_SADR_ONLY = ' ' "Read in table SADR only
* READ_TEXTS = ' ' "Flag: Read texts (ADDRESS_TEXT)
* IV_CURRENT_COMM_DATA = ' ' "Indicator: Current Status of Communication Data

IMPORTING
ADDRESS_VALUE = "Return data for an address
ADDRESS_ADDITIONAL_INFO = "Additional communication data information
RETURNCODE = "Return code: ' '(ok), 'I'nfo, 'W'arning, 'E'rror
ADDRESS_TEXT = "Text for key fields (language = SY-LANGU)
SADR = "Return the old address structure

TABLES
* ADDRESS_GROUPS = "Address groups to which the address is assigned
* ERROR_TABLE = "Table with errors, warnings, information
* VERSIONS = "Table with international versions

EXCEPTIONS
PARAMETER_ERROR = 1 ADDRESS_NOT_EXIST = 2 VERSION_NOT_EXIST = 3 INTERNAL_ERROR = 4
.



IMPORTING Parameters details for ADDR_GET

ADDRESS_SELECTION - Specification of an address (see long text)

Data type: ADDR1_SEL
Optional: No
Call by Reference: No ( called with pass by value option)

ADDRESS_GROUP - Address group (see long text for special handling)

Data type: ADRG-ADDR_GROUP
Optional: Yes
Call by Reference: No ( called with pass by value option)

READ_SADR_ONLY - Read in table SADR only

Data type: SZAD_FIELD-FLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

READ_TEXTS - Flag: Read texts (ADDRESS_TEXT)

Data type: SZAD_FIELD-FLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_CURRENT_COMM_DATA - Indicator: Current Status of Communication Data

Data type: AD_COMCURR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for ADDR_GET

ADDRESS_VALUE - Return data for an address

Data type: ADDR1_VAL
Optional: No
Call by Reference: No ( called with pass by value option)

ADDRESS_ADDITIONAL_INFO - Additional communication data information

Data type: AD1_FLAGS
Optional: No
Call by Reference: No ( called with pass by value option)

RETURNCODE - Return code: ' '(ok), 'I'nfo, 'W'arning, 'E'rror

Data type: SZAD_FIELD-RETURNCODE
Optional: No
Call by Reference: No ( called with pass by value option)

ADDRESS_TEXT - Text for key fields (language = SY-LANGU)

Data type: ADDR1_TEXT
Optional: No
Call by Reference: No ( called with pass by value option)

SADR - Return the old address structure

Data type: SADR
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for ADDR_GET

ADDRESS_GROUPS - Address groups to which the address is assigned

Data type: ADAGROUPS
Optional: Yes
Call by Reference: No ( called with pass by value option)

ERROR_TABLE - Table with errors, warnings, information

Data type: ADDR_ERROR
Optional: Yes
Call by Reference: No ( called with pass by value option)

VERSIONS - Table with international versions

Data type: ADDR_VERS
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

PARAMETER_ERROR - Incorrect parameter values

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ADDRESS_NOT_EXIST - Address does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

VERSION_NOT_EXIST - International version of the address does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INTERNAL_ERROR - Serious internal error (MESSAGE A...)

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for ADDR_GET 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_address_value  TYPE ADDR1_VAL, "   
lt_address_groups  TYPE STANDARD TABLE OF ADAGROUPS, "   
lv_parameter_error  TYPE ADAGROUPS, "   
lv_address_selection  TYPE ADDR1_SEL, "   
lt_error_table  TYPE STANDARD TABLE OF ADDR_ERROR, "   
lv_address_group  TYPE ADRG-ADDR_GROUP, "   
lv_address_not_exist  TYPE ADRG, "   
lv_address_additional_info  TYPE AD1_FLAGS, "   
lt_versions  TYPE STANDARD TABLE OF ADDR_VERS, "   
lv_returncode  TYPE SZAD_FIELD-RETURNCODE, "   
lv_read_sadr_only  TYPE SZAD_FIELD-FLAG, "   SPACE
lv_version_not_exist  TYPE SZAD_FIELD, "   
lv_read_texts  TYPE SZAD_FIELD-FLAG, "   SPACE
lv_address_text  TYPE ADDR1_TEXT, "   
lv_internal_error  TYPE ADDR1_TEXT, "   
lv_sadr  TYPE SADR, "   
lv_iv_current_comm_data  TYPE AD_COMCURR. "   SPACE

  CALL FUNCTION 'ADDR_GET'  "Read an address without dialog
    EXPORTING
         ADDRESS_SELECTION = lv_address_selection
         ADDRESS_GROUP = lv_address_group
         READ_SADR_ONLY = lv_read_sadr_only
         READ_TEXTS = lv_read_texts
         IV_CURRENT_COMM_DATA = lv_iv_current_comm_data
    IMPORTING
         ADDRESS_VALUE = lv_address_value
         ADDRESS_ADDITIONAL_INFO = lv_address_additional_info
         RETURNCODE = lv_returncode
         ADDRESS_TEXT = lv_address_text
         SADR = lv_sadr
    TABLES
         ADDRESS_GROUPS = lt_address_groups
         ERROR_TABLE = lt_error_table
         VERSIONS = lt_versions
    EXCEPTIONS
        PARAMETER_ERROR = 1
        ADDRESS_NOT_EXIST = 2
        VERSION_NOT_EXIST = 3
        INTERNAL_ERROR = 4
. " ADDR_GET




ABAP code using 7.40 inline data declarations to call FM ADDR_GET

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 ADDR_GROUP FROM ADRG INTO @DATA(ld_address_group).
 
 
 
 
"SELECT single RETURNCODE FROM SZAD_FIELD INTO @DATA(ld_returncode).
 
"SELECT single FLAG FROM SZAD_FIELD INTO @DATA(ld_read_sadr_only).
DATA(ld_read_sadr_only) = ' '.
 
 
"SELECT single FLAG FROM SZAD_FIELD INTO @DATA(ld_read_texts).
DATA(ld_read_texts) = ' '.
 
 
 
 
DATA(ld_iv_current_comm_data) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!