码迷,mamicode.com
首页 > Web开发 > 详细

ABAP WEBRFC

时间:2017-03-21 13:04:03      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:return   cat   length   and   bsp   logs   function   file   pre   

通过WEBRFC实现在网页下载SMW0上传的文件

FUNCTION zhr_download_test.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  TABLES
*"      QUERY_STRING STRUCTURE  W3QUERY
*"      HTML STRUCTURE  W3HTML
*"      MIME STRUCTURE  W3MIME
*"  CHANGING
*"     VALUE(CONTENT_TYPE) LIKE  W3PARAM-CONT_TYPE OPTIONAL
*"     VALUE(CONTENT_LENGTH) LIKE  W3PARAM-CONT_LEN OPTIONAL
*"     VALUE(RETURN_CODE) LIKE  W3PARAM-RET_CODE OPTIONAL
*"----------------------------------------------------------------------


  DATA: name TYPE string.

  SORT query_string DESCENDING.

  READ TABLE query_string WITH KEY name = _Name.

  name = query_string-value.

  DATA: ls_wwwdata   TYPE wwwdatatab.

  ls_wwwdata-relid = MI.
  ls_wwwdata-objid = name.

  CALL FUNCTION WWWDATA_IMPORT
    EXPORTING
      key    = ls_wwwdata
    TABLES
*     html   = html
      mime   = mime
    EXCEPTIONS
      OTHERS = 1.

  CLEAR content_type.
  content_type = application/vnd.ms-excel.

  DATA: lt_wwwparams LIKE TABLE OF wwwparams,
        ls_wwwparams TYPE wwwparams.

  SELECT * FROM  wwwparams INTO TABLE lt_wwwparams
   WHERE  relid       = MI
   AND    objid       = name.

  CLEAR ls_wwwparams.
  READ TABLE lt_wwwparams INTO ls_wwwparams WITH KEY name = filesize.
  content_length = ls_wwwparams-value.

ENDFUNCTION.

 

ABAP WEBRFC

标签:return   cat   length   and   bsp   logs   function   file   pre   

原文地址:http://www.cnblogs.com/xher/p/6593549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!