SAP Function Modules

ADDR_PERS_COMP_GET_ALL SAP Function module







ADDR_PERS_COMP_GET_ALL 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_PERS_COMP_GET_ALL 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_PERS_COMP_GET_ALL - ADDR PERS COMP GET ALL





CALL FUNCTION 'ADDR_PERS_COMP_GET_ALL' "
  EXPORTING
    is_address_pers_comp_selection =   " addr3_sel
*   iv_current_comm_data = SPACE  " xfeld
  IMPORTING
    ev_returncode =             " ad_retcode
* TABLES
*   et_address_pers_comp_value =   " addr3_val
*   et_address_pers_comp_info =   " ad3_flags
*   et_error =                  " addr_error
*   et_address_pers_comp_text =   " addr3_text
  EXCEPTIONS
    PARAMETER_ERROR = 1         "
    PERSON_NOT_EXIST = 2        "
    ADDRESS_NOT_EXIST = 3       "
    VERSION_NOT_EXIST = 4       "
    INTERNAL_ERROR = 5          "
    .  "  ADDR_PERS_COMP_GET_ALL

ABAP code example for Function Module ADDR_PERS_COMP_GET_ALL





The ABAP code below is a full code listing to execute function module ADDR_PERS_COMP_GET_ALL 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_ev_returncode  TYPE AD_RETCODE ,
it_et_address_pers_comp_value  TYPE STANDARD TABLE OF ADDR3_VAL,"TABLES PARAM
wa_et_address_pers_comp_value  LIKE LINE OF it_et_address_pers_comp_value ,
it_et_address_pers_comp_info  TYPE STANDARD TABLE OF AD3_FLAGS,"TABLES PARAM
wa_et_address_pers_comp_info  LIKE LINE OF it_et_address_pers_comp_info ,
it_et_error  TYPE STANDARD TABLE OF ADDR_ERROR,"TABLES PARAM
wa_et_error  LIKE LINE OF it_et_error ,
it_et_address_pers_comp_text  TYPE STANDARD TABLE OF ADDR3_TEXT,"TABLES PARAM
wa_et_address_pers_comp_text  LIKE LINE OF it_et_address_pers_comp_text .

DATA(ld_is_address_pers_comp_selection) = 'Check type of data required'.
DATA(ld_iv_current_comm_data) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_address_pers_comp_value to it_et_address_pers_comp_value.

"populate fields of struture and append to itab
append wa_et_address_pers_comp_info to it_et_address_pers_comp_info.

"populate fields of struture and append to itab
append wa_et_error to it_et_error.

"populate fields of struture and append to itab
append wa_et_address_pers_comp_text to it_et_address_pers_comp_text. . CALL FUNCTION 'ADDR_PERS_COMP_GET_ALL' EXPORTING is_address_pers_comp_selection = ld_is_address_pers_comp_selection * iv_current_comm_data = ld_iv_current_comm_data IMPORTING ev_returncode = ld_ev_returncode * TABLES * et_address_pers_comp_value = it_et_address_pers_comp_value * et_address_pers_comp_info = it_et_address_pers_comp_info * et_error = it_et_error * et_address_pers_comp_text = it_et_address_pers_comp_text EXCEPTIONS PARAMETER_ERROR = 1 PERSON_NOT_EXIST = 2 ADDRESS_NOT_EXIST = 3 VERSION_NOT_EXIST = 4 INTERNAL_ERROR = 5 . " ADDR_PERS_COMP_GET_ALL
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 ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "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_ev_returncode  TYPE AD_RETCODE ,
ld_is_address_pers_comp_selection  TYPE ADDR3_SEL ,
it_et_address_pers_comp_value  TYPE STANDARD TABLE OF ADDR3_VAL ,
wa_et_address_pers_comp_value  LIKE LINE OF it_et_address_pers_comp_value,
ld_iv_current_comm_data  TYPE XFELD ,
it_et_address_pers_comp_info  TYPE STANDARD TABLE OF AD3_FLAGS ,
wa_et_address_pers_comp_info  LIKE LINE OF it_et_address_pers_comp_info,
it_et_error  TYPE STANDARD TABLE OF ADDR_ERROR ,
wa_et_error  LIKE LINE OF it_et_error,
it_et_address_pers_comp_text  TYPE STANDARD TABLE OF ADDR3_TEXT ,
wa_et_address_pers_comp_text  LIKE LINE OF it_et_address_pers_comp_text.

ld_is_address_pers_comp_selection = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_address_pers_comp_value to it_et_address_pers_comp_value.
ld_iv_current_comm_data = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_address_pers_comp_info to it_et_address_pers_comp_info.

"populate fields of struture and append to itab
append wa_et_error to it_et_error.

"populate fields of struture and append to itab
append wa_et_address_pers_comp_text to it_et_address_pers_comp_text.

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_PERS_COMP_GET_ALL or its description.