Prerequisites
- Products: Liquid UI WS, Liquid UI Server or Local DLL, Client Software
- Commands: ShellExecute(), pushbutton()
Purpose
To copy the contents of a text file to the clipboard by executing a function on UIEvent/s.
User Interface
//Create this file inside your script for customizing the SAP Easy Access screen. SAPLSMTR_NAVIGATION.E0100.sjs
//Now, let's start adding the Liquid UI script to the above file and save it.
- Logon to SAP and delete the image container on the SAP Easy Access screen using del(), as shown below.
//Deletes an image container on SAP Easy Access screen del('X[IMAGE_CONTAINER]');
- Add a toolbar push button with the label “Copy to Clipboard” to execute the function copyClipBoard on click.
// Creates a toolbar pushbutton pushbutton([TOOLBAR],'Copy to Clipboard','?',{'process':copyClipBoard,'size':[1,20]})
- Add a function labeled copyClipBoard to copy the text to the clipboard
// Creates a function to copy the text to clipboard
function copyClipBoard() { system.ShellExecute('cmd.exe','/C type C:\LiquidUI\scripts\file.txt|clip'); }
SAP Process
- Refresh the SAP screen, and click on the toolbar pushbutton "Copy to Clipboard". Then, the content of the selected file is copied to the clipboard.
- The text from file.txt is now copied to the clipboard, as shown in the image below.