SAP Function Modules

ADDR_COMM_GET SAP Function module







ADDR_COMM_GET is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ADDR_COMM_GET into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SZA0
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ADDR_COMM_GET - ADDR COMM GET





CALL FUNCTION 'ADDR_COMM_GET' "
  EXPORTING
*   address_handle = SPACE      " szad_field-handle
*   address_number = SPACE      " adrc-addrnumber
*   date_from = '00010101'      " adcp-date_from
*   language = SY-LANGU         " adrt-langu
    table_type =                " szad_field-table_type
*   iv_current_state = 'X'      " xfeld
*   iv_fill_empty_country = 'X'  " xfeld
  IMPORTING
    returncode =                " szad_field-returncode
  TABLES
    comm_table =                "
*   error_table =               " addr_error
*   et_usage =                  " adsuse        Address Usages
*   et_usage_uuid =             " adsuse_uuid
  EXCEPTIONS
    PARAMETER_ERROR = 1         "
    ADDRESS_NOT_EXIST = 2       "
    INTERNAL_ERROR = 3          "
    .  "  ADDR_COMM_GET

ABAP code example for Function Module ADDR_COMM_GET





The ABAP code below is a full code listing to execute function module ADDR_COMM_GET including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_returncode  TYPE SZAD_FIELD-RETURNCODE ,
it_comm_table  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_comm_table  LIKE LINE OF it_comm_table ,
it_error_table  TYPE STANDARD TABLE OF ADDR_ERROR,"TABLES PARAM
wa_error_table  LIKE LINE OF it_error_table ,
it_et_usage  TYPE STANDARD TABLE OF ADSUSE,"TABLES PARAM
wa_et_usage  LIKE LINE OF it_et_usage ,
it_et_usage_uuid  TYPE STANDARD TABLE OF ADSUSE_UUID,"TABLES PARAM
wa_et_usage_uuid  LIKE LINE OF it_et_usage_uuid .


DATA(ld_address_handle) = some text here

SELECT single ADDRNUMBER
FROM ADRC
INTO @DATA(ld_address_number).


SELECT single DATE_FROM
FROM ADCP
INTO @DATA(ld_date_from).


SELECT single LANGU
FROM ADRT
INTO @DATA(ld_language).


DATA(ld_table_type) = some text here
DATA(ld_iv_current_state) = 'Check type of data required'.
DATA(ld_iv_fill_empty_country) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_comm_table to it_comm_table.

"populate fields of struture and append to itab
append wa_error_table to it_error_table.

"populate fields of struture and append to itab
append wa_et_usage to it_et_usage.

"populate fields of struture and append to itab
append wa_et_usage_uuid to it_et_usage_uuid. . CALL FUNCTION 'ADDR_COMM_GET' EXPORTING * address_handle = ld_address_handle * address_number = ld_address_number * date_from = ld_date_from * language = ld_language table_type = ld_table_type * iv_current_state = ld_iv_current_state * iv_fill_empty_country = ld_iv_fill_empty_country IMPORTING returncode = ld_returncode TABLES comm_table = it_comm_table * error_table = it_error_table * et_usage = it_et_usage * et_usage_uuid = it_et_usage_uuid EXCEPTIONS PARAMETER_ERROR = 1 ADDRESS_NOT_EXIST = 2 INTERNAL_ERROR = 3 . " ADDR_COMM_GET
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_returncode  TYPE SZAD_FIELD-RETURNCODE ,
ld_address_handle  TYPE SZAD_FIELD-HANDLE ,
it_comm_table  TYPE STANDARD TABLE OF STRING ,
wa_comm_table  LIKE LINE OF it_comm_table,
ld_address_number  TYPE ADRC-ADDRNUMBER ,
it_error_table  TYPE STANDARD TABLE OF ADDR_ERROR ,
wa_error_table  LIKE LINE OF it_error_table,
ld_date_from  TYPE ADCP-DATE_FROM ,
it_et_usage  TYPE STANDARD TABLE OF ADSUSE ,
wa_et_usage  LIKE LINE OF it_et_usage,
ld_language  TYPE ADRT-LANGU ,
it_et_usage_uuid  TYPE STANDARD TABLE OF ADSUSE_UUID ,
wa_et_usage_uuid  LIKE LINE OF it_et_usage_uuid,
ld_table_type  TYPE SZAD_FIELD-TABLE_TYPE ,
ld_iv_current_state  TYPE XFELD ,
ld_iv_fill_empty_country  TYPE XFELD .


ld_address_handle = some text here

"populate fields of struture and append to itab
append wa_comm_table to it_comm_table.

SELECT single ADDRNUMBER
FROM ADRC
INTO ld_address_number.


"populate fields of struture and append to itab
append wa_error_table to it_error_table.

SELECT single DATE_FROM
FROM ADCP
INTO ld_date_from.


"populate fields of struture and append to itab
append wa_et_usage to it_et_usage.

SELECT single LANGU
FROM ADRT
INTO ld_language.


"populate fields of struture and append to itab
append wa_et_usage_uuid to it_et_usage_uuid.

ld_table_type = some text here
ld_iv_current_state = 'Check type of data required'.
ld_iv_fill_empty_country = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ADDR_COMM_GET or its description.