Purpose Use the standard SAP GUI text edit control to display and enter text The GuiXT Textbox command can be used for displaying and entering text. In some cases it makes sense to use the SAP GUI edit control instead, since it offers additional functions: search and replace, file drag&drop, protecting a part of the text against changes. |
Solution Use a Control statement with progID="sapgui.texteditctrl". Call up the methods of the text edit control with CallVB or CallJS. Example We display the material sales text; the text language can be selected by the user:
// text control
// initialize textcontrol ....
// set text into text edit
control See below for the complete GuiXT Script. The VB.NET coding is as follows: Public Class textedit Private guixt As New guinet.guixt Public Sub init(tc As TEXTEDITLib.ITextEditCtrl) ' no status bar tc.StatusBarVisible = False End Sub Public Sub settext(tc As TEXTEDITLib.ITextEditCtrl, _ textname As String) tc.Text = guixt.GetText(textname) End Sub End Class
This allows you to display all properties and methods in Visual Studio via context sensitive help: You may also have a look at the SAP system which defines an ABAP OO wrapper around the text edit control:
Offset
(4,10)
// material number
// language selection
// initialize textcontrol
DropDownList
(18.2,2.6)
"languages"
width=20 _
// Read texts
endif
// matnr or
language
changed?
label nextline
if
V[TDOBJECT=MVKE]
and
V[TDID=0001]
and
V[TDSPRAS=&V[langu]]
Set
V[k]
&V[k] + 1
endif
// set text into text edit control
// save entered values
|
Components |