zoukankan      html  css  js  c++  java
  • ABAP编写下载(AS->PC)并在客户端打开的程序示例

    report  Z_TEST.

    data: begin of mtab occurs 1,
            text(72),
          end of mtab.

    data: winsys(2).

    read report 'Z_TEST' into mtab.

    *Read PC platform
    call function 'WS_QUERY'
         exporting
              query  = 'WS'
         importing
              return = winsys.
    case winsys.
      when 'MF'.                           "// Unix-Motif
        call function 'WS_DOWNLOAD'
             exporting
                  filename = 'mess.dat'
                  filetype = 'ASC'
             tables
                  data_tab = mtab.

        call function 'WS_EXECUTE'
             exporting
                  inform      = 'X'
                  program     = '/usr/local/bin/xmessage'
                  commandline = '-file mess.dat'.
      when 'PM'.                           "// OS/2-PM
        call function 'WS_DOWNLOAD'
             exporting
                  filename = 'C:/MESS.DAT'
                  filetype = 'ASC'
             tables
                  data_tab = mtab.

        call function 'WS_EXECUTE'
             exporting
                  inform      = 'X'
                  program     = 'E'
                  commandline = 'C:/MESS.DAT'.
      when 'WN'.                           "// Windows
        call function 'WS_DOWNLOAD'
             exporting
                  filename = 'C:/MESS.DAT'
                  filetype = 'ASC'
             tables
                  data_tab = mtab.

        call function 'WS_EXECUTE'
             exporting
                  inform      = 'X'
                  program     = 'NOTEPAD'
                  commandline = 'C:/MESS.DAT'.
      when 'MC'.                           "// Mac
        data: path like rlgrap-filename, cd like rlgrap-filename.
        call function 'WS_QUERY'
             exporting
                  query  = 'CD'
             importing
                  return = cd.

        path = cd.
        data len type i.
        len = strlen( path ).
        write 'MESS.DAT' to path+len.


        call function 'WS_DOWNLOAD'
             exporting
                  filename = path
                  filetype = 'ASC'
             tables
                  data_tab = mtab.

        path ='open file "'.
        len = strlen( path ).
        write cd to path+len.
        len = strlen( path ).
        write 'MESS.DAT"' to path+len.

        call function 'WS_EXECUTE'
             exporting
                  program       = 'ttxt'
                  commandline   = path
                  osmac_creator = 'X'
                  osmac_script  = 'X'.

      when others.
        write: / text-001.                 "// illegal frontend
    endcase.
     

  • 相关阅读:
    codevs 4511 信息传递(NOIP2015 day1 T2)
    caption标签,为表格添加标题和摘要
    用css样式,为表格加入边框
    table标签,认识网页上的表格
    认识div在排版中的作用
    使用ol,添加图书销售排行榜
    使用ul添加列表
    使用<pre>标签为你的网页加入大段代码
    想加入一行代码吗?使用<code>标签
    <address>标签,为网页加入地址信息
  • 原文地址:https://www.cnblogs.com/xiaomaohai/p/6157531.html
Copyright © 2011-2022 走看看