The globaltextreplace command replaces user-specified text throughout an SAP environment.
This command can be used either to perform the replacement on all screens, or users can specify screens that can be either included or excluded from the replacement process. We recommend using this comand in the 'esession.sjs' script file. This will apply the command even if you open a new sessions from within an existing session. If you place the command in the 'elogon.sjs' script file, then opening a new session from an existing session will cause the 'elogon.sjs' file to not be executed and so the gloabltextreplace command will not be read.
Please note that if you are replacing a hex number, you must isolate the term by preceding it with the caret mark (^). The following example, demonstrates replacing such a hex number.
globaltextreplace(/DEF/,'RSN');
However, in the above example, you must write /^DEF/ and not simply /DEF/. If the caret is not used, the term may not be correctly isolated and the operation will not succeed.
There are two basic syntaxes that can be employed, as follows:
Syntax | Definition |
---|---|
globaltextreplace(/TextToBeReplaced/, 'ReplacementText', {"ocx":true, "listscreen":false, "screen":"DynProName"}); | This syntax is used in the case of a single screen being deisgnated as needeing text replacement. In this case, you must specify the screen dynpro name of the target screen. |
globaltextreplace(/TextToBeReplaced/, 'ReplacementText', {"ocx":true, "listscreen":false, "screen":["DynProName1", "DynProName2"]}); | This syntax is used in the case of multiple screens being designated as targets for text replacement. For multiple screens, do not include the 'screen' option in the command. |
The globaltextreplace command takes the following options:
This is an option that will apply the globaltextreplace operation to large RFC packets that cannot otherwise be handled. The command switch to turn this option on or off resides in the guixt.ini file and the syntax is as follows:
zeus=on
The guixt.ini file can be found in the following directory:
C:\Program Files\SAP\FrontEnd\SAPguiThis option is a Boolean that is used to determine if the global text replace will affect the ActiveX controls in SAP. The syntax is as follows:
{"ocx":true}
The listscreen option is a Boolean that specifies whether or not the list screens will be affected. If it is not included in the script, the command will automatically assume that the listscreens will be affected. The listscreen syntax is as follows:
{"listscreen":false}
The screen option designates the screens that will be affected. There are three possible uses of this option, which are as described below:
This is used when a single screen is designated for globaltextreplace. An example is as follows:
{"screen":"SAPMV45A.0101"}
This syntax is also used to designate a single screen to be affected by the globaltextreplace. An example is shown below:
{"screen":["SAPMV45A.0101"]}
This is used when multiple screens are to be included in the text replacement operation. An example is shown below:
{"screen":["SAPMV45A.0101", "SAPLMGMM.0060"]}