ABAP 中长文本处理

浪子不回头ぞ 提交于 2020-01-22 02:51:18

相关类  CL_GUI_TEXTEDIT

主要方法 CL_GUI_TEXTEDIT->GET_TEXT_AS_R3TABLE

                CL_GUI_TEXTEDIT->SET_TEXT_AS_R3TABLE

 此类的构造方法和CL_GUI_ALV_GRID 一样也需要放置一个容器

DATA GO_PARENT TYPE REF TO CL_GUI_CUSTOM_CONTAINER .
DATA GO_TEXTEDIT TYPE  REF TO CL_GUI_TEXTEDIT .

CONSTANTS: C_LINE_LENGTH TYPE I VALUE 256 .
TYPES: BEGIN OF GTY_TEXT,
         LINE(C_LINE_LENGTH) TYPE C,
       END OF GTY_TEXT.
DATA GT_TEXT_SAVE TYPE STANDARD TABLE OF GTY_TEXT . "定义内表对长文本保存
CREAT OBJECT GO_PARENT
  EXPORTING
    CONTAINER_NAME = 'CON2' .
CREATE OBJECT GO_TEXTEDIT
  EXPORTING
    WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
    WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
    PARENT                     = GO_PARENT
CALL METHOD GO_TEXTEDIT->GET_TEXT_AS_R3TABLE
  IMPORTING
    TABLE = GT_TEXTSAVE .

CALL METHOD CL_GUI_CFW=>FLUSH .

释放.

IF GO_TEXTEDIT IS NOT INITIAL.
  CALL METHOD GO_TEXTEDIT->FREE .
  FREE GO_TEXTEDIT.
ENDIF.
CALL METHOD CL_GUI_CFW=>FLUSH .

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!