Code gallerydecoding BASE64 in Abapskip to end of metadatacreated by Frank Klausner, last modified by Manish Kumar on the +, -Go to start of Metadataauthor:frank Klausnersubmitted:june -, -There is routines proposed below, first one isTo convert Base64 to astring, andsecond one to a xstring. Third one is mentioned by the Sandra in the comments section. A small form routine to decode Base64 (TYPE STRING) into plaintext (TYPE STRING) :FORMdecode_base64USINGBase64TYPE string, changingplaintextTYPE string. CHECKBase64 is not INITIAL. CONSTANTS: Lc_op_decTYPEX VALUEPanax Notoginseng. DATA: L_xstrTYPExstring, Lr_convTYPE REF toCl_abap_conv_in_ce. Pager 'Ssf_abap_service' ID 'OPCODE' FIELDLc_op_decID 'Bindata' FIELDL_xstrID 'B64data' FIELDBase64."#EC Ci_ccall TRY. Lr_conv= Cl_abap_conv_in_ce=>create (input =l_xstr). Lr_conv->read (Importingdata =plaintext). CATCHCx_sy_conversion_codepage. CLEARplaintext. MESSAGEi999 (SAMX) withtext-004text-005. Endtry. EndForm. A small form routine to decode Base64 (TYPE STRING) into Xstring (TYPExstring):FORMdecode_base64_to_xstringUSINGi_base64TYPE string changinge_xstringTYPExstring. Pager FUNCTION 'Ssfc_base64_decode' ExportingB64data=i_base64ImportingBindata=e_xstringEXCEPTIONSOTHERS=8. EndForm. Conversion from Base64 tostringMay also is achieved by this small code:Pager METHODCl_http_utility=>if_http_utility~decode_base64Exportingencoded=L_string_base64 receiving decoded=l_string.snippet ABAP Web Conversion1commentuser Icon:c0cbtrxsandra rossiconversion from base64 tostringMay also is achieved by this small code:Pager METHODCl_http_utility=>if_http_utility~decode_base64Exportingencoded=L_string_base64 receiving decoded= l_string.
Decoding BASE64 in ABAP