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

  • 相关阅读:
    putty加了密钥ssh不能登陆,PuTTY:server refused our key问题的解决(转)
    CentOS 7 yum 安装php5.6
    sqlite3.OperationalError: no such table: account_user
    python解决八皇后问题的方法
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 140: invalid continuation byte
    GET /static/plugins/bootstrap/css/bootstrap.css HTTP/1.1" 404 1718
    Java中wait()与notify()理解
    Javac可以编译,Java显示找不到或无法加载主类
    《剑指offer》第三十题:包含min函数的栈
    《剑指offer》第二十九题:顺时针打印矩阵
  • 原文地址:https://www.cnblogs.com/xiaomaohai/p/6157531.html
Copyright © 2020-2023  润新知