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.
     

  • 相关阅读:
    How To Verify TLS Options in Windows
    How to auto-generate a C# class file from a JSON string [closed]
    javascript-questions
    What is the difference between application server and web server?
    Manjaro Rust环境搭建
    Trojan
    50 年的软件开发经验带给我的 63 个启示
    对《GGX》shader的分析-卡通渲染-罪恶装备
    科学迷信
    Tokio,Rust异步编程实践之路
  • 原文地址:https://www.cnblogs.com/xiaomaohai/p/6157531.html
Copyright © 2011-2022 走看看