SAP ABAP String Conversion

Function modules to convert data (usually files content) between various formats (String, Xstring, Text, Binary, Base64) in abap.

From/To Binary String XString Text Ftext
Binary N/A SCMS_BINARY_TO_STRING SCMS_BINARY_TO_XSTRING SCMS_BINARY_TO_TEXT SCMS_BINARY_TO_FTEXT
String TPM_THX_APPL_STRING_
TO_BINARY
N/A SCMS_STRING_TO_XSTRING TPM_THX_APPL_STRING_
TO_BINARY
SCMS_BINARY_TO_TEXT
SCMS_STRING_TO_FTEXT
Xstring SCMS_XSTRING_TO_BINARY SCMS_XSTRING_TO_BINARY
SCMS_BINARY_TO_STRING
N/A SCMS_XSTRING_TO_BINARY
SCMS_BINARY_TO_TEXT
SCMS_XSTRING_BINARY
SCMS_BINARY_FTEXT
Text SCMS_TEXT_TO_BINARY SCMS_TEXT_TO_XSTRING N/A SCMS_TEXT_TO_FTEXT
Ftext SCMS_FTEXT_TO_BINARY SCMS_FTEXT_TO_STRING SCMS_FTEXT_TO_XSTRING SCMS_FTEXT_TO_TEXT N/A

Base64 Encoding

In certain applications, like inline embedding images in html/xml, files need to be encoded in Base64. Below function modules are used to convert to and from Base64.

Format Function Module
Xstring to Base64 SCMS_BASE64_DECODE_STR
Base64 to Xstring SCMS_BASE64_DECODE_STR

One Reply to “SAP ABAP String Conversion

Leave a Reply