Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: pushbutton(), set(), globaltextreplace(), load()
Purpose
Learn how to replace the required text on the SAP screen using globaltextreplace command.
This scenario demonstrates how to use the globaltextreplace command to replace text on multiple screens. 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 two VA01(Initial and Overview).
User Interface
//Create these files inside your folder for customizing the Create Sales Order(Initial and Overview) screens. SAPMV45A.E0101.sjs and SAPMV45A.4001.
//Now, let’s add the liquid UI script to the above file and save it.
- Add a toolbar push button with the label “Text Replace” that executes the function do_gtr on click.
//Creates toolbar pushbutton Text Replace pushbutton([TOOLBAR], "Text Replace", {"process":do_gtr});
- Add the following script to the above file and save it.
//Adds a function to set values 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
- Open the Create Sales Order screen and click Text Replace toolbar pushbutton.
- 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.
Figure 1. SAPMV45A.E0101Figure 2. SAPMV45A.4001