Choose path to download file .

转载 2013年12月05日 16:58:53
"Definition of data for get download path
DATA : fullpath       TYPE                   string,
       filename       TYPE                   string,
       path           TYPE                   string,
       user_action    TYPE                   i,
       encoding       TYPE                   abap_encoding.
 
IF p_file IS INITIAL.
  CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
      window_title         = 'Gui_Download Demo'
      with_encoding        = 'X'
      initial_directory    = 'D:\SAP'
    CHANGING
      filename             = filename
      path                 = path
      fullpath             = fullpath
      user_action          = user_action
      file_encoding        = encoding
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      not_supported_by_gui = 3
      OTHERS               = 4.
 
  IF sy-subrc <> 0.
    EXIT.
  ENDIF.
 
  IF user_action <> cl_gui_frontend_services=>action_ok.
    EXIT.
  ENDIF.
 
ELSE.
  fullpath = p_file.
 
ENDIF.
 
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                = fullpath
    filetype                = 'DAT'
  TABLES
    data_tab                = it_top             " download internal table
  EXCEPTIONS
    file_write_error        = 1
    no_batch                = 2
    gui_refuse_filetransfer = 3
    invalid_type            = 4
    no_authority            = 5
    unknown_error           = 6
    header_not_allowed      = 7
    separator_not_allowed   = 8
    filesize_not_allowed    = 9
    header_too_long         = 10
    dp_error_create         = 11
    dp_error_send           = 12
    dp_error_write          = 13
    unknown_dp_error        = 14
    access_denied           = 15
    dp_out_of_memory        = 16
    disk_full               = 17
    dp_timeout              = 18
    file_not_found          = 19
    dataprovider_exception  = 20
    control_flush_error     = 21
    OTHERS                  = 22.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

相关文章推荐

Generate CSV File and Force Browser to Download It in CodeIgniter

So, this is not about the general PHP approach, it is about how to do that in CodeIgniter. Here is...

C# SharpSsh Private-public a pair key to Upload and Download File

C# SharpSsh Private-public a pair key to Upload and Download File

Use DropzondJS and Spring to upload and download file

Saving user files in a web application is pretty much a necessity in many cases be it images, videos...

Unity 3D本地发布WebPlayer版时Failed to download data file解决方案(IIS 6/7)

遇到这个问题就是指Web服务器并没有支持这种*.unity3d文件类型。需要做的是在Web服务器中添加MIME类型: IIS 7 及以上版本: 在功能视图的IIS选项卡中:  ...

Copy file or folder path to the clipboard in Mac OS X Lion

Learn how to create your own OS X service that lets you copy & paste the paths of files and folders ...
  • doorxp
  • doorxp
  • 2012年06月26日 16:00
  • 665

使用GreenDao 报"This check is to prevent accidental file generation into a wrong path."错误

参考:http://blog.csdn.net/github_14899071/article/details/50408752 最近使用了GreenDao 第三方框架 。Github: https:...

Dynamic Choose IP file transfer

  • 2012年07月17日 02:38
  • 19KB
  • 下载

Free to Choose

  • 2011年04月29日 11:23
  • 782KB
  • 下载

独立思考Justic:Free to Choose and Who owns me

这一次花了很长时间,天气太冷了,人也懒了。然后婆婆妈妈地发了些牢骚,作为一个典型的南方人,抗热怕冷,这个冬天真的很冷,想起来2008年的冰灾。虽然没那么冷,但是感觉不好,在家里越坐越冷,人也越来越懒。...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Choose path to download file .
举报原因:
原因补充:

(最多只允许输入30个字)