Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: pushbutton(), set(), globaltextreplace(), load()
Purpose
The article demonstrates how to use the globaltextreplace() to replace text on multiple screens. Furthermore, users can specify the text to be replaced on more than one screen while limiting the replacements to those screens - in other words, the replacement will not be global across all SAP screens. In this example, we will replace the word 'Order' with 'Request' on VA01(Initial and Overview) screens and walk you through the following actions:
- Navigate to the va01 screen and add a toolbar push button to execute the process.
- Add a function to set the values to the input fields.
User Interface
//Create the files SAPMV45A.E0101.sjs and SAPMV45A.4001.sjs inside your scripts folder for customizing the Create Sales Order(Initial and Overview) screens.
//Now, add the Liquid UI script to the above file and save it.
Customization
- Login to SAP, navigate to the VA01 screen and add a toolbar push button labeled Text Replace to execute the do_gtr process on click.
//Creates a toolbar push button to execute the process pushbutton([TOOLBAR], "Text Replace", {"process":do_gtr});
- Add the do_gtr function to set the values to the input fields.
//Creates radio buttons to pass values from the VA01 screen process on click. //Function to set values to the input fields function do_gtr() { set("F[Sold-to party]", "1460"); set("F[Ship-to party]", "1460"); load("wsoffice.dll"); globaltextreplace(/Order/, 'Request', {"ocx":true, "listscreen":false, "screen":["SAPMV45A.4001", "SAPMV45A.0101"]}); }
SAP Process
- Refresh the SAP screen, and click the Text Replace toolbar push button.
- Now, you can view the text with the name as Order on the screen is changed to Request in both the VA01 Initial and Overview screens, as shown below.
VA01 Initial screen
VA01 Overview screen