SAP CPE_MAP_FIELD_SINGLE Function Module for CPE - Map single Document Field
CPE_MAP_FIELD_SINGLE is a standard cpe map field single SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for CPE - Map single Document Field 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 cpe map field single FM, simply by entering the name CPE_MAP_FIELD_SINGLE into the relevant SAP transaction such as SE37 or SE38.
Function Group: CPE_MAPPING
Program Name: SAPLCPE_MAPPING
Main Program: SAPLCPE_MAPPING
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CPE_MAP_FIELD_SINGLE 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 'CPE_MAP_FIELD_SINGLE'"CPE - Map single Document Field.
EXPORTING
IV_SOURCE_VALUE = "
IS_SOURCE_MAPPING = "CPE Caller - Table Type for Mapping of Business Data
IV_SOURCE_LOGSYS = "Logical system
IV_SOURCE_LENGTH = "Integer 1
IV_SOURCE_TYPE = "Data Type in ABAP Dictionary
* IT_NAMEVALUEPAIRS_10 = "CPE Caller - Table Type for Name Value Pairs (L=10)
* IT_NAMEVALUEPAIRS_50 = "CPE Caller - Table Type for Name Value Pairs (L=50)
* IT_NAMEVALUEPAIRS_255 = "CPE Caller - Table Type for Name Value Pairs (L=255)
IMPORTING
ET_NAMEVALUEPAIRS_10 = "CPE Caller - Table Type for Name Value Pairs (L=10)
ET_NAMEVALUEPAIRS_50 = "CPE Caller - Table Type for Name Value Pairs (L=50)
ET_NAMEVALUEPAIRS_255 = "CPE Caller - Table Type for Name Value Pairs (L=255)
EXCEPTIONS
CONVERSION_ERROR = 1
IMPORTING Parameters details for CPE_MAP_FIELD_SINGLE
IV_SOURCE_VALUE -
Data type: ANYOptional: No
Call by Reference: Yes
IS_SOURCE_MAPPING - CPE Caller - Table Type for Mapping of Business Data
Data type: CPEC_MAPPINGOptional: No
Call by Reference: Yes
IV_SOURCE_LOGSYS - Logical system
Data type: LOGSYSOptional: No
Call by Reference: Yes
IV_SOURCE_LENGTH - Integer 1
Data type: INTEGER1Optional: No
Call by Reference: Yes
IV_SOURCE_TYPE - Data Type in ABAP Dictionary
Data type: DATATYPE_DOptional: No
Call by Reference: Yes
IT_NAMEVALUEPAIRS_10 - CPE Caller - Table Type for Name Value Pairs (L=10)
Data type: CPET_NAMEVALUEPAIRS_10_TABOptional: Yes
Call by Reference: Yes
IT_NAMEVALUEPAIRS_50 - CPE Caller - Table Type for Name Value Pairs (L=50)
Data type: CPET_NAMEVALUEPAIRS_50_TABOptional: Yes
Call by Reference: Yes
IT_NAMEVALUEPAIRS_255 - CPE Caller - Table Type for Name Value Pairs (L=255)
Data type: CPET_NAMEVALUEPAIRS_255_TABOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for CPE_MAP_FIELD_SINGLE
ET_NAMEVALUEPAIRS_10 - CPE Caller - Table Type for Name Value Pairs (L=10)
Data type: CPET_NAMEVALUEPAIRS_10_TABOptional: No
Call by Reference: Yes
ET_NAMEVALUEPAIRS_50 - CPE Caller - Table Type for Name Value Pairs (L=50)
Data type: CPET_NAMEVALUEPAIRS_50_TABOptional: No
Call by Reference: Yes
ET_NAMEVALUEPAIRS_255 - CPE Caller - Table Type for Name Value Pairs (L=255)
Data type: CPET_NAMEVALUEPAIRS_255_TABOptional: No
Call by Reference: Yes
EXCEPTIONS details
CONVERSION_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CPE_MAP_FIELD_SINGLE 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_iv_source_value | TYPE ANY, " | |||
| lv_conversion_error | TYPE ANY, " | |||
| lv_et_namevaluepairs_10 | TYPE CPET_NAMEVALUEPAIRS_10_TAB, " | |||
| lv_is_source_mapping | TYPE CPEC_MAPPING, " | |||
| lv_et_namevaluepairs_50 | TYPE CPET_NAMEVALUEPAIRS_50_TAB, " | |||
| lv_iv_source_logsys | TYPE LOGSYS, " | |||
| lv_et_namevaluepairs_255 | TYPE CPET_NAMEVALUEPAIRS_255_TAB, " | |||
| lv_iv_source_length | TYPE INTEGER1, " | |||
| lv_iv_source_type | TYPE DATATYPE_D, " | |||
| lv_it_namevaluepairs_10 | TYPE CPET_NAMEVALUEPAIRS_10_TAB, " | |||
| lv_it_namevaluepairs_50 | TYPE CPET_NAMEVALUEPAIRS_50_TAB, " | |||
| lv_it_namevaluepairs_255 | TYPE CPET_NAMEVALUEPAIRS_255_TAB. " |
|   CALL FUNCTION 'CPE_MAP_FIELD_SINGLE' "CPE - Map single Document Field |
| EXPORTING | ||
| IV_SOURCE_VALUE | = lv_iv_source_value | |
| IS_SOURCE_MAPPING | = lv_is_source_mapping | |
| IV_SOURCE_LOGSYS | = lv_iv_source_logsys | |
| IV_SOURCE_LENGTH | = lv_iv_source_length | |
| IV_SOURCE_TYPE | = lv_iv_source_type | |
| IT_NAMEVALUEPAIRS_10 | = lv_it_namevaluepairs_10 | |
| IT_NAMEVALUEPAIRS_50 | = lv_it_namevaluepairs_50 | |
| IT_NAMEVALUEPAIRS_255 | = lv_it_namevaluepairs_255 | |
| IMPORTING | ||
| ET_NAMEVALUEPAIRS_10 | = lv_et_namevaluepairs_10 | |
| ET_NAMEVALUEPAIRS_50 | = lv_et_namevaluepairs_50 | |
| ET_NAMEVALUEPAIRS_255 | = lv_et_namevaluepairs_255 | |
| EXCEPTIONS | ||
| CONVERSION_ERROR = 1 | ||
| . " CPE_MAP_FIELD_SINGLE | ||
ABAP code using 7.40 inline data declarations to call FM CPE_MAP_FIELD_SINGLE
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.Search for further information about these or an SAP related objects