Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

SAP Screen Personas



SAP Screen Personas 3.0 Utility Methods


SAP SCREEN PERSONAS KNOWLEDGE BASE - by Sushant Priyadarshi , Kranthi Kumar Muppala

Purpose

This page provides information on some of the utility methods which can be used in the script.

 

UPDATE: Please refer to the SAP Screen Personas Scripting API Documentation page for latest updates - Scripting API
 

Method List

MethodExamplePurpose
session.utils.put(key,value)session.utils.put("sap","personas");

This will store the key "sap" with its value "personas" for the entire session.

Both Key and Value have to be string

session.utils.get(key)session.utils.get("sap");Gets the key value
session.utils.openUrl(url)session.utils.openUrl("www.sap.com");Open the specified URL in a new tab
session.utils.executeScript(scriptID)session.utils.executeScript("wnd[0]/scriptPersonas1234");Invokes the Script with the passed script id
session.utils.changeFlavor(flavorID)session.utils.changeFlavor("72645SGRET5363YEF536");Changes the flavor
session.utils.log(message)session.utils.log("This is SAP Personas 3.0");Creates a log entry in the Script Window
session.idExists(sid)session.idExists("wnd[0]/usr/ctxtSUID_ST");Returns TRUE if the control exists else FALSE
session.callTransaction(tCode)

//You are currently in tCode SU01

session.callTransaction("SE11");

Launches specified transaction.

BUT, it works like a function call. Hitting BACK button from SE11 will take you back to SU01

session.startTransaction(tCode);

//You are currently in tCode SU01

session.startTransaction("SE11");

Launches specified transaction.

Forgets current context and start new transaction. So, from the example, if you hit BACK button from SE11, you go to SMEN

session.info.flavorIdvar flavorId = session.info.flavorId;returns current Flavor ID
session.info.flavorNamevar flavorName = session.info.flavorNamelreturns current Flavor Name
session.info.transactionvar tCode = session.info.transaction;returns current Transaction
session.info.programvar program = session.info.program;returns DYNPRO(Program) nuymber
session.info.screenNumbervar screenNumber = session.info.screenNumber;returns Screen Number
session.info.systemNamevar system = session.info.systemName;returns system SID
session.info.applicationServervar appServer = session.info.applicationServer;returns APP Server
session.info.clientvar client = session.info.client;returns current logged in client
session.info.uservar user = session.info.user;returns current USER
session.info.languagevar lang = session.info.language;returns current language

 

 

  • No labels