반응형
get_cdata로 한글이 깨지면 get_data로 bytes 형태로 받은 뒤 변환해주면 된다.
REPORT YEDIT.
DATA: CLIENT TYPE REF TO IF_HTTP_CLIENT,
XCONTENT TYPE XSTRING,
CONTENT TYPE STRING.
DATA: FE_MESSAGE TYPE STRING.
CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
EXPORTING
URL = 'URL'
SSL_ID = 'SSL_ID'
IMPORTING
CLIENT = CLIENT
EXCEPTIONS
ARGUMENT_NOT_FOUND = 1
PLUGIN_NOT_ACTIVE = 2
INTERNAL_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
CALL METHOD CLIENT->SEND
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
CALL METHOD CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
CALL METHOD CLIENT->GET_LAST_ERROR
IMPORTING
MESSAGE = FE_MESSAGE.
WRITE : FE_MESSAGE.
EXIT.
ENDIF.
CLEAR XCONTENT.
XCONTENT = CLIENT->RESPONSE->GET_DATA( ).
CLEAR CONTENT.
CL_BCS_CONVERT=>XSTRING_TO_STRING(
EXPORTING
IV_XSTR = XCONTENT
IV_CP = 8500
RECEIVING
RV_STRING = CONTENT
).
참고: codepage 8500은 한글임
Character encoding conversion - ABAP Development - Support Wiki (sap.com)
반응형
'IT WORK > SAP FI and ABAP' 카테고리의 다른 글
[SAP FI] FBV0: Error 00 349 for customer fields (0) | 2023.07.26 |
---|---|
[SAP GUI] F4 Possible Entry 오류 - 내부 오류 : 테이블 포맷 F4 Possible Entry Error -Internal Error: Table format (0) | 2023.07.26 |
[ABAP] 메일 한글 깨짐 처리 (0) | 2023.07.20 |
[FI/ABAP] 반제전표의 원전표 보기 How to get original document of payment document (0) | 2023.07.07 |
[ABAP] 숫자를 문자로 바꾸고 천단위 표시 How to convert numeric to string in thousands (0) | 2023.06.01 |