{"id":86,"date":"2023-11-22T04:29:20","date_gmt":"2023-11-22T04:29:20","guid":{"rendered":"https:\/\/sapabap.dwimansolution.com\/?p=86"},"modified":"2023-11-22T04:29:20","modified_gmt":"2023-11-22T04:29:20","slug":"sap-abap-string-encode-decode-base64","status":"publish","type":"post","link":"https:\/\/sapabap.dwimansolution.com\/index.php\/2023\/11\/22\/sap-abap-string-encode-decode-base64\/","title":{"rendered":"SAP ABAP &#8211; String Encode &#038; Decode BASE64"},"content":{"rendered":"\n<p class=\"has-large-font-size\">Encode String<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DATA: lv_xstring TYPE xstring.\n\n  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'\n    EXPORTING\n      text   = input_string\n    IMPORTING\n      buffer = lv_xstring\n    EXCEPTIONS\n      failed = 1\n      OTHERS = 2.\n\n  CALL FUNCTION 'SCMS_BASE64_ENCODE_STR'\n    EXPORTING\n      input  = lv_xstring\n    IMPORTING\n      output = output_encoded_string.<\/code><\/pre>\n\n\n\n<p class=\"has-large-font-size\">Decode String<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  DATA: lv_xstring TYPE xstring,\r\n        lv_len     TYPE i,\r\n        lt_bin     TYPE solix_tab.\r\n\r\n  CALL FUNCTION 'SCMS_BASE64_DECODE_STR'\r\n    EXPORTING\r\n      input  = input_encoded_string\r\n    IMPORTING\r\n      output = lv_xstring\r\n    EXCEPTIONS\r\n      failed = 1\r\n      OTHERS = 2.\r\n\r\n  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'\r\n    EXPORTING\r\n      buffer        = lv_xstring\r\n    IMPORTING\r\n      output_length = lv_len\r\n    TABLES\r\n      binary_tab    = lt_bin.\r\n\r\n  CALL FUNCTION 'SCMS_BINARY_TO_STRING'\r\n    EXPORTING\r\n      input_length = lv_len\r\n    IMPORTING\r\n      text_buffer  = output_decoded_string\r\n    TABLES\r\n      binary_tab   = lt_bin\r\n    EXCEPTIONS\r\n      failed       = 1\r\n      OTHERS       = 2.\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Encode String Decode String<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts\/86"}],"collection":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":1,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":87,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/posts\/86\/revisions\/87"}],"wp:attachment":[{"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sapabap.dwimansolution.com\/index.php\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}