on 06-22-2017 4:30 PM
Hello,
I have a first Flavor (Flavor1) which takes input from a second flavor (Flavor2).
So in Falvor1, I record a script which goes to Flavor2 and retrieve some values.
These values in Flavor2 are calculated with a script.
When runing standalone Flavor2, the values are calculated right.
When running Flavor1, it doesn't retrives the values from Flavor2, it only passed the field name.
Do I have to put all the code inside Flavor1 (without calling Flavor2)?
Or is there a specific way to call a script into another flavor?
Thanks,
Emmanuel.
Hi Emmanuel,
Could you please clarify 'After inside the scripting of flavor 1, I have some code to check the result of the script 2.'?
You call startTransaction in Flavor 1, which ends the transactional session of your current transaction (this includes empty the values of all custom fields e.g. wnd[0]/usr/lblPersonas_14988158823869), then you are still in the context of your script from flavor 1 but you switch to flavor 2 and fill some fields - all good so far - then you press a script button in flavor 2 which should work (but session.utils.executeScript(<script id>); would be a little cleaner).
What happens next? Is the script moving you back to the transaction with flavor 1 that started all this? And what script is responsible for assigning'OK' to the text property of wnd[0]/usr/lblPersonas_14988158823869?
Is MD12 and flavor 2 ever rendered?
Cheers!
--
Tobias Queck, SAP Design
SAP Screen Personas
Lead Architect
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Tobias and Clemens,
this is the script in Flavor 1 (which is inside a flavor based on MD04)
//launch 2nd flavor
session.startTransaction("MD12");
session.utils.changeFlavor("005056A406741ED78EDE3EAC6A4CC114");//put variable from flavor1.
session.findById("wnd[0]/usr/txtRM61P-PLNUM").text = order_h;
session.findById("wnd[0]/tbar[0]/btn[0]").press();
session.findById("wnd[0]/usr/txtPersonas_14976023036234").text = qty_rec;//launch script in flavor2 (behind a script button)
session.findById("wnd[0]/usr/btnPersonas_149760238257568").press();
After inside the scripting of flavor 1, I have some code to check the result of the script 2.
if(session.findById("wnd[0]/usr/lblPersonas_14988158823869").text !== "OK")
this check always failed.
Thanks,
Emmanuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Emmanuel,
I assume the values in flavor 2 are calculated with an onLoad or onAfterRefresh script. The onLoad and onAfterRefresh events are only fired if the script from flavor 1 ends in flavor 2 and a flavor 2 screen is then rendered. You can however explicitly execute the scripts in flavor 2 that do the calculation via session.utils.executeScript().
The flow in the flavor 1 script should be:
Best Regards,
Clemens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Emanual,
Could you please share the script you are using in Flavor 1?
Cheers!
--
Tobias Queck, SAP Design
SAP Screen Personas
Lead Architect
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.