이글은 아래 링크의 원본 글에 대한 한글 번역 입니다
https://blogs.sap.com/2014/09/30/abap-webdynpro-table-to-excel/
ABAP WebDynpro Table to Excel
September 30, 2014
웹딘프로아밥 테이블을 엑셀 파일로 변환하여 다운로드하는 깔끔한 방법입니다.
(다음 에러 없이: 'filename.xls'의 파일 형식 및 확장명이 일치하지 않습니다. 파일이 손상되었거나 안전하지 않을 수 있습니다. 데이터 원본을 신뢰하지 않는다면 파일을 열지 마세요. 그래도 파일을 여시겠습니까?).
아래 코드를 가진 메소드를 만드세요:
method wd_download_table_to_excel.
******************************************************************************************************************
*Purpose: Accept any table and and sends to Excel from ABAP WebDynpro
******************************************************************************************************************
data: lv_xstring type xstring.
data: lv_mime_type type w3conttype.
data: lv_mime_type_string type string.
data: ref_data type ref to data.
get reference of lt_tbl into ref_data.
call function 'SDOK_MIMETYPE_GET'
exporting
extension = 'xlsx'
importing
mimetype = lv_mime_type.
lv_mime_type_string = lv_mime_type.
cl_fdt_xl_spreadsheet=>if_fdt_doc_spreadsheet~create_document( exporting itab = ref_data iv_call_type = 1 columns = lt_column receiving xdocument = lv_xstring ).
cl_wd_runtime_services=>attach_file_to_response( exporting i_filename = i_filename i_content = lv_xstring i_mime_type = lv_mime_type_string i_in_new_window = abap_false ).
endmethod.
이글은 아래 링크의 원본 글에 대한 한글 번역 입니다
https://blogs.sap.com/2014/09/30/abap-webdynpro-table-to-excel/
'ABAP > Web Dynpro ABAP(WDA)' 카테고리의 다른 글
[번역] 웹딘프로아밥 ALV 에서 드래그 앤 드랍 (0) | 2016.12.05 |
---|---|
[번역] 웹딘프로아밥 화면 데이타(컨텍스트) 변경을 인식하는 방법 (0) | 2016.12.05 |
[번역] 스탠다드 컴포넌트에 enhancement 없이 UI 엘리먼트 동적 변경 (BAdI) (0) | 2016.12.05 |
[번역] UI 테마 디자이너로 웹딘프로아밥 테마를 관리 (0) | 2016.12.05 |
[번역] 웹딘프로아밥 도움말 센터 (0) | 2016.12.05 |