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 ...

使用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
  • 下载

Struts2学习笔记(十七) 文件下载(File Download)

前面我们刚刚学完文件上传,那么我们就接着来看和文件上传相对应的文件下载吧。对于文件上传而言,文件下载实现起来要简单的多。通常我们可以直接将一个超链接的地址指向我们想要给用户下载的资源即可。但是如果这些...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

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