понедельник, 20 сентября 2010 г.
ФМ.Некорректные символы
FUNCTION Z_BW_CLEAR_ILLEGAL_SYMB.
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*" CHANGING
*" REFERENCE(CHANGING_VALUE)
*"----------------------------------------------------------------------
Constants:
l_x_A0 type X value 'A0'
, l_x_C2 type X value 'C2'
, l_x_09 type X value '09'
, l_x_20 type X value '20'
.
Data: int TYPE I
, buffer TYPE XSTRING
, l_x_D0A0 type XSTRING
, l_x_D009 type XSTRING
, l_result TYPE /BI0/OICRM_DESCR
, conv TYPE REF TO cl_abap_conv_out_ce
, conv2 TYPE REF TO cl_abap_conv_in_ce
.
l_x_D0A0 = 'D0A0'.
l_x_D009 = 'D009'.
l_result = CHANGING_VALUE.
int = strlen( l_result ).
conv = cl_abap_conv_out_ce=>create(
encoding = 'UTF-8'
endian = 'L'
).
CALL METHOD conv->write( data = l_result n = int ).
buffer = conv->get_buffer( ).
replace all occurrences of l_x_D0A0 in buffer with l_x_20 in byte mode.
replace all occurrences of l_x_D009 in buffer with l_x_20 in byte mode.
replace all occurrences of l_x_A0 in buffer with l_x_20 in byte mode.
replace all occurrences of l_x_C2 in buffer with l_x_20 in byte mode.
replace all occurrences of l_x_09 in buffer with l_x_20 in byte mode.
class cl_abap_conv_in_ce definition load.
conv2 = cl_abap_conv_in_ce=>create(
encoding = 'UTF-8'
endian = 'L'
input = buffer
).
CALL METHOD conv2->read(
*EXPORTING n = 4
IMPORTING data = l_result
).
CHANGING_VALUE = l_result.
ENDFUNCTION.
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий