I can't decode an XML provided in base64 format, the string variable (lv_string) shows something unreadable.
Example:
Ü-ÅïÎ#è-´ï®¹ïn÷ëÞ#èMÃÛmõØMôÛm´ë##ë~#ë#½èN»Ü=¶ãÞwà]#ßÍüß#ýØ=õÛm´ï~øë^#ë#µè.#èN¹Ü=¶ïÞ¹ï
Here is the code:
Data: lt_content Type standard table of x255,
lv_xstring Type xstring,
lv_string Type string,
encod Type Abap_encoding Value 4110.
Select Single xml_dte into @Data(xml_b64)
From zmmvf_edocdet
Where numinterno = '0000000012'.
IF Sy-subrc Eq 0.
Call function 'SCMS_BASE64_DECODE_STR'
Exporting
Input = xml_b64
Importing
Output = lv_xstring
Exceptions
Failed = 1
Others = 2.
If Sy-subrc Eq 0.
Data(lv_len) = xstrlen( lv_xstring ).
Call function 'SCMS_XSTRING_TO_BINARY'
Exporting
buffer = lv_xstring
Importing
output_length = lv_len
Tables
binary_tab = lt_content[].
Call function 'SCMS_BINARY_TO_STRING'
Exporting
input_length = lv_len
* encoding = encod
Importing
text_buffer = lv_string
Tables
binary_tab = lt_content[]
Exceptions
failed = 1
Others = 2.
ENDIF.
ENDIF.
xml_b64to a fixed text encoded in UTF-8 then in base64, and your code successfully decodes it. So the base64 from your database does not hold a UTF-8 text. Maybe it already contains junk bytes. Please post the 100 first characters of your base64 here if you wan't us to tell you (no more an ABAP question though).