Liquid UI - WS Reference Library

Message Command with Pop-up


Prerequisites


Runs On

  SAP GUI Android iOS WM Web
Direct Connect      
Liquid UI Server Connect          

Purpose

In this scenario, we will use a pop-up to confirm whether the user wants to navigate to VA02 or not. Using the message command, we can utilize different types of pop-ups for different scenarios and do different logic depending on their choice.

NOTE: This feature does not work for LiquidUI Server.


User Interface

Log into SAP and on the SAP Easy Access Screen click on the “GOTO VA02” button on the toolbar.

A popup will come up. Select either “Yes” or “No” and the screen will either navigate to VA02 or stay on the same screen.

The pop-up will vary on how it looks depending on what “type” is specified in the options for the message command. The “type” is calculated by adding the Icon Constant and Popup Type Constant.

POP-UP TYPEVALUE
ABORT,RETRY,IGNORE 2
CANCEL,TRY,CONTINUE 6
HELP 16384
OK 0
OK,CANCEL 1
RETRY,CANCEL 5
YES,NO 4
YES,NO,CANCEL 3
ICON TYPEVALUE
INFORMATION ICON 64
QUESTION ICON 32
STOP ICON 16

Using the table above, we can see if we wanted a Pop-up that gave the options “ABORT, RETRY, IGNORE”, with a STOP ICON, we would need to add 2+16. Our calculated “type” is 18.

The below is from the following command:

 message("CALCULATED TYPE is 18!",{"type":18});

Our process can flow a certain way depending on what button is clicked by the user. Each button has specific value we can use to check in an “if” condition.

BUTTONVALUE
FUNCTION FAIL 0
ABORT 3
CANCEL 2
CONTINUE 11
IGNORE 5
NO 7
OK 1
RETRY 4
TRY 10
YES 6


Liquid UI Script

pushbutton([TOOLBAR],"GO TO VA02","?",{"process":navigateVA02});
function navigateVA02(){
	onscreen 'SAPLSMTR_NAVIGATION.0100'	
// message_result will hold a value that depends on what the user clicks in  the pop-up
// in the message command, specify the type, 4 is a Yes or No message box
// in the message command, specify the title you want the message box to have
message_result = message("ARE YOU SURE YOU WANT TO GO TO VA02?", {"type":4,"title":"NAVIGATE TO VA02?"});
// if the result is 6, the user clicked yes
if(message_result == 6){
	enter("/nva02");
		}
// if the result is 7, the user clicked no
else if(message_result == 7){
	enter("?");
		}
}