Liquid UI - Documentation - 6.13 globaltextreplace()

6.13 globaltextreplace()


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.

Note: You must have wsoffice.dll installed in your Liquid UI scripts folder to use this command.

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:

  1. 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"});
  2. 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"]});
  3. 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":".."

"listscreen: true: The listscreen option is a boolean that specifies whether or not the listscreens will be affected.

"OCX":".."

"OCX: true: This option is a boolean that is used to determine if globaltextreplace() will affect the ActiveX controls in SAP.

"screen":".."

"screen:dynpro name": The screen option specifies the screen name to affect that particular screen.


Options Detail

listscreen

  1. The listscreen option is a boolean that specifies whether or not the listscreens will be affected. If it is not included in the script, the command will automatically assume that the list screens will be affected.

  2. globaltextreplace(/Priority/,'Level',{"listscreen":true});
  3. Navigate to the /nqm10 transaction in SAP GUI. The "Priority" text on the list screen will be replaced with "Level" text.

OCX

  1. This option is a boolean that is used to determine if globaltextreplace() will affect the ActiveX controls in SAP. When OCX is used, the'screen' and 'listscreen' options may not be applied.

  2. globaltextreplace(/Favorites/,'List',{"ocx":true});
  3. As per the code, "Favorites" text in OCX control on SAP GUI will be replaced with "List" text.

screen

The screen option specifies the screen name to affect that particular screen. There are two possible uses of this option, which are as described below:

  1. Single Screen: This is used when a single screen is designated for globaltextreplace().

  2. globaltextreplace(/Order/,'Request',{"ocx":true,"screen":"SAPMV45A.4001"});
  3. As per the code, the "Order" text in the screen SAPMV45A.4001 is replaced with "Request."
  1. Multiple Screens: This is used when multiple screens are to be included in the text replacement operation, like the following:

  2. globaltextreplace(/Order/,'Request',{"ocx":true,"listscreen":false,"screen":["SAPMV45A.4001","SAPMV45A.0101"]});
  3. As per the code, the "Order" text on the screens SAPMV45A.4001 and SAPMV45A.0101 is replaced with "Request."

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');
  • Replace selected text in multi-screen


Can't find the answers you're looking for?