ABAP Code page determines how the systeme interprets ?data and display the data.
In ABAP, you have to set the code page in order to handle the special characters. (?For exemple, in French ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? don’t exist in English keyboard.).
In this post, you will find the standard function to replace characters (the easy way ), then learn to get the Target ABAP Code Page for the country and a platform. Last thing is the standard CCC ABAP Conversion Classes.
Table of Contents
You can simply remplace this special characters with the correspondant characters
with this function module SCP_REPLACE_STRANGE_CHARS
For exemple: ? -> e .
Or you can handle the specific the ABAP code page of the connection language and the country.
Actuallay, there is a SAP table TCP0C matching the platform, the language, the country and the right code page.
It is extremely helpfull if you manage file or text in non-EN language.
This sample abap code let you calculate the right code page to use:
DATA: l_v_spras TYPE spras, l_v_codepage TYPE cpcodepage. l_v_spras = sy-langu. * Getting the Codepage value for connection Language CALL FUNCTION 'SCP_CODEPAGE_FOR_LANGUAGE' EXPORTING language = l_v_spras IMPORTING codepage = l_v_codepage EXCEPTIONS no_codepage = 1 OTHERS = 2. IF sy-subrc IS INITIAL. WRITE l_v_codepage. ENDIF.
Since 6.10, you can also use the standard CCC converter classes CL_ABAP_CONV_*.
A good sample code can be find in this link.
- CL_ABAP_CONV_IN_CE: converts bytes representing characters in a given codepage into a character or string variable
- CL_ABAP_CONV_OUT_CE: converts a character or string variable into bytes representing characters in a given codepage
- CL_ABAP_CONV_X2X_CE: converts bytes representing characters in a given codepage, into bytes representing characters in another given codepag
SAP ISU Tables for Technical master data, for Billing Master Data, Billing and invoicing Tables?…
SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd…
Dunning is the business practice of informing a customer of past due payment. Dunning letters…
SAP AP Tcodes & SAP AR Tcodes: House Banks Tcodes, Advance Payments or Down Payments,…
What are the main SAP Payment Terms Tables ? What are the related Tables in…
Work center consists of master data related to routing of products. It contains data related…