当前位置:网站首页>【Demo】ABAP Base64加解密测试
【Demo】ABAP Base64加解密测试
2022-07-31 00:33:00 【SAP剑客】

*&---------------------------------------------------------------------*
*& Report ZTEST_BASE64
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZTEST_BASE64.
DATA: INSTR TYPE STRING,
XSTR TYPE XSTRING,
ENCODE_STR TYPE STRING,
CHARSET TYPE STRING,
MIMETYPE(128) TYPE C,
CODEPAGE(4) TYPE N,
ENCODING(20) TYPE C,
CONVIN TYPE REF TO CL_ABAP_CONV_IN_CE.
*INSTR = 'Material : 8630052669852'.
INSTR = '我的名字叫做Michael!'.
WRITE : / '------Base64之前------:',INSTR.
CONCATENATE '"text/html; charset=' CHARSET '"' INTO MIMETYPE.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = INSTR
MIMETYPE = MIMETYPE
IMPORTING
BUFFER = XSTR
EXCEPTIONS
FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION 'SCMS_BASE64_ENCODE_STR'
EXPORTING
INPUT = XSTR
IMPORTING
OUTPUT = ENCODE_STR.
WRITE : / '------Base64加密------:',ENCODE_STR.
CALL FUNCTION 'SCMS_BASE64_DECODE_STR'
EXPORTING
INPUT = ENCODE_STR
* UNESCAPE = 'X'
IMPORTING
OUTPUT = XSTR
EXCEPTIONS
FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
CHARSET = 'UTF-8'."支持中文
CALL FUNCTION 'SCP_CODEPAGE_BY_EXTERNAL_NAME'
EXPORTING
EXTERNAL_NAME = CHARSET
IMPORTING
SAP_CODEPAGE = CODEPAGE
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENCODING = CODEPAGE.
ENDIF.
CONVIN = CL_ABAP_CONV_IN_CE=>CREATE( ENCODING = ENCODING INPUT = XSTR )."创建解码对象
CALL METHOD CONVIN->READ( IMPORTING DATA = INSTR ).
WRITE : / '------Base64解密------:',INSTR.
边栏推荐
- Understand from the 11 common examples of judging equality of packaging types in the written test: packaging types, the principle of automatic boxing and unboxing, the timing of boxing and unboxing, a
- 从笔试包装类型的11个常见判断是否相等的例子理解:包装类型、自动装箱与拆箱的原理、装箱拆箱的发生时机、包装类型的常量池技术
- Summary of MySQL database interview questions (2022 latest version)
- 【Multithreading】
- DNS解析过程【访问网站】
- 网络常用的状态码
- 【深入浅出玩转FPGA学习15----------时序分析基础】
- In-depth understanding of the auto-increment operator from two error-prone written test questions
- Linux 部署mysql 5.7全程跟踪 完整步骤 django部署
- joiplay模拟器不支持此游戏类型怎么解决
猜你喜欢

Asser uses ant sword to log in
![[In-depth and easy-to-follow FPGA learning 14----------Test case design 2]](/img/c0/1130111c90b1bc175b088894c1c18f.png)
[In-depth and easy-to-follow FPGA learning 14----------Test case design 2]

How to Repair Word File Corruption

How to install joiplay emulator rtp

MySQL数据库(基础)

Homework: iptables prevent nmap scan and binlog
![[In-depth and easy-to-follow FPGA learning 15---------- Timing analysis basics]](/img/a9/4c7a703a36a244394b586bfb42ab6b.png)
[In-depth and easy-to-follow FPGA learning 15---------- Timing analysis basics]

Understand from the 11 common examples of judging equality of packaging types in the written test: packaging types, the principle of automatic boxing and unboxing, the timing of boxing and unboxing, a

会议OA项目待开会议、所有会议功能

【深入浅出玩转FPGA学习15----------时序分析基础】
随机推荐
MySQL table design for message queue to store message data
MySQL中substring与substr区别
firewalld
WMware Tools installation failed segmentation fault solution
h264和h265解码上的区别
Consistency and Consensus of Distributed Systems (1) - Overview
C language force buckles the rotating image of the 48th question.auxiliary array
How to Repair Word File Corruption
The difference between truncate and delete in MySQL database
Basic usage of async functions and await expressions in ES6
How to solve the error of joiplay simulator
XSS相关知识
Shell programming of conditional statements
【愚公系列】2022年07月 Go教学课程 015-运算符之赋值运算符和关系运算符
Restricted character bypass
In-depth understanding of the auto-increment operator from two error-prone written test questions
unity2D横版游戏教程4-物品收集以及物理材质
Optimization of aggregate mentioned at DATA AI Summit 2022
常用的正则表达式
Asser uses ant sword to log in