SAP SCP_TRANSLATE_CHARS_46 Function Module for
SCP_TRANSLATE_CHARS_46 is a standard scp translate chars 46 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 scp translate chars 46 FM, simply by entering the name SCP_TRANSLATE_CHARS_46 into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCPC
Program Name: SAPLSCPC
Main Program: SAPLSCPC
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SCP_TRANSLATE_CHARS_46 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 'SCP_TRANSLATE_CHARS_46'".
EXPORTING
INBUFF = "Input text
* MISS = '.' "Handling of unconvertible bytes
* BROKEN = '.' "Handling of half character at end (codepage converter)
* FILL = '.' "Handling of unused buffer space (codepage converter)
* FILTER = ' ' "Request subfunction: Codepage converter to filter
* USE_F1 = ' ' "Request subfunction: Use F1 memory
* CTRLCODE = '.' "How codepage converter converts control codes
* INBUFFLG = 0 "
* INCODE = '0000' "
* OUTBUFFLG = 0 "
* OUTCODE = '0000' "Intermediate character set with replacements
* SUBSTC_HASH = ' ' "
* SUBSTC_DOT = ' ' "
* SUBSTC_' ' = ' ' "
* SUBSTC = '00035' "
IMPORTING
INUSED = "
OUTBUFF = "Output Text
OUTOVERFLOW = "'X':Output text incomplete, ' ':otherwise
OUTUSED = "Output text length
SUBSTED = "Number of Replaced Characters
INPUT_ENDS_IN_CHAR = "
ERRMSG = "
EXCEPTIONS
INVALID_CODEPAGE = 1 INTERNAL_ERROR = 2 CANNOT_CONVERT = 3 FIELDS_BAD_TYPE = 4
IMPORTING Parameters details for SCP_TRANSLATE_CHARS_46
INBUFF - Input text
Data type:Optional: No
Call by Reference: Yes
MISS - Handling of unconvertible bytes
Data type: RSCPTYPE-MISSDefault: '.'
Optional: Yes
Call by Reference: No ( called with pass by value option)
BROKEN - Handling of half character at end (codepage converter)
Data type: RSCPTYPE-BROKENDefault: '.'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FILL - Handling of unused buffer space (codepage converter)
Data type: RSCPTYPE-FILLDefault: '.'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FILTER - Request subfunction: Codepage converter to filter
Data type: RSCPTYPE-FILTERDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
USE_F1 - Request subfunction: Use F1 memory
Data type: RSCPTYPE-USE_F1Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
CTRLCODE - How codepage converter converts control codes
Data type: RSCPTYPE-CTRLCODEDefault: '.'
Optional: Yes
Call by Reference: No ( called with pass by value option)
INBUFFLG -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
INCODE -
Data type: TCP00-CPCODEPAGEDefault: '0000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
OUTBUFFLG -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
OUTCODE - Intermediate character set with replacements
Data type: TCP00-CPCODEPAGEDefault: '0000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBSTC_HASH -
Data type: RSTSTYPE-SEL_OKDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBSTC_DOT -
Data type: RSTSTYPE-SEL_OKDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBSTC_SPACE -
Data type: RSTSTYPE-SEL_OKDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBSTC -
Data type: TCP01-CPCHARNODefault: '00035'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SCP_TRANSLATE_CHARS_46
INUSED -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
OUTBUFF - Output Text
Data type:Optional: No
Call by Reference: Yes
OUTOVERFLOW - 'X':Output text incomplete, ' ':otherwise
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
OUTUSED - Output text length
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
SUBSTED - Number of Replaced Characters
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
INPUT_ENDS_IN_CHAR -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
ERRMSG -
Data type: COptional: No
Call by Reference: Yes
EXCEPTIONS details
INVALID_CODEPAGE - Unknown character set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Internal Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CANNOT_CONVERT - There was no replacement for a char. in INTEXT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FIELDS_BAD_TYPE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SCP_TRANSLATE_CHARS_46 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_inbuff | TYPE STRING, " | |||
| lv_inused | TYPE I, " | |||
| lv_invalid_codepage | TYPE I, " | |||
| lv_miss | TYPE RSCPTYPE-MISS, " ',' | |||
| lv_broken | TYPE RSCPTYPE-BROKEN, " ',' | |||
| lv_fill | TYPE RSCPTYPE-FILL, " ',' | |||
| lv_filter | TYPE RSCPTYPE-FILTER, " ' ' | |||
| lv_use_f1 | TYPE RSCPTYPE-USE_F1, " ' ' | |||
| lv_ctrlcode | TYPE RSCPTYPE-CTRLCODE, " ',' | |||
| lv_outbuff | TYPE RSCPTYPE, " | |||
| lv_inbufflg | TYPE I, " 0 | |||
| lv_internal_error | TYPE I, " | |||
| lv_incode | TYPE TCP00-CPCODEPAGE, " '0000' | |||
| lv_outoverflow | TYPE C, " | |||
| lv_cannot_convert | TYPE C, " | |||
| lv_outused | TYPE I, " | |||
| lv_outbufflg | TYPE I, " 0 | |||
| lv_fields_bad_type | TYPE I, " | |||
| lv_outcode | TYPE TCP00-CPCODEPAGE, " '0000' | |||
| lv_substed | TYPE I, " | |||
| lv_substc_hash | TYPE RSTSTYPE-SEL_OK, " ' ' | |||
| lv_input_ends_in_char | TYPE C, " | |||
| lv_errmsg | TYPE C, " | |||
| lv_substc_dot | TYPE RSTSTYPE-SEL_OK, " ' ' | |||
| lv_substc_space | TYPE RSTSTYPE-SEL_OK, " ' ' | |||
| lv_substc | TYPE TCP01-CPCHARNO. " '00035' |
|   CALL FUNCTION 'SCP_TRANSLATE_CHARS_46' " |
| EXPORTING | ||
| INBUFF | = lv_inbuff | |
| MISS | = lv_miss | |
| BROKEN | = lv_broken | |
| FILL | = lv_fill | |
| FILTER | = lv_filter | |
| USE_F1 | = lv_use_f1 | |
| CTRLCODE | = lv_ctrlcode | |
| INBUFFLG | = lv_inbufflg | |
| INCODE | = lv_incode | |
| OUTBUFFLG | = lv_outbufflg | |
| OUTCODE | = lv_outcode | |
| SUBSTC_HASH | = lv_substc_hash | |
| SUBSTC_DOT | = lv_substc_dot | |
| SUBSTC_SPACE | = lv_substc_space | |
| SUBSTC | = lv_substc | |
| IMPORTING | ||
| INUSED | = lv_inused | |
| OUTBUFF | = lv_outbuff | |
| OUTOVERFLOW | = lv_outoverflow | |
| OUTUSED | = lv_outused | |
| SUBSTED | = lv_substed | |
| INPUT_ENDS_IN_CHAR | = lv_input_ends_in_char | |
| ERRMSG | = lv_errmsg | |
| EXCEPTIONS | ||
| INVALID_CODEPAGE = 1 | ||
| INTERNAL_ERROR = 2 | ||
| CANNOT_CONVERT = 3 | ||
| FIELDS_BAD_TYPE = 4 | ||
| . " SCP_TRANSLATE_CHARS_46 | ||
ABAP code using 7.40 inline data declarations to call FM SCP_TRANSLATE_CHARS_46
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 MISS FROM RSCPTYPE INTO @DATA(ld_miss). | ||||
| DATA(ld_miss) | = '.'. | |||
| "SELECT single BROKEN FROM RSCPTYPE INTO @DATA(ld_broken). | ||||
| DATA(ld_broken) | = '.'. | |||
| "SELECT single FILL FROM RSCPTYPE INTO @DATA(ld_fill). | ||||
| DATA(ld_fill) | = '.'. | |||
| "SELECT single FILTER FROM RSCPTYPE INTO @DATA(ld_filter). | ||||
| DATA(ld_filter) | = ' '. | |||
| "SELECT single USE_F1 FROM RSCPTYPE INTO @DATA(ld_use_f1). | ||||
| DATA(ld_use_f1) | = ' '. | |||
| "SELECT single CTRLCODE FROM RSCPTYPE INTO @DATA(ld_ctrlcode). | ||||
| DATA(ld_ctrlcode) | = '.'. | |||
| "SELECT single CPCODEPAGE FROM TCP00 INTO @DATA(ld_incode). | ||||
| DATA(ld_incode) | = '0000'. | |||
| "SELECT single CPCODEPAGE FROM TCP00 INTO @DATA(ld_outcode). | ||||
| DATA(ld_outcode) | = '0000'. | |||
| "SELECT single SEL_OK FROM RSTSTYPE INTO @DATA(ld_substc_hash). | ||||
| DATA(ld_substc_hash) | = ' '. | |||
| "SELECT single SEL_OK FROM RSTSTYPE INTO @DATA(ld_substc_dot). | ||||
| DATA(ld_substc_dot) | = ' '. | |||
| "SELECT single SEL_OK FROM RSTSTYPE INTO @DATA(ld_substc_space). | ||||
| DATA(ld_substc_space) | = ' '. | |||
| "SELECT single CPCHARNO FROM TCP01 INTO @DATA(ld_substc). | ||||
| DATA(ld_substc) | = '00035'. | |||
Search for further information about these or an SAP related objects