SAP 文件操作类 CL_GUI_FRONTEND_SERVICES
1 、文件下载。
DATA: l_filename TYPE string, "file name
l_path TYPE string, "file path
l_fullpath TYPE string, "full path
l_useraction TYPE i, "user action
l_encoding TYPE abap_encoding. "endocding " get file to save as
cl_gui_frontend_services=>file_save_dialog(
EXPORTING
default_extension = gco_dot_txt
default_file_name = gco_def_namt
with_encoding = abap_true
file_filter = cl_gui_frontend_services=>filetype_text
CHANGING
filename = l_filename
path = l_path
fullpath = l_fullpath
user_action = l_useraction
file_encoding = l_encoding
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4
).
IF sy-subrc IS INITIAL.
CASE l_useraction.
WHEN cl_gui_frontend_services=>action_cancel.
CLEAR l_fullpath.
MESSAGE i001(00) WITH text-010.
WHEN cl_gui_frontend_services=>action_ok OR
cl_gui_frontend_services=>action_replace.
cl_gui_frontend_services=>gui_download(
EXPORTING
filename = l_fullpath
append = space
write_field_separator = space
trunc_trailing_blanks = gco_true
confirm_overwrite = space
no_auth_check = gco_true
codepage = l_encoding
CHANGING
data_tab = git_etab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24
).
IF NOT sy-subrc IS INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
CLEAR l_fullpath.
ENDIF.
WHEN cl_gui_frontend_services=>action_append.
" no header required
WHEN OTHERS.
CLEAR l_fullpath.
ENDCASE.
ENDIF. CONCATENATE p_path g_seqno gco_bpt INTO g_path.
cl_gui_frontend_services=>gui_download(
EXPORTING
filename = g_path
* bin_filesize = lv_binary_leng
filetype = gco_bin
CHANGING
data_tab = git_etab
EXCEPTIONS
OTHERS = 1
).
IF sy-subrc <> 0.. ENDIF.
SAP 文件操作类 CL_GUI_FRONTEND_SERVICES的更多相关文章
- [C#] 常用工具类——文件操作类
/// <para> FilesUpload:工具方法:ASP.NET上传文件的方法</para> /// <para> FileExists:返回文件是否存在&l ...
- 文件操作类CFile
CFile file; CString str1= L"写入文件成功!"; wchar_t *str2; if (!file.Open(L"Hello.txt" ...
- asp.net文件操作类
/** 文件操作类 **/ #region 引用命名空间 using System; using System.Collections.Generic; using System.Text; usin ...
- android 文件操作类简易总结
android 文件操作类(参考链接) http://www.cnblogs.com/menlsh/archive/2013/04/02/2997084.html package com.androi ...
- Ini文件操作类
/// <summary> /// Ini文件操作类 /// </summary> public class Ini { // 声明INI文件的写操作函数 WritePriva ...
- java csv 文件 操作类
一个CSV文件操作类,功能比较齐全: package tool; import java.io.BufferedReader; import java.io.BufferedWriter; impor ...
- Qt5:Qt文件操作类 QFile
在QT中,操作文件一般不使用C++提供的文件操作类 , 因为操作文件的时候,要用到C++提供的 string 类,而在QT中使用的是Qt自己实现的一个string类 QString .在Qt中使用C+ ...
- C# 文件操作类大全
C# 文件操作类大全 时间:2015-01-31 16:04:20 阅读:1724 评论:0 收藏:0 [点我收藏+] 标签: 1.创建文件夹 //usin ...
- Java文件操作类效率对比
前言 众所周知,Java中有多种针对文件的操作类,以面向字节流和字符流可分为两大类,这里以写入为例: 面向字节流的:FileOutputStream 和 BufferedOutputStream 面向 ...
随机推荐
- 从乘法求导法则到BPTT算法
本文为手稿,旨在搞清楚为什么BPTT算法会多路反向求导,而不是一个感性的认识. 假设我们要对E3求导(上图中的L3),那么则有: 所以S2是W的函数,也就是说,我们不能说: 因为WS2 = WS2(w ...
- python中一些列表知识
列表 序列是 Python 中最基本的数据结构. 序列中的每个值都有对应的位置值,称之为索引,第一个索引是 0,第二个索引是 1,依此类推. Python 有 6 个序列的内置类型,但最常见的是列表和 ...
- JVM调优篇
点赞再看,养成习惯,微信搜索「小大白日志」关注这个搬砖人. 文章不定期同步公众号,还有各种一线大厂面试原题.我的学习系列笔记. 基础概念 一般JVM调优,重点在于调整JVM堆大小.调整垃圾回收器 jv ...
- 再见 FTP/SFTP!是时候拥抱下一代文件传输利器了!
关注「开源Linux」,选择"设为星标" 回复「学习」,有我为您特别筛选的学习资料~ 两台电脑之间该如何传送档案,其实方法有超多种的,像是 FTP 或透过 SSH 方式来传送档案, ...
- nova服务的基本使用
创建flavor类型 [root@controller ~]# openstack help flavor create usage: openstack flavor create [-h] [-f ...
- k8s client-go源码分析 informer源码分析(3)-Reflector源码分析
k8s client-go源码分析 informer源码分析(3)-Reflector源码分析 1.Reflector概述 Reflector从kube-apiserver中list&watc ...
- Spring Security之用户名+密码登录
自定义用户认证逻辑 处理用户信息获取逻辑 实现UserDetailsService接口 @Service public class MyUserDetailsService implements Us ...
- 442. Find All Duplicates in an Array - LeetCode
Question 442. Find All Duplicates in an Array Solution 题目大意:在数据中找重复两次的数 思路:数组排序,前一个与后一个相同的即为要找的数 Jav ...
- Springmvc基础及应用
SpringMVC简介和环境搭建 SpringMVC简介 Spring 为展现层提供的基于 MVC 设计理念的优秀的Web 框架,是目前最主流的 MVC 框架之一.在Spring3.0 后全面超越 S ...
- 使用 Vite 插件开发构建 Tampermonkey 用户脚本
起因 一直以来,我都是直接在浏览器 Tampermonkey 扩展页面直接新建用户脚本来开发的: 对于一些简单的脚本,这没有什么问题,即改即看.但当代码多了以后问题就来了,自带编辑器开发体验确实不太舒 ...