Skip to end of metadata
Go to start of metadata

Scripting - If/Then and Information Pop-Ups



Create:
Regina Sheynblat

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;

Scripting - Nested If/Then & Information Pop-Ups


SAP Screen Personas- by Regina Sheynblat

Purpose

This is a quick guide to show you how to script nested If/Then Statements and a Pop Up Message if needed for error checking.

If/Then and Pop Up Message Example 

Transaction: VA03 Example & SMEN

Create a simple flavor on the SMEN screen that will exacute transaciton VA03 and return errrs when the Order Number is not valid.

 

 If/Then Flow

 

Define the Variable for Order Number

 

Check if Order Number has been entered ( length of order number) > 0, if it is

 

If Order Number is not valid grab the error message and go back to first screen.

 

If the user forgot to enter an Order Number, show a Warning Dialog Box.

 

 

The whole script

If/Then-Pop-Ups
var ordernumber=session.findById("wnd[0]/usr/txtPersonas_1454525996857").text; 
if (ordernumber.length >0)  
{   
//launch transaction   
session.findById("wnd[0]/tbar[0]/okcd").text = "va03";   
session.findById("wnd[0]").sendVKey(0);   
session.findById("wnd[0]/usr/ctxtVBAK-VBELN").text = ordernumber;   
//press enter key   
session.findById("wnd[0]/tbar[1]/btn[6]").press();   
if (ordernumber>0)    
{
var PONumber = session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/txtVBKD-BSTKD").text;    
session.findById("wnd[0]/tbar[0]/btn[3]").press();    
session.findById("wnd[0]/tbar[0]/btn[3]").press();    
session.findById("wnd[0]/usr/txtPersonas_1454526046744").text= PONumber;}   
else    
{
var message = session.findById("wnd[0]/sbar").text;   
session.findById("wnd[0]/tbar[0]/btn[3]").press();    
session.findById("wnd[0]/usr/txtPersonas_1454526012111").text=message} 
} 
else 
{
var message= session.findById("wnd[0]/sbar").text;   
if (message.length>0)    
{   
session.findById("wnd[0]/tbar[0]/btn[3]").press();          
session.utils.showOptionDialog("Warning", message, session.utils.MESSAGE_TYPE_INFORMATION, session.utils.MESSAGE_OPTION_OK, undefined, undefined);   
}  
else    
{   
session.utils.showOptionDialog("Warning", "Please enter a valid order number!", session.utils.MESSAGE_TYPE_INFORMATION, session.utils.MESSAGE_OPTION_OK, undefined, undefined);   
} 
}
 

 Final Screen

Please check back for more content in the future.

  • No labels