2011年3月24日 星期四

[ABAP] Get Filename


取得上傳或下載的路徑及檔案名稱
FUNCTION 'KD_GET_FILENAME_ON_F4'
SELECTION-SCREEN BEGIN OF BLOCK z1 WITH FRAME TITLE text-t01.
PARAMETER: p_local LIKE rlgrap-filename OBLIGATORY
                   DEFAULT '\\COMPUTERNAME\UPLOAD'.
SELECTION-SCREEN END OF BLOCK z1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_local.
  gv_local = p_local.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    CHANGING
      file_name = p_local.
FUNCTION 'F4_FILENAME'
SELECTION-SCREEN BEGIN OF BLOCK z1 WITH FRAME TITLE text-t01.
PARAMETER: p_local LIKE ibipparms-path OBLIGATORY
                   DEFAULT '\\COMPUTERNAME\UPLOAD'.
SELECTION-SCREEN END OF BLOCK z1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_local.
  gv_local = p_local.
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      field_name    = 'P_LOCAL'
    IMPORTING
      file_name     = p_local.