SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: MATERIAL LIKE RLGRAP-FILENAME OBLIGATORY DEFAULT 'C:\Users\jg\Desktop\新建文本文档 (3).txt'. "物料导入摸版
PARAMETERS: P_TEST AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK BLK1.
*&---------------------------------------------------------------------*
*& INITIALIZATION
*&---------------------------------------------------------------------*
INITIALIZATION.
*&---------------------------------------------------------------------*
*& AT SELECTION-SCREEN
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL.
PERFORM SELECT_PATH."选择路径
* 方法一
CALL FUNCTION 'TB_LIMIT_WS_FILENAME_GET'
IMPORTING
FILENAME = MATERIAL
EXCEPTIONS
SELECTION_CANCEL = 1
SELECTION_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
* 方法二
DATA V_MATERIAL LIKE RLGRAP-FILENAME.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
MASK = ',*.* ,*.*.'
MODE = '0'
TITLE = '请选择要上传的信息文件'
IMPORTING
FILENAME = V_MATERIAL
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
ENDIF.
MATERIAL = V_MATERIAL.
网友评论