SAP PM_COPY_ADDRESS Function Module for PM: Copy an Address (Table ADRC, Temporary Module)
PM_COPY_ADDRESS is a standard pm copy address SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for PM: Copy an Address (Table ADRC, Temporary Module) 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 pm copy address FM, simply by entering the name PM_COPY_ADDRESS into the relevant SAP transaction such as SE37 or SE38.
Function Group: ILCP
Program Name: SAPLILCP
Main Program: SAPLILCP
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function PM_COPY_ADDRESS 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 'PM_COPY_ADDRESS'"PM: Copy an Address (Table ADRC, Temporary Module).
EXPORTING
* SOURCE_ADDR_NUMBER = ' ' "
* SOURCE_ADDR_HANDLE = ' ' "
TARGET_ADDR_HANDLE = "
* TARGET_ADDRESS_GROUP = 'PM01' "
IMPORTING
IND_SUCCESS = "
EXCEPTIONS
PARAMETER_ERROR = 1 ADDRESS_NOT_EXIST = 2 TARGET_HANDLE_EXIST = 3 INTERNAL_ERROR = 4
IMPORTING Parameters details for PM_COPY_ADDRESS
SOURCE_ADDR_NUMBER -
Data type: ADRC-ADDRNUMBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SOURCE_ADDR_HANDLE -
Data type: SZAD_FIELD-HANDLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TARGET_ADDR_HANDLE -
Data type: SZAD_FIELD-HANDLEOptional: No
Call by Reference: No ( called with pass by value option)
TARGET_ADDRESS_GROUP -
Data type: ADRG-ADDR_GROUPDefault: 'PM01'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for PM_COPY_ADDRESS
IND_SUCCESS -
Data type: IREF-IINDOptional: No
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 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TARGET_HANDLE_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 PM_COPY_ADDRESS 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_ind_success | TYPE IREF-IIND, " | |||
| lv_parameter_error | TYPE IREF, " | |||
| lv_source_addr_number | TYPE ADRC-ADDRNUMBER, " SPACE | |||
| lv_address_not_exist | TYPE ADRC, " | |||
| lv_source_addr_handle | TYPE SZAD_FIELD-HANDLE, " SPACE | |||
| lv_target_addr_handle | TYPE SZAD_FIELD-HANDLE, " | |||
| lv_target_handle_exist | TYPE SZAD_FIELD, " | |||
| lv_internal_error | TYPE SZAD_FIELD, " | |||
| lv_target_address_group | TYPE ADRG-ADDR_GROUP. " 'PM01' |
|   CALL FUNCTION 'PM_COPY_ADDRESS' "PM: Copy an Address (Table ADRC, Temporary Module) |
| EXPORTING | ||
| SOURCE_ADDR_NUMBER | = lv_source_addr_number | |
| SOURCE_ADDR_HANDLE | = lv_source_addr_handle | |
| TARGET_ADDR_HANDLE | = lv_target_addr_handle | |
| TARGET_ADDRESS_GROUP | = lv_target_address_group | |
| IMPORTING | ||
| IND_SUCCESS | = lv_ind_success | |
| EXCEPTIONS | ||
| PARAMETER_ERROR = 1 | ||
| ADDRESS_NOT_EXIST = 2 | ||
| TARGET_HANDLE_EXIST = 3 | ||
| INTERNAL_ERROR = 4 | ||
| . " PM_COPY_ADDRESS | ||
ABAP code using 7.40 inline data declarations to call FM PM_COPY_ADDRESS
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 IIND FROM IREF INTO @DATA(ld_ind_success). | ||||
| "SELECT single ADDRNUMBER FROM ADRC INTO @DATA(ld_source_addr_number). | ||||
| DATA(ld_source_addr_number) | = ' '. | |||
| "SELECT single HANDLE FROM SZAD_FIELD INTO @DATA(ld_source_addr_handle). | ||||
| DATA(ld_source_addr_handle) | = ' '. | |||
| "SELECT single HANDLE FROM SZAD_FIELD INTO @DATA(ld_target_addr_handle). | ||||
| "SELECT single ADDR_GROUP FROM ADRG INTO @DATA(ld_target_address_group). | ||||
| DATA(ld_target_address_group) | = 'PM01'. | |||
Search for further information about these or an SAP related objects