In
order to copy the text into a text variable, please use the CopyText statement.
Since the text edit control on the VA01 screen has no screen element name,
please use the coordinates. Any coordinates within the text edit control will
work. I have just tested the operation with
// GuiXT script "sapmv45a.e4001.txt"
Pushbutton
(toolbar)
"Display item
text" process="display_text.txt"
Box
(7,83)
(15,120)
"Item text"
TextBox
(8,84)
(15,120)
name="t1"
-readonly
// InputScript "display_text,txt"
// Clear text
Set V[empty]
""
CopyText
fromString="empty"
toText="t1"
// goto item text
Enter "=PTEX_SUB"
// 1st text category
Screen
SAPMV45A.4003
Set
V[myindex]
1
Enter
"=TP_FIRST"
// Text display
Screen
SAPMV45A.4003
CopyText
fromScreen=(5,30)
toText="t1"
Enter
"/3"
This will work
fine if you display only the first text category. In the case of several
text categories, it becomes more difficult. The tree control on the left hand
side can be handled by "SAP GUI Scripting" or by the "Native COntrol
Interface" of GUiXT Controls. If the text categories are always the same, with
the same order, you can scroll through them with "=TP_NEXT".
The following script will read the text with a parameterized text category
index:
// GuiXT script "sapmv45a.e4001.txt"
Pushbutton
(toolbar)
"Display text
Cat1" process="display_text.txt"
using
INDEX = "1"
Pushbutton
(toolbar)
"Display text
Cat2" process="display_text.txt"
using
INDEX = "2"
Box
(7,83)
(15,120)
"Item text"
TextBox
(8,84)
(15,120)
name="t1"
-readonly
// InputScript "display_text,txt"
Parameter
INDEX 1
// Clear text
Set V[empty]
""
CopyText
fromString="empty"
toText="t1"
// goto item text
Enter "=PTEX_SUB"
// 1st text category
Screen
SAPMV45A.4003
Set
V[myindex]
1
Enter
"=TP_FIRST"
// Text display
label
textdisplay
Screen
SAPMV45A.4003
if
V[myindex<&U[INDEX]]
Set
V[myindex]
&V[myindex]
+ 1
Enter
"=TP_NEXT"
goto
textdisplay
endif
// copy text and returnt
CopyText
fromScreen=(5,30)
toText="t1"
Enter
"/3"
|