与本地机交互的function
来源:互联网 发布:mac a搜狗输入法 编辑:程序博客网 时间:2024/04/29 17:34
1:获取本地文件目录
CALL FUNCTION 'ws_filename_get'
EXPORTING
mask = ',*.txt,*.*.'
mode = 'o'
title = text-i02
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
2:函数控制弹出窗口
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
titel = '下载文件'
textline1 = '数据库错误!没有模板,请重新上载模板!'
EXCEPTIONS
OTHERS = 1.
3:得到本地SAPGUI_WORKDIR ( sap下载文件标准存放路径 )
CALL METHOD cl_gui_frontend_services=>get_sapgui_workdir
CHANGING
sapworkdir = g_workdir
* EXCEPTIONS
* GET_SAPWORKDIR_FAILED = 1
* CNTL_ERROR = 2
* ERROR_NO_GUI = 3
* NOT_SUPPORTED_BY_GUI = 4
* others = 5
4:下载excel模板到 filename 对应的文件路径下
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = length
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = length
TABLES
data_tab = data_container
* FIELDNAMES =
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
OTHERS = 22
5:在SAPGUI中显示进度指示条
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 1
text = '正在生成EXCEL文件,请稍候'.
6:删除系统中指定 filename文件
CALL FUNCTION 'WS_FILE_DELETE'
EXPORTING
file = l_filename
EXCEPTIONS
OTHERS = 1.
7:上载文件,把txt文件内容读入内表
CALL FUNCTION 'GUI_UPLOAD' "将TXT读入内表
EXPORTING
filename = g_file
* FILETYPE = 'ASC'
has_field_separator = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = t_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
- 与本地机交互的function
- C#同步本地机时间与服务器时间
- 虚拟机访问本地机
- 本地机apache配置基于域名的虚拟主机
- 在本地机设置主机头的方法
- 获取本地机的网关之重大错误
- 本地机系统端口查看程序
- 虚拟机不能和本地机互访
- windows 2000/xp破解密碼[本地机]
- 将文件从本地机拷贝到远程
- 请问如何获得Java文档到本地机上
- VB如何远程备份sqlserver数据库到本地机中
- 本地机访问虚拟机连接不上问题
- Function 与 new Function 的区别
- jQuery(function(){})与(function(){})(jQuery)的区别
- jQuery(function(){})与(function(){})(jQuery)的区别
- jQuery(function(){})与(function(){})(jQuery)的区别
- jQuery(function(){})与(function(){})(jQuery)的区别
- PHP SOAP
- HTTP数据包头解析
- layered window
- JDK 1.5 使用java.util.concurrent开发并发应用
- Never Gave Up
- 与本地机交互的function
- Jquery做的网页版连连看(初稿)
- java中byte[]转换成String类型的问题
- 如何使用C#播放背景音乐
- 魏志刚-个人资料-个人简历-女友人肉搜索
- 驱动对象 设备对象 设备栈 乱杂谈
- [Flex]Flex SDK 4(Gumbo)浅析ASDoc - ASDoc MXML应用篇
- 十进制、二进制、八进制、十六进制之间的转换
- 软件开发