SAP Screen Personas – Adding a script button
As we know that SAP Screen Personas (SP) sits on top of the default UI, so running a script is a costly affair for loading a flavor. Still, scripts can be a great tool for your flavors and we will cover the cases when can it should be used. Before that, let’s learn how we can create a script button. Scripts are complicated so we are breaking this topic in multiple blogs, each one building on the knowledge as we learn (go).
Here we will create a script just like how we create a macro in excel sheet, ie by recording keystrokes. In order to create a script button, first a custom flavor. Insert a text field and script button in the flavor.
Select the flavor and click on “Scripts” (script editor).
It will open the script editor at the bottom of the screen. Click on “Create Script”. Give it a name. Save it. Now click on start recording. Click on the input text field and write – Hello World.
Now script is recording key strokes. After your input, click on stop recording. It will create a javascript for you. Save the script.
Now go to the flavor editor and assign this script to the script button by clicking on script events. For this button only “Onclick” event is available. Assign the script you just created to the event and save the flavor.
Now save the flavor. Go to the screen and click on “Run” push button. Voila. Someone is saying hello.
As the name suggests – this requires javascript knowledge and if you want to understand what this script means or why we used recording, then please follow the next blog (coming soon).
If you like the content, please follow our LinkedIn page and share the blog with your colleagues and friends.