CopyText

Purpose With CopyText you can copy texts between files, screen areas and text variables.
Examples CopyText fromText="t1" toScreen="X[LONGTEXT]"

The text in text variable “t1″ is copied into the text area  X[LONGTEXT] on the screen.

Format CopyText from...="name1" to...="name2"

The following are supported: fromText, fromScreen, fromFile, fromTemplate, fromString, -fromClipboard, toText, toScreen, toFile, toString, -toClipboard, toSharedText, fromSharedText.
In each case, please specify at least one of   fromText or toText.

fromText="t1" toText="t2" Text t1 is copied into text t2
fromText="t1" toScreen="X[area]" Text t1 is copied into screen area  X[Area].
Please observe: The text is actually copied when the screen is displayed, or with the next  “Enter” in an InputScript (asynchronous processing).
fromText="t1" toFile="dsn" Text t1 is copied into file dsn.
fromText="t1" toString="varname" The beginning of text t1 is copied into the variable varname.
fromText="t1" -toClipboard Text t1 is copied into Windows clipboard.
fromText="t1" toSharedText="s1" Text t1 is copied into a shared text s2 (independent of  SAP mode)
toText="t1" fromSharedText="s1" The shared text s1 is copied into text s1
toText="t1" fromScreen="X[area]" The text in screen area  X[Area] is copied into text t1.
Please observe: The text is actually copied when the screen is displayed, or with the next  “Enter” in an InputScript (asynchronous processing).
toText="t1" fromFile="dsn" File dsn is copied into text t1. You can also copy files on http or ftp servers or in the SAP Web repository (Notation: http://…, ftp://…, SAPWR:…).
toText="t1" fromDirectory="dsn" A list of all file names in directory dsn is copied into text t1. You can use wildcards  * and ? as in the MS DOS “dir” command. Example: fromDirectory=”C:\GuiXT\*.gif”. Subdirectories are ignored, but see option “-subdirectories”
toText="t1" fromTemplate="dsn" File dsn is copied into text t1; all &-Variables will be replaced.
toText="t1" fromString="varname" The content of variable varname is copied into text t1.
toText="t1" -fromClipboard The content of Windows clipboard is copied into text t1

 

Options
-append The source text is appended to the target text.
-appendline The source text is appended to the target text as a new line.
line= Only in combination with  toString=. You specify the number of the desired line, starting with 1.

After CopyText you can use if Q[ok] in order to query whether the desired line has been found.

delimiter= Only in combination with  toString= and line=.  Instead of “line feed” the specified character is considered as delimiter.
-subdirectories Only in combination with  fromDirectory=.  Instead of a list of file names, all subdirectory names are copied into the text.”
Tips&Tricks You can find several examples in Special Topics “Text handling in InputScripts “.

CopyText