cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 2.0: How to handle the UI state in a sequency of tcode calling?

Former Member
0 Kudos

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.

Problem:

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Dong

Answers (1)

Answers (1)

Carifaine
Active Participant
0 Kudos

Hi Dong,

i would first make sure that you get to smen before calling the flavor switch. I personally prefer using "Enter value" with "/n" in okcd to make sure i get back to SMEN before moving on.

If you are succesful so far, add the next step "switch flavor" like you did before and paste the value you copied before.

Please try this first. For me it seems like either the script didn't reach the iw21 at all or (what is possible as well) you have some step in your script that automatically executes iw21 after you switched flavors so at the point you paste your value you are at an other screen than you expected. Just try to add these script actions step by step. I personally recommend to write your scripts manually without using the record function.

Hope this helps.


Regards,

Christoph

Former Member
0 Kudos

Hi Christoph,

Thanks for reply.

I did use only script but not recording for the script button.

To get the initial from SU3, in the script I just copied the value and pressed the existing SAP "Back button" instead of using "/n" in /okcd. Acutally I did not make a copy flavor of SU3 UI as there is no need to do any change on that UI.

One more general thing I noticed is that sometimes it just did not work if several actions are placed in different buttons and a main act buttion is used to press all the buttons. But it some how work if all the scripts are placed inside one button. I will need to do more study.

Thanks again,

Dong