ZIP화일 안의 파일은 잘 열리지만
파일명이 : EC%97%91%EC%85%80%EC%97%85%EB%A1%9C%EB%93%9C.XLS
와같이 깨짐니다. ("원본 : 엑셀다운로드.XLS)
아래 소스 부분( EV_FILENAME)에서
강제로 (엑셀다운로드.XLS)로 바꾼후
---------------------------------------------
CALL METHOD ZIP_TOOL->ADD
EXPORTING
NAME = EV_FILENAME
CONTENT = BUFFER_X.
----------------------------------------------
메쏘드 안의
CONV = CL_ABAP_CONVE_OUT_CE=>CREATE( ENCODEING = UTF8
IGNORE_CERR = 'X'
REPLACEMENT = '#').
부분을 타고 나오면 정상적으로 한글이 보입니다.
아래 소스 한번 봐주시면 감사합니다.
_________________________________________________________
REPORT ZTEST
DATA: ZIP_TOOL TYPE REF TO CL_ABAP_ZIP,
L_ADDR TYPE REF TO CL_ABAP_CONV_IN_CE ,
FILENAME_ZIP TYPE STRING VALUE 'C:\test.zip'.
DATA: T_DATA_TAB TYPE TABLE OF SDOKCNTBIN.
DATA: LT_INFO LIKE SCMS_ACINF OCCURS 0 WITH HEADER LINE.
DATA : BUFFER_X TYPE XSTRING.
DATA: LT_DOCU LIKE BAPI_DOC_FILES2 OCCURS 0 WITH HEADER LINE.
DATA: LS_DOC TYPE BAPI_DOC_DRAW2.
DATA: LV_XSTRING TYPE XSTRING,
BIN_SIZE TYPE I,
EV_FILESIZE TYPE I.
DATA : EV_FILENAME TYPE STRING.
DATA : EV_MIMETYPE TYPE W3CONTTYPE.
DATA: BUFFER_ZIP TYPE XSTRING.
************************************************************************
START-OF-SELECTION.
************************************************************************
CLEAR: LT_DOCU.
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
DOCUMENTTYPE = 'ABC'
DOCUMENTNUMBER = '0000000010000000007549324'
DOCUMENTPART = '000'
DOCUMENTVERSION = '00'
IMPORTING
DOCUMENTDATA = LS_DOC
TABLES
DOCUMENTFILES = LT_DOCU.
REFRESH: T_DATA_TAB, LT_INFO.
CALL FUNCTION 'SCMS_DOC_READ'
EXPORTING
STOR_CAT = LT_DOCU-STORAGECATEGORY
DOC_ID = LT_DOCU-FILE_ID
TABLES
ACCESS_INFO = LT_INFO
* content_txt = lt_sdokcntasc
CONTENT_BIN = T_DATA_TAB
EXCEPTIONS
BAD_STORAGE_TYPE = 1
BAD_REQUEST = 2
UNAUTHORIZED = 3
COMP_NOT_FOUND = 4
NOT_FOUND = 5
FORBIDDEN = 6
CONFLICT = 7
INTERNAL_SERVER_ERROR = 8
ERROR_HTTP = 9
ERROR_SIGNATURE = 10
ERROR_CONFIG = 11
ERROR_FORMAT = 12
ERROR_PARAMETER = 13
ERROR = 14
OTHERS = 15.
READ TABLE LT_INFO INDEX 1.
CHECK SY-SUBRC = 0.
BIN_SIZE = LT_INFO-COMP_SIZE.
EV_FILESIZE = LT_INFO-COMP_SIZE.
EV_FILENAME = LT_INFO-COMP_ID.
EV_MIMETYPE = LT_INFO-MIMETYPE.
***%EC%97%91%EC%85%80%EC%97%85%EB%A1%9C%EB%93%9C.XLS
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
INPUT_LENGTH = BIN_SIZE
* FIRST_LINE = 0
* LAST_LINE = 0
IMPORTING
BUFFER = BUFFER_X
TABLES
BINARY_TAB = T_DATA_TAB
EXCEPTIONS
FAILED = 1
OTHERS = 2.
*
**create zip tool
CREATE OBJECT ZIP_TOOL.
***add binary file
CALL METHOD ZIP_TOOL->ADD
EXPORTING
NAME = EV_FILENAME
CONTENT = BUFFER_X.
**get binary ZIP file
CALL METHOD ZIP_TOOL->SAVE
RECEIVING
ZIP = BUFFER_ZIP.
CLEAR: T_DATA_TAB[],BIN_SIZE.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = BUFFER_ZIP
IMPORTING
OUTPUT_LENGTH = BIN_SIZE
TABLES
BINARY_TAB = T_DATA_TAB.
**download ZIP file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = BIN_SIZE
FILENAME = FILENAME_ZIP
FILETYPE = 'BIN'
TABLES
DATA_TAB = T_DATA_TAB.
_________________________________________________________