Skip to Content

Flavor Switching - SAP Screen Personas 3.0 SP5

May 22, 2017 at 09:56 PM


avatar image
Former Member

We'd like to display different data in transaction VA02 based on Sales Order Type.

We've created two flavors to control this. We've then written the following script (inserted to "Screen Events - onLoad) to switch the flavor based on order type. This script is based on the example here.

//Navigate to Sales Order Header - Sales Tab

//Set Variable for Order Type
var Order=session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP*/tabpT\\01/ssubSUBSCREEN_BODY:SAPMV45A:4301/ctxtVBAK-AUART").text;

//Switch flavor if order type is = ZFOC
if (Order =="ZFOC");

//return to "Change Order XXXXXXX: Overview" Screen

However, regardless of the Order Type, the flavor is being switched - any suggestions?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Tamas Hoznek
May 22, 2017 at 10:57 PM

Remove the semicolon right after the closing parenthesis of the IF condition... so

if (Order=="ZFOC") {
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks, Tamas! There was no error shown in the script, so I was at a loss. When I updated the code as per your suggestion the issue was resolved.


There is no error, but with the semicolon you effectively closed the IF statement, so the flavor switching was always executed.