cancel
Showing results for 
Search instead for 
Did you mean: 

Pushing a script button after navigating to another screen fails

steverumsby
Active Contributor
0 Kudos

I have a scenario () where I have a Personas landing page with custom fields and quick lookup buttons. These lookup buttons run a display transaction to copy some data back to the landing page - the "PO Lookup" described in the blog is the best example of this.

I also have a find button that does the job of a custom search help, allowing the user to find a PO, cost centre or other object. These buttons typically copy just the object identifier (e.g. PO number) back to the launchpad screen. I would like to also perform the lookup process after doing this. I could include the lookup process in the script on the search screen, and in some cases I do. It would be better to just push the quick lookup button that already exists on the launchpad screen and avoid duplicating code. That doesn't seem to work for me, though.

Here's a simplified example:

The process here is:

  • User pushes the "Go" button, which in this example just runs transaction GUIT
  • User pushes the "Go Back" button on GUIT. This button uses "/n" to go back to the start screen, enters some text ("From GUIT") in one field there and pushes a button ("Press me") that fills in some text in another field

You can see that I get the "From GUIT" text, but I don't get the "I was pressed" text that would result from pressing the button. It appears that pressing a script button on one screen after navigating to it in another script doesn't work.

Is this right? Have I missed something? Is it a bug that should be reported? Does anyone have any suggestions for getting this to work?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Steve,

In your GO BACK button (in GUIT), please introduce a Refresh Action at step 2.

It will work.

In general, refresh should be used whenever you want to access controls from the "updated screen".

For example, You perform some action which updates your elements. And to access these updated values, you need to refresh. OR lets say, your action takes you to a different screen, you need refresh to access controls from new screen.

Regards,

Sushant

steverumsby
Active Contributor
0 Kudos

You're right, adding Refresh works in this case. I don't know why I forgot that, especially as I have it in my real example, below. Sorry...

However I have a slightly more complex example where this doesn't work. I have a list display transaction (IW78) I call to search for service orders, and a script button that's activated when a line from the results table is selected. That script copies data from the table back to the original launchpad screen - a modified SMEN. The script looks like this:

With just steps 1-7 this works perfectly. However, now I need to do something else that is already performed by a script button on the launchpad screen, so I added steps 8 and 9. Now what happens is this:

Any thoughts?

Thanks,

Steve.

0 Kudos

Hi Steve,

I tried a few cases and it works for me.

Can you provide a bit more detail on the target script button?

Or probably you can write a simple script for your target button and then try.

Is your target script taking you to some other transaction/screen and coming back to start?

Regards,

Sushant

steverumsby
Active Contributor
0 Kudos

Yes, the target script is running a reasonably complex quick lookup - copying data back from IW33. I've had a similar problem in the past with POs in the same context - a list display to search, copy back a PO number, and then try to use an existing PO quick lookup script, so it isn't just IW33 that causes this.

I've attached the IW33 script, just in case it helps you figure out what's going on. I'll also try and construct something simpler that still demonstrates the problem.

Thanks Sushant.

0 Kudos

Hi Steve,

Can you tell whats the control at Step 11 which has PUSH action for below ID:

ses[0]/wnd[0]/usrUSRAREA/subcntSUB_ALLSAPLCOIH3001/subcntSUB_LEVELSAPLCOIH1100/tabstripTS_1100/tabpageSUB_AUFTRAGSAPLCOIH1120/subcntHEADERSAPLCOIH0154/btnICON_NTF

So i used you script (except step 11 for now). My flow is going like this,

-From a different transaction, i grab the order number

-Come to SMEN

-Paste the order in SMEN flavor

-Push your TARGET Button which grabs all the info from IW33 and comes back to SMEN flavor

-Paste the variables

The only missing piece i guess is the control ID which i am not able to figure out in your step 11. If you could guide me here, then i will upload my scripts here (snapshot of that button would be great).

Best Regards,

Sushant

steverumsby
Active Contributor
0 Kudos

That's the 'display notification' button half way down IW33, with the glasses on it. It runs IW53 displaying the corresponding notification. I'm grabbing the 'reported by' field from the notification to paste back on the smen screen.

0 Kudos

Hi Steve,

Well I could not reproduce your issue even using your script.

If you want, i can upload my script here or if possible please recreate a smaller issue or please open a message with us so that i get access to your flavor.

Regards,

Sushant

steverumsby
Active Contributor
0 Kudos

Yes, please upload your script here (or email it) and I'll try it out and see if it sheds any light on the problem.

I've been struggling to simplify it much, unfortunately. I don't have to do too much to it before it starts working! I'll keep at this for a little while longer, but then create an OSS message - as you say, it may well be that the simplest thing is for you to look at my system.

Thanks for your help so far.

Steve.

steverumsby
Active Contributor
0 Kudos

I'm going to have to drop this issue for a little while - other things coming up with more priority. To work around it I've just duplicated the code, and I'll live with that. I will come back to this eventually, as I have the same problem in a completely different scenario also. For now though, I'll leave it.

Thanks for the help Sushant!

Steve.

Answers (0)