我們是英文系統(tǒng)烁巫,在我調(diào)用ws_download和gui_download的時候內(nèi)表的中文在excel里都變成了#
嘗試增加列寬行高,不行
更改Codepage參數(shù)蘑秽,亂碼
最后嘗試一個很好用的的函數(shù)饺著,解決了這個問題,而且還不會有彈窗
PARAMETERS: p_path LIKE rlgrap-filename.
"文件名.xlsx 就不會有彈窗
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_filename = p_path
* I_APPL_KEEP = ' '
TABLES
i_tab_sap_data = gt_tab
* CHANGING
* I_TAB_CONVERTED_DATA =
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ELSE.
MESSAGE 'successful!' TYPE 'S'.
ENDIF.
附上文件路徑的F4幫助
AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
PERFORM frm_path_f4.
FORM frm_path_f4 .
DATA: lv_text TYPE string, "message
lv_filename TYPE string, "download file name
lv_path TYPE string, "download file path
lv_title TYPE string , "title
lv_fullpath TYPE string, "full path
l_init_fname TYPE string.
lv_title = text-002.
" lv_title_name = text-003.
CONCATENATE 'Info loan-文件' sy-datum '.xlsx' INTO l_init_fname.
"l_init_fname有值可以直接選到文件夾筷狼,沒有值得時候需要手動給
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = lv_title " 保存'
default_file_name = l_init_fname " 客戶合作伙伴導(dǎo)入模板
CHANGING
filename = lv_filename
path = lv_path
fullpath = lv_fullpath.
p_path = lv_fullpath.
ENDFORM.