SAP Textedit

Use

You can use the SAP Textedit control to implement an editor for entering and working with text. It can be used as a simple multi-line editor and as an editor for ABAP code. It provides temporary additions that allow you to change the display (for example, to highlight text). Temporary in this sense means that the additions are set and managed at the frontend, but not passed back to the controller. The textedit control does not allow you to set permanent format information or use graphics.

Features

The SAP Textedit has three parts:

  • An application toolbar containing predefined pushbuttons
  • The editor window for displaying text
  • The status bar, containing the following five fields:
    • Text message display
    • Details of the text currently selected
    • Current cursor position and total number of lines
    • Change status (‘*’ = changed, ‘ ’ = unchanged)
    • Insert and overwrite modes (‘Ins’ and ‘Ovr’)

The application toolbar and status bar display is optional.

SAP Textedit

The control provides the following functions:

  • Passing text to and from the control using tables
  • Display and change modes
  • Insert and overwrite mode
  • Setting the maximum line length
  • Highlighting (also with prefixes at the beginning of the line) and protection against entry for text areas
  • Finding out the current cursor position and the position of a selected area
  • Finding out and setting the first line displayed in the editor
  • Varying line break behavior
    • Code editor:
      The line break is line-oriented. You can set the maximum line length yourself. The technical implementation uses internal tables.
    • Text editor
      a) Maximum line length set to width of window
      b) No maximum line length and no line breaks.
  • Local context menu containing the same functions as the toolbar
  • Optional toolbar for local operations in the control
  • A set of keyboard commands for simple navigation within the text Local operations are simplified by the optional toolbar
  • Cut, copy, and paste for selected text areas, using either the keyboard or the application toolbar
  • Indentation of selected text blocks
  • Import or export local files
  • Multi-step undo and redo
  • Find and replace with the following options:
    • String or part of string
    • Whole word
    • With or without differentiating between upper- and lowercase
    • Within a set of lines
    • Find next
  • Events for double-click, F1, F4, drag and drop, and context menus
  • Various drag and drop behaviors for files:
    • Display a file without triggering an event
    • Only a single file can be retrieved using drag and drop, and an event is triggered
    • Multiple files can be retrieved using drag and drop, and an event is triggered
  • Status indicating whether a text has been changed or not

The control wrapper is implemented in the global class CL_GUI_TEXTEDIT in development class SAPTEXTEDIT.

The development class SAPTEXTEDIT contains example and test programs.