Decoding BASE64 in ABAP

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.