Personas 2.0: How to handle the UI state in a sequency of tcode calling?
Hi Personas 2.0 Experts,
I met a problem when I am trying to call two tcodes in one script button. Here is the case:
What I need: calling SU3 to fetch user's initial, and then calling IW21 where "type" field is filled by "ZT" and then execute it to get the destination screen where the user's initial is used. Since I have two different apps both calling tcode IW21 to land to different UI designs, to run the same tcode, I cannot just run the IW21 in /cdok, but use "Switch flavor" with parameter like "IW21//Screen1" or "IW21//Screen2" to land to different falvors.
In one script button, I first call "SU3" to copy the initial into a global var, say, "myInitial", then press Back button to go back to SMEN screen (I hope).
Then I call "Switch falvor" to go to "IW21/Screen1" where I should put value into "type" field. But it gives error - "Control cannot be found" - which looks like the screen is not the one after calling IW21. If I split this into two buttons, and manually to press the first button to get the initial back, then manually press the second button to do swtch flavor using the obtained initial (I cannot use IW21 in /cdok field to run IW21, as 2 IW21 UIs are made differently for the two apps), it will be OK. But I need all these actions to be done by one click.
Does anyone see why Personas cannot find the right control of the second tcode after fetching the user's initial from running the first tcode in one script button?
Thanks a lot in advance!
Dong Zhu replied
Share my findings:
If multiple apps run teh same tocde into different UI screen designs, the better way is to use "switch flavor" which will track Ui flows. But be noticed that each app has to be launched by its url and DO NOT manually swap the SMEN screen - it can mess up the tocde UI flow.
Set to correct.