Purpose:
With globaltextreplace(), you can replace user-specified text throughout the 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 command in the esession.sjs script file. This will apply the command even if you open a new session from an existing session. If you place the command in the elogon.sjs script file, then the globaltextreplace() command will be read-only when you log into SAP.
legacy mode:
Liquid UI has introduced a new legacy mode that includes a set of restrictions to ensure a more secure and efficient string replacement process. In this mode, the string will only be replaced in the following screen elements, providing users with a more streamlined and reliable experience.
- Field labels
- Screen titles
- Group box titles
- Push-button titles and quick info
- Message lines
- Menu texts
- Column headers in tables
- Table titles
Note: In the legacy mode, all existing options, including "OCX," "listscreen, "screen, etc., are not applicable.
Syntax
The basic syntaxes that can be employed are as follows:
-
This syntax is used in the case of a single screen being designated as needing text replacement. In this case, you must specify the screen DynPro name of the target screen.
globaltextreplace(/TextToBeReplaced/,'ReplacementText',{"ocx":true,"listscreen":false,"screen":"DynProName"});
-
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.
globaltextreplace(/TextToBeReplaced/,'ReplacementText',{"ocx":true,"listscreen":false,"screen":["DynProName1","DynProName2"]});
-
This syntax is to turn on the legacy mode of globaltextreplace
globaltextreplace(/TextToBeReplaced/,'ReplacementText',{"legacy":true,]});
Available Options
You can use the following options with the true globaltextreplace():
"listscreen: true: The listscreen option is a boolean that specifies whether or not the listscreens will be affected. |
|
"OCX: true: This option is a boolean that is used to determine if globaltextreplace() will affect the ActiveX controls in SAP. |
|
"screen:dynpro name": The screen option specifies the screen name to affect that particular screen. |
Options Detail
Note: You can run globaltextreplace() in the ESESSION.SJS file for global replacement, or you can open the corresponding script file and execute the options for a specific screen.
Example
The following example demonstrates the usage of the globaltextreplace() command on OCX fields.
We will use the OCX option to apply the globaltextreplace command to OCX fields in SAP. In this example, we will use the OCX option to do a text replacement on the Service: Attachment list in the IW32 transaction.
Script
Open the script file for the list screen and insert the following code:
//SAPLCOIH.E0101.sjs
globaltextreplace(/AttachmentFor000000825525/,'Request',{"ocx":true}); pushbutton([TOOLBAR],"Text Replace",{"process":do_gtr});
Usage Details
-
New Nomenclature on SAP Screens
The user can change the nomenclature throughout the SAP screens with the help of the globaltextreplace command. For example, consider that the concept "order" is used exclusively in the sense of "request" in your R/3 system, possibly for a special user group only. If you would like to replace the word "order" with the word "request" throughout, apply the globaltextreplace() command in the esession.sjs script file.
globaltextreplace(/Order/,'Request');