首页 > 其他分享 >GUI_UPLOAD-上传txt文件

GUI_UPLOAD-上传txt文件

时间:2023-05-08 15:47:23浏览次数:38  
标签:GT DATA GUI MATERIAL UPLOAD FILE ERROR txt TYPE

*&---------------------------------------------------------------------*
*& Report  Z016
*&
*&---------------------------------------------------------------------*
*&
*& 上传TXT文件
*&---------------------------------------------------------------------*

REPORT Z016 MESSAGE-ID ZHQ NO STANDARD PAGE HEADING.

TYPES:BEGIN OF MATERIAL,
  ID TYPE CHAR10,
  NAME TYPE CHAR50,
  END OF MATERIAL.

DATA GT_MATERIAL TYPE TABLE OF MATERIAL WITH HEADER LINE.

PARAMETERS P_FILE TYPE RLGRAP-FILENAME OBLIGATORY.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
  CALL FUNCTION 'WS_FILENAME_GET'
   EXPORTING
     MASK                   = ',txt,*.txt,'
     MODE                   = 'O'
     TITLE                  = '我的物料'
   IMPORTING
     FILENAME               = P_FILE
   EXCEPTIONS
     INV_WINSYS             = 1
     NO_BATCH               = 2
     SELECTION_CANCEL       = 3
     SELECTION_ERROR        = 4
     OTHERS                 = 5.






START-OF-SELECTION.
DATA TEMP_FILE TYPE STRING.
      TEMP_FILE = P_FILE.
     CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         FILENAME                      = TEMP_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                      = GT_MATERIAL
*      CHANGING
*        ISSCANPERFORMED               = ' '
*      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
               .



END-OF-SELECTION.

DATA LEN TYPE I.
DESCRIBE TABLE GT_MATERIAL LINES LEN.

IF LEN > 0.
  LOOP AT GT_MATERIAL.
      WRITE : / GT_MATERIAL-ID,'---->',GT_MATERIAL-NAME.
  ENDLOOP.
ELSE.
  DATA MESSAGE TYPE STRING.
  CONCATENATE P_FILE '-好像没有找到数据' INTO MESSAGE SEPARATED BY ''.
  MESSAGE S000 WITH MESSAGE DISPLAY LIKE 'E'.
ENDIF.

 

标签:GT,DATA,GUI,MATERIAL,UPLOAD,FILE,ERROR,txt,TYPE
From: https://www.cnblogs.com/hua900822/p/17381931.html

相关文章

  • [20230508]crack oracle执行文件.txt
    [20230508]crackoracle执行文件.txt--//昨天看了链接:https://www.xifenfei.com/2023/04/ora-07445-kglsget.html--//提到open阶段执行如下:-----CurrentSQLStatementforthissession(sql_id=gtf6tgc2ycgxx)-----selectcount(*)fromXDB.XDB$SCHEMAswheres.xmldata.s......
  • linux GUI-QT6.5移植到Mini2440
    ----------------------------------------------------------------------------------------------------------------------------内核版本:linux5.2.8根文件系统:busybox1.25.0u-boot:2016.05开发板:Mini2440-----------------------------------------------------------------......
  • 软件测试|超好用超简单的Python GUI库——tkinter(十)
    前言上文我们介绍了tkinter的列表框处理,我们在日常生活中还会遇到组合框的情况,tkinter同样可以实现这个功能,下面我们来介绍一下tkinter如何实现组合框。Combobox控件上一篇文章,我们知道Listbox是一个供用户从列表项中选择相应条目的控件。但在有些情况下,比如列表的项目过多时,若使......
  • Heuristic-Guided Reinforcement Learning
    发表时间:2021(NeurIPS2021)文章要点:这篇文章提出了一个Heuristic-GuidedReinforcementLearning(HuRL)的框架,用domainknowledge或者offlinedata构建heuristic,将问题变成一个shorter-horizon的子问题,从而更容易解决。具体的,就是将原始的MDP变换成一个新的reward和gamma的M......
  • PyautoGui
     1importtime2importpyautogui34#Size(width=2560,height=1600)获取屏幕像素5pyautogui.size()67#Point(x=1595,y=907)获取当前鼠标坐标,返回x,y轴8x,y=pyautogui.position()9print(x,y)1011#查看该像素点是否在屏幕内,返回True/Fals......
  • PHP: upload file
     <!DOCTYPEhtml><html><body><formaction="uploadImage.php"method="post"enctype="multipart/form-data">Selectimagetoupload:<inputtype="file"name="fileToUpload&quo......
  • c# 使用ajaxfileupload上传文件,通过一般处理程序(Handler)接收文件
    界面如下图:HTML代码如下:<html><head><!--引入jqueryajaxfileupload.js--><!--ajaxfileupload.js为了兼容IE不同版本,需要修改源代码,文章附带源代码--><scriptsrc="../../Content/js/jquery/jquery-1.4.2.min.js"type="text/ja......
  • C# WebUploader文件分片上传、断点续传
    1、添加引用<!--引入CSS--><linkrel="stylesheet"type="text/css"href="~/Scripts/webuploader-0.1.5/webuploader.css"><!--引入JS--><scripttype="text/javascript"src="~/Scripts/webuploader-0.1.5/w......
  • Python教程:pandas读写txt文件——DataFrame和Series
    大家用pandas一般都是读写csv文件或者tsv文件,读写txt文件时一般就withopen了,其实pandas数据类型操作起来更加方便,还是建议全用pandas这一套。读txt文件代码如下,主要是设置正则表达式的分隔符(sep参数),和列名取消(header参数),以及不需要列索引(index_col)。1df=pd.read_csv("workl......
  • 批量修改Mac txt文件名 Python脚本
    本文来源:批量修改Mactxt文件名Python脚本-钻芒博客(zuanmang.net)需求:修改文件夹内所有txt文件的文件名称,如 钻芒博客1234_你好1234567.txt要求去掉_后边的名称,使其改成 钻芒博客1234.txt如果文件名称没有_,则不处理Python importosimportsubprocess #替......