zoukankan      html  css  js  c++  java
  • WDA基础十三:常用模板管理

    常用的模板一般是SMW0和OAOR,根据不同需求来的。

    WAD有个不好的地方就是不支持GUI上的OLE和DOI,所以需要做转换,下面是常用的方式:

    FUNCTION ZCRM_DOWNLOAD_TEMPLATE
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IV_OBJID) TYPE  W3OBJID
    *"----------------------------------------------------------------------
      DATA:
        LS_FILEKEY TYPE          WWWDATATAB,
        LT_MIME    TYPE TABLE OF W3MIME.
    
      DATA:
        LV_XSTRING          TYPE XSTRING,
        LV_FILENAME         TYPE STRING,
        LV_MIME_TYPE        TYPE STRING.
    
      LS_FILEKEY-RELID = 'MI'.
      LS_FILEKEY-OBJID = IV_OBJID.
    
      CALL FUNCTION 'WWWDATA_IMPORT'
        EXPORTING
          KEY    = LS_FILEKEY
        TABLES
          MIME   = LT_MIME
        EXCEPTIONS
          OTHERS = 1.
    
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    
      CALL METHOD CL_BCS_CONVERT=>SOLIX_TO_XSTRING
        EXPORTING
          IT_SOLIX   = LT_MIME
    *     IV_SIZE    =
        RECEIVING
          EV_XSTRING = LV_XSTRING.
    
      SELECT SINGLE VALUE INTO LV_MIME_TYPE
        FROM WWWPARAMS
        WHERE RELID = LS_FILEKEY-RELID
        AND OBJID = LS_FILEKEY-OBJID
        AND NAME = 'fileextension'.
    
      SELECT SINGLE VALUE INTO LV_FILENAME
        FROM WWWPARAMS
        WHERE RELID = LS_FILEKEY-RELID
        AND OBJID = LS_FILEKEY-OBJID
        AND NAME = 'filename'.
    
      CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(
        EXPORTING
          I_FILENAME      = LV_FILENAME
          I_CONTENT       = LV_XSTRING
          I_MIME_TYPE     = LV_MIME_TYPE
          I_IN_NEW_WINDOW = ABAP_FALSE
          I_INPLACE       = ABAP_FALSE ).
    
    
    
    ENDFUNCTION.

    后来做FTP的时候就想到了另一个办法:

    文件上传下载类型的模板。。。

  • 相关阅读:
    实现一个圆形进度条
    给你的jQuery项目赋予Router技能吧
    matlab新手入门(四)(翻译)
    matlab新手入门(三)(翻译)
    matlab新手入门(二)(翻译)
    matlab新手入门(一)(翻译)
    安装Matlab出现Error 1935错误解决方法
    Linux Ubuntu下Jupyter Notebook的安装
    lung 分割论文
    链表的回文结构
  • 原文地址:https://www.cnblogs.com/sapSB/p/7656535.html
Copyright © 2011-2022 走看看