`
icfsx
  • 浏览: 21617 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

Another function to browse file and upload

阅读更多
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.
FORM GET_FILE.
  CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
      DEF_FILENAME     = ' '
      DEF_PATH         = P_FILE
      MASK             = ',*.txt.'
      MODE             = 'O'
      TITLE            = 'Select file'
    IMPORTING
      FILENAME         = P_FILE
    EXCEPTIONS
      INV_WINSYS       = 01
      NO_BATCH         = 02
      SELECTION_CANCEL = 03
      SELECTION_ERROR  = 04.
ENDFORM.                    "GET_FILENAME
 
FORM UPLOAD_FILE.
  DATA:SPLIFZ(13) TYPE C.
  DATA:TEMP(200) TYPE C.
  DATA:QTY(10),PRICE(10) TYPE C.
  CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      FILENAME            = P_FILE
      FILETYPE            = 'ASC'
    TABLES
      DATA_TAB            = ITAB2
    EXCEPTIONS
      CONVERSION_ERROR    = 1
      FILE_OPEN_ERROR     = 2
      FILE_READ_ERROR     = 3
      INVALID_TABLE_WIDTH = 4
      INVALID_TYPE        = 5
      NO_BATCH            = 6
      UNKNOWN_ERROR       = 7
      OTHERS              = 8.
  LOOP AT ITAB2.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = itab2-char
      IMPORTING
        output = c_vbeln.
    itab-vbeln = c_vbeln.
    APPEND ITAB.
  ENDLOOP.
ENDFORM. " UPLOAD_DATA
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics