본문 바로가기

반응형

공백을 포함하여 길이 맞추는 로직.
파일화하여 전송하거나 할때 필요

Data lv_codepage_router type abap_encoding '8500',
lv_unicode_string type string,
lv_string_len type i,
lv_out_string type string,
lv_string_router type xstring.

data: lo_out_con type ref to cl_abap_conv_out_ce,
lo_root type ref to cx_root.

try.
* replacement /ignore_cerr 사용으로 특수문자 space 대체 및 다운로드 정상처리
lo_out_con = cl_abap_conv_out_ce=>create( encoding = lv_code_page_router
replacement = ''
ignore_cerr = abap_true ).
lo_out_con->convert( exporting data = lv_unicode_string
importing buffer = lv_string_router ).
catch cx_root into lo_root.
exit.
endtry.

call funtion 'hr_kr_xstring_to_string'
exporting
from_codepage = lv_codepage_router
in_xstring = lv_string_router
out_len = lv_string_len
importing
out_string = lv_out_string.

반응형

'SAP > ABAP Basics' 카테고리의 다른 글

abap se16n_interface 펑션  (0) 2022.11.04
abap 파일 한줄씩 읽기(Read dataset)  (0) 2022.11.02
abap describe field구문  (0) 2022.10.31
abap 병렬처리시 receive results 주의점  (0) 2022.08.26
abap rfc 병렬처리 샘플  (0) 2022.07.15
댓글