SAP Function Modules

ADDR_PERSONAL_GET SAP Function module







ADDR_PERSONAL_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_PERSONAL_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_PERSONAL_GET - ADDR PERSONAL GET





CALL FUNCTION 'ADDR_PERSONAL_GET' "
  EXPORTING
    address_personal_selection =   " addr2_sel
*   read_texts = SPACE          " szad_field-flag
*   iv_current_comm_data = SPACE  " ad_comcurr
  IMPORTING
    address_personal_value =    " addr2_val
    address_personal_info =     " ad2_flags
    returncode =                " szad_field-returncode  Return code: ' '(ok), 'I'nfo, 'W'arning, 'E'rror
    address_personal_text =     " addr2_text    Text for key fields (language = SY-LANGU)
* TABLES
*   person_groups =             " adpgroups
*   error_table =               " addr_error    Table with errors, warnings, information
*   versions =                  " addr_vers     Table with international versions
  EXCEPTIONS
    PARAMETER_ERROR = 1         "               Incorrect parameter values
    ADDRESS_NOT_EXIST = 2       "               Address does not exist
    PERSON_NOT_EXIST = 3        "
    VERSION_NOT_EXIST = 4       "               International version of the address does not exist
    INTERNAL_ERROR = 5          "               Serious internal error (MESSAGE A...)
    .  "  ADDR_PERSONAL_GET

ABAP code example for Function Module ADDR_PERSONAL_GET





The ABAP code below is a full code listing to execute function module ADDR_PERSONAL_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_address_personal_value  TYPE ADDR2_VAL ,
ld_address_personal_info  TYPE AD2_FLAGS ,
ld_returncode  TYPE SZAD_FIELD-RETURNCODE ,
ld_address_personal_text  TYPE ADDR2_TEXT ,
it_person_groups  TYPE STANDARD TABLE OF ADPGROUPS,"TABLES PARAM
wa_person_groups  LIKE LINE OF it_person_groups ,
it_error_table  TYPE STANDARD TABLE OF ADDR_ERROR,"TABLES PARAM
wa_error_table  LIKE LINE OF it_error_table ,
it_versions  TYPE STANDARD TABLE OF ADDR_VERS,"TABLES PARAM
wa_versions  LIKE LINE OF it_versions .

DATA(ld_address_personal_selection) = 'Check type of data required'.

DATA(ld_read_texts) = some text here
DATA(ld_iv_current_comm_data) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_person_groups to it_person_groups.

"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_versions to it_versions. . CALL FUNCTION 'ADDR_PERSONAL_GET' EXPORTING address_personal_selection = ld_address_personal_selection * read_texts = ld_read_texts * iv_current_comm_data = ld_iv_current_comm_data IMPORTING address_personal_value = ld_address_personal_value address_personal_info = ld_address_personal_info returncode = ld_returncode address_personal_text = ld_address_personal_text * TABLES * person_groups = it_person_groups * error_table = it_error_table * versions = it_versions EXCEPTIONS PARAMETER_ERROR = 1 ADDRESS_NOT_EXIST = 2 PERSON_NOT_EXIST = 3 VERSION_NOT_EXIST = 4 INTERNAL_ERROR = 5 . " ADDR_PERSONAL_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 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_address_personal_value  TYPE ADDR2_VAL ,
ld_address_personal_selection  TYPE ADDR2_SEL ,
it_person_groups  TYPE STANDARD TABLE OF ADPGROUPS ,
wa_person_groups  LIKE LINE OF it_person_groups,
ld_address_personal_info  TYPE AD2_FLAGS ,
ld_read_texts  TYPE SZAD_FIELD-FLAG ,
it_error_table  TYPE STANDARD TABLE OF ADDR_ERROR ,
wa_error_table  LIKE LINE OF it_error_table,
ld_returncode  TYPE SZAD_FIELD-RETURNCODE ,
ld_iv_current_comm_data  TYPE AD_COMCURR ,
it_versions  TYPE STANDARD TABLE OF ADDR_VERS ,
wa_versions  LIKE LINE OF it_versions,
ld_address_personal_text  TYPE ADDR2_TEXT .

ld_address_personal_selection = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_person_groups to it_person_groups.

ld_read_texts = some text here

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

"populate fields of struture and append to itab
append wa_versions to it_versions.

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