cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Screen Personas : How to link a field with another field in a table

Former Member
0 Kudos

I would like to paste the value from the field article that i have just created and copy it into the table below then hide table so that the screens is more simplified. Please advice on how can go about this. Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

To do copy and paste you need to invoke a script, so you need a script button to press. You can link your custom field to this script button so that typing an article and pressing "Enter" will invoke the script, rather than requiring the user to press the script button. Having built the link you can even hide the button.

Pasting the value might be more complicated, although it looks like you might be trying to create a one-line purchase order. If so, that makes life easy. Record a script where you type a value into the Article field of the first line of the table, and then change the "Enter Value" action to a "Paste Value" action and paste the value you copied. If you look at the cell references in that recording, you'll see how to address individual cells in a table, should you wish to paste into lines other than the first.

Does that help? If you need more info, please ask.

Steve.

Former Member
0 Kudos

Can you please elaborate more about how to

1)pressing"Enter will invoke the script"

In the Script you can actually replace a the hot key to invoke the script. However it requires ctrl and another key for the script to work. However will it be possible to only press on one key and it will invoke the script

2) hide the script button

3) How to combine link all the flavors together?

Thanks

Stacy


Former Member
0 Kudos

Sure. In the video below (you might need to view it full size to see the detail) you see a simple example of looking up the real name of a user (me) from the username. In the first version, there's a script button you press to do the lookup. I don't show the script, but it does the obvious thing of invoking SU01 and grabbing the contents of the field labelled "Format", which contains the full name.

Then you'll see me invoke the Personas editor and link the text field to the lookup button. When I do the lookup the second time you see I type in a username but don't press the button. What you can't see is that I hit <ENTER> after typing the username. That's what the "link" I created does - press the selected button when enter is pressed.

Then you'll see me invoke the editor again and hide the button. Since we no longer need to press it, it doesn't need to be visible. Pressing <ENTER> in the text field will still press it, even if you can't see it. But you need to hide it, not delete it! And in the final look up in the video you'll see I still get the user's full name after hitting enter, even though the script button doing the work is no longer on the screen.

Does that make more sense? By the way, you can link standard SAP fields to script buttons too, not just custom fields you've added in Personas. That is occasionally useful for enhancing transactions with extra data without having to resort to the clunkiness of asking people to hit a button to fill in some extra fields. It feels more "integrated" if data appears when you just hit <ENTER>!

Steve.

Former Member
0 Kudos

Hi Steve,

Is there a way to link a standard field/button to a script ?? If yes can you please show how

Thanks,

Mary

Former Member
0 Kudos

Yes, you can link a standard field to a script button in just the same way as you link a custom field. It works just as in the video above.

Steve.

Former Member
0 Kudos

I tried but the Link text box option is grayed out for me when i select any standard buttons to which i want to link the script button.

Thanks,

Mary

Former Member
0 Kudos

Right, this doesn't work with buttons. To associate a script with a standard button you need to replace the button. Create a new script button to do what you need, including possibly pushing the standard button at an appropriate point, then hide the standard button and put your new one in its place.

Does that make sense?

Steve.

Former Member
0 Kudos

Thanks Steve,

I had tried this earlier with other buttons/tabs when i reference it in a script and hide, the script failed but doesn't seem to happen now.

Mary

Former Member
0 Kudos

The script execution engine has had quite a lot of work done on it under the covers recently, and has got more reliable. This has always been supposed to work, but maybe a bug prevented it from working in your case in the past? In any case, it is good it works now!

Steve.

Former Member
0 Kudos

HI Steve,

Thanks for replying me so promptly on my previous posts on personas queries.

Can you demonstrate on how the IF function in the script button can be used as?

Can we do a simple logic whereby IF A=B then  C will happen ?

Stacy

Former Member
0 Kudos

Hi Stacy. I'm at TechEd at the moment so it is hard for me to answer. I'll get back to you in a few days if that's ok. I'm not ignoring you!

Steve.

TobiasQueck
Advisor
Advisor
0 Kudos

Hi Stacy,

Please have a look at http://scn.sap.com/docs/DOC-35565. It shows how to use IF conditions in a simple example.

@Steve: Enjoy TechEd!

Cheers,

Tobias.