BW特殊字符处理函数
Posted 我得意的笑了笑的
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BW特殊字符处理函数相关的知识,希望对你有一定的参考价值。
FUNCTION zfm_bi_invlid_character.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(STR_IN) TYPE STRING
*" EXPORTING
*" REFERENCE(STR_OUT) TYPE STRING
*"----------------------------------------------------------------------
DATA: zbgms(1000) TYPE c .
DATA: intbgms TYPE i.
DATA: bufferbgms TYPE xstring,
hex_00 TYPE x VALUE ‘00‘,
hex_01 TYPE x VALUE ‘01‘,
hex_02 TYPE x VALUE ‘02‘,
hex_03 TYPE x VALUE ‘03‘,
hex_04 TYPE x VALUE ‘04‘,
hex_05 TYPE x VALUE ‘05‘,
hex_06 TYPE x VALUE ‘06‘,
hex_07 TYPE x VALUE ‘07‘,
hex_08 TYPE x VALUE ‘08‘,
hex_09 TYPE x VALUE ‘09‘,
hex_0a TYPE x VALUE ‘0A‘,
hex_0b TYPE x VALUE ‘0B‘,
hex_0c TYPE x VALUE ‘0C‘,
hex_0d TYPE x VALUE ‘0D‘,
hex_0e TYPE x VALUE ‘0E‘,
hex_0f TYPE x VALUE ‘0F‘,
hex_10 TYPE x VALUE ‘10‘,
hex_11 TYPE x VALUE ‘11‘,
hex_12 TYPE x VALUE ‘12‘,
hex_13 TYPE x VALUE ‘13‘,
hex_14 TYPE x VALUE ‘14‘,
hex_15 TYPE x VALUE ‘15‘,
hex_16 TYPE x VALUE ‘16‘,
hex_17 TYPE x VALUE ‘17‘,
hex_18 TYPE x VALUE ‘18‘,
hex_19 TYPE x VALUE ‘19‘,
hex_1a TYPE x VALUE ‘1A‘,
hex_1b TYPE x VALUE ‘1B‘,
hex_1c TYPE x VALUE ‘1C‘,
hex_1d TYPE x VALUE ‘1D‘,
hex_1e TYPE x VALUE ‘1E‘,
hex_1f TYPE x VALUE ‘1F‘,
hex_sp TYPE x VALUE ‘20‘,
conv1 TYPE REF TO cl_abap_conv_out_ce,
conv2 TYPE REF TO cl_abap_conv_in_ce.
zbgms = str_in.
TRANSLATE zbgms TO UPPER CASE.
intbgms = strlen( zbgms ).
conv1 = cl_abap_conv_out_ce=>create(
encoding = ‘UTF-8‘
endian = ‘L‘
).
CALL METHOD conv1->write( data = zbgms n = intbgms ).
bufferbgms = conv1->get_buffer( ).
* 用空格(hex_sp)替换字符(hex_0A)#和[email protected](hex_0D);介于 HEX00 和 HEX1F 之间的十六位格式的字符替换为空
REPLACE ALL OCCURRENCES OF hex_00 IN bufferbgms WITH hex_sp IN BYTE MODE.
REPLACE ALL