Skip to end of metadata
Go to start of metadata

SAP Screen Personas - Getting started guides



Create:
Sebastian Steinhauer

Error rendering macro 'page-info'

com.atlassian.confluence.user.ConfluenceUserPreferences.getDateFormatter(Lcom/atlassian/confluence/core/FormatSettingsManager;)Lcom/atlassian/confluence/core/DateFormatter;

Last Update:
Regina Sheynblat

Error rendering macro 'page-info'

com.atlassian.confluence.user.ConfluenceUserPreferences.getDateFormatter(Lcom/atlassian/confluence/core/FormatSettingsManager;)Lcom/atlassian/confluence/core/DateFormatter;

SAP Screen Personas 3.0 Scripting Guide


SAP Screen Personas- by Regina Sheynblat , Sebastian Steinhauer

Purpose

This is a quick guide designed to help users get started with SAP Screen Personas 3.0 scripting

Overview

 

Additional Information Available on the Knowledge Base

Scripting Events

Scripting API's

Copying Table data into a variable

Filling Fields through URL Parameters

Scripting: onSelect

Scripting: onBeforeRefresh

 

Radio Buttons Example 

Transaction: VA01 Example

Instead of Order Type being a F8 Function,  replace with 3 Radio Buttons.

 

 See Step by Step Instructions

Script Logging

To verify JavaScript objet or the script execution us the following syntx:

session.utils.log(<object>)
session.utils.log(<msg>)
Example:
session.utils.log(“Hello world");
session.utils.log(new Object());


Recommendation

Do not use alert(); to log your JavaScript code. Alert(); disables the browser User Interface until it is dismissed

Programming is all about math

 

code sample
session.utils.log(4);
session.utils.log(4.5);
session.utils.log(4+2);
session.utils.log(4/2);
session.utils.log(4*2);
session.utils.log(4-2);

Text works as well

 

code sample
session.utils.log("Hello World!");
session.utils.log("4+2");

What happens if I do something wrong?

 

session.utils.loog("test");
sesssion.utils.loog("test"); 
sesssion...utils.loog("test"); 

Comments

 

sample
session.utils.log(1);
//session.utils.log(2);
//session.utils.log(3);
session.utils.log(4);
session.utils.log(1);
/*
session.utils.log(2);
session.utils.log(3);
*/
session.utils.log(4);

Whats a Boolean and what is logic

 

sample
session.utils.log(5>4);
session.utils.log(5>=4);
session.utils.log(4<5);
session.utils.log(4=<5);
session.utils.log(5==5);
session.utils.log(5!=5);

IF and Else

sample
if (condition) {
block of code to be executed if the condition is true
}

Doing stuff over and over with loops

 

sample
var x;
 for (x = 0; x<10; x++ ) {
 session.utils.log("this is loop run" + x);
 }
OR
for (statement 1; statement 2; statement 3) {
code block to be executed
}

a conditional loop has the potential to become an infinite loop, which would freeze the browser

Objects

 

sample
session.utils.log("Test".length);
session.utils.log("Test".toUpperCase());

Putting it all together in a sample application

<Scripting Exercise link>

 

 

 

Please check back for more content in the future.

  • No labels