SAP ADDRESS_GET_DATA Function Module for









ADDRESS_GET_DATA is a standard address get data SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 get data FM, simply by entering the name ADDRESS_GET_DATA into the relevant SAP transaction such as SE37 or SE38.

Function Group: SAD2
Program Name: SAPLSAD2
Main Program: SAPLSAD2
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function ADDRESS_GET_DATA 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_GET_DATA'"
EXPORTING
ENTRY_ADRNR = "Address number
* ENTRY_KIND_OF_ADDR = ' ' "Type of address: C=companies/ P=persons
* ENTRY_P_WITH_C = 'X' "Also read company data for pers.adr. X=yes
* ENTRY_VERSION = ' ' "Version of address (national indicator)

IMPORTING
COMPANY_DATA = "Company data
PERSONAL_DATA = "Person data

EXCEPTIONS
ADDR_NOT_EXIST = 1 WRONG_DATA = 2
.



IMPORTING Parameters details for ADDRESS_GET_DATA

ENTRY_ADRNR - Address number

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

ENTRY_KIND_OF_ADDR - Type of address: C=companies/ P=persons

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

ENTRY_P_WITH_C - Also read company data for pers.adr. X=yes

Data type: SADR-FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

ENTRY_VERSION - Version of address (national indicator)

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

EXPORTING Parameters details for ADDRESS_GET_DATA

COMPANY_DATA - Company data

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

PERSONAL_DATA - Person data

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

EXCEPTIONS details

ADDR_NOT_EXIST - Address does not exist

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

WRONG_DATA - Incorrect input parameters

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

Copy and paste ABAP code example for ADDRESS_GET_DATA 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_entry_adrnr  TYPE SADR-ADRNR, "   
lv_company_data  TYPE SADR, "   
lv_addr_not_exist  TYPE SADR, "   
lv_wrong_data  TYPE SADR, "   
lv_personal_data  TYPE SADRP, "   
lv_entry_kind_of_addr  TYPE SY-INPUT, "   SPACE
lv_entry_p_with_c  TYPE SADR-FLAG, "   'X'
lv_entry_version  TYPE SADR-NATIO. "   SPACE

  CALL FUNCTION 'ADDRESS_GET_DATA'  "
    EXPORTING
         ENTRY_ADRNR = lv_entry_adrnr
         ENTRY_KIND_OF_ADDR = lv_entry_kind_of_addr
         ENTRY_P_WITH_C = lv_entry_p_with_c
         ENTRY_VERSION = lv_entry_version
    IMPORTING
         COMPANY_DATA = lv_company_data
         PERSONAL_DATA = lv_personal_data
    EXCEPTIONS
        ADDR_NOT_EXIST = 1
        WRONG_DATA = 2
. " ADDRESS_GET_DATA




ABAP code using 7.40 inline data declarations to call FM ADDRESS_GET_DATA

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 ADRNR FROM SADR INTO @DATA(ld_entry_adrnr).
 
 
 
 
 
"SELECT single INPUT FROM SY INTO @DATA(ld_entry_kind_of_addr).
DATA(ld_entry_kind_of_addr) = ' '.
 
"SELECT single FLAG FROM SADR INTO @DATA(ld_entry_p_with_c).
DATA(ld_entry_p_with_c) = 'X'.
 
"SELECT single NATIO FROM SADR INTO @DATA(ld_entry_version).
DATA(ld_entry_version) = ' '.
 


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!