惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 冰冷

经典正则表达式 (转) 常用的javascript小技巧[作者oror][转] HR 事务代码 (转) rp-provide-from-last 给SAP系统安装联机帮助(事务码SR13) (转) - 冰冷 - 博客园 如何修改 SAP 登录后的背景图片(事务码 SMW0,SM30)(转) sapgui640免除每次登录都要输入密码(转) 关于MiPlatform310 关于oracle form开发中commit WHEN-VALIDATE-ITEM 和 KEY-NEXT-ITEM两个trigger 的先后顺序 vs2005中的treeview VS2005 写存储过程 关于给winform的DataGrid中添加复选框的问题 用.NET创建windows服务 google中的超强搜索 关于FAT32 -> NTFS 文件系统转换 数据库连接字符串大全 [TrackBack] 转自CSDN 地址:http://blog.csdn.net/gauss32/archive/2004/10/27/154621.aspx 关于配置证书服务器,和自己颁发企业证书 自动日志组件 - Log4net应用(转贴来自http://dotnet.3yee.com/)
导出txt文件简单的例子
冰冷 · 2007-09-18 · via 博客园 - 冰冷

REPORT  ZTEST_XIN0917                           .

TYPES:BEGIN OF i_file ,
       col1 TYPE i ,
        col2(3) TYPE c,
        col3(5) TYPE c,
     END OF i_file.

DATA: itab_file TYPE i_file OCCURS 0 WITH HEADER LINE.

***用户可看SAP帮助使用Download和upload的例##
***使用类弹出用户对话框
  DATA :s_filedir    LIKE rlgrap-filename .
  DATA: s_filemask(20) TYPE  c VALUE   ',*.txt ,*.txt. '.
  DATA: s_filepath(60) TYPE  c.


itab_file-col1 = 1.
itab_file-col2 = 'aaa'.
itab_file-col3 = 'aaa'.

append itab_file.


***Get current direcotry
  CALL FUNCTION 'WS_QUERY'
    EXPORTING
      query  = 'CD'
    IMPORTING
      return = s_filepath.
*** get file name ***
  CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
      def_filename     = space
      def_path         = s_filepath
      mask             = s_filemask
      mode             = 'O'
    IMPORTING
      filename         = s_filedir
    EXCEPTIONS
      inv_winsys       = 1
      no_batch         = 2
      selection_cancel = 3
      selection_error  = 4
      OTHERS           = 5.
  CHECK sy-subrc EQ 0. "User might cancel operation.
***如果文件后坠非.TXT加上后坠
  TRANSLATE s_filedir TO UPPER CASE.
  IF '.TXT' CN s_filedir .
    CONCATENATE s_filedir '.TXT' INTO s_filedir .
  ENDIF.
*** write data to file ****
  CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      filename         = s_filedir
      filetype         = 'DAT'
      mode             = 'A'
    TABLES
      data_tab         = itab_file
    EXCEPTIONS
      file_open_error  = 01
      file_write_error = 02
      invalid_type     = 03
      no_batch         = 04
      unknown_error    = 05.
  CASE sy-subrc.
    WHEN 0.
      MESSAGE i001(00) WITH 'Data have been write into file:'
                            s_filedir ',Please check!' .
    WHEN 1.
      MESSAGE i001(00) WITH 'Error while opening file:' s_filedir.
    WHEN 2.
      MESSAGE i001(00) WITH  'Error in writing file ' s_filedir.
    WHEN 3.
      MESSAGE i001(00) WITH  'invalid file type of ' s_filedir .
    WHEN OTHERS.
      MESSAGE i001(00) WITH  'unknown error occured'.
  ENDCASE.