on 05-10-2016 1:38 PM
I have a textbox that i need to paste a User ID and User E-mail into from another transaction. I can copy them both across fine but pasting the second value always overwrites the first pasted value. Is there a way to make it so the script pastes the first value and then pastes the second value into the text box as well as it instead of overwriting it?
Thanks
Hi Kyle,
Do you have two different variables to get the values from User ID and User E-mail?
Could you elaborate on the way you get the values?
I created a flavor in SMEN to get data from SU01. Of course, I am passing the User ID, but I am retrieving the first name + last name to a "name" variable, and retrieving the email address to a "email" variable:
session.findById("wnd[0]/tbar[0]/okcd").text = "su01";
session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/usr/ctxtSUID_ST_BNAME-BNAME").text =iduser;
session.findById("wnd[0]/tbar[1]/btn[7]").press();
var name =
session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_FIRST").text + " " +
session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_PERSON_NAME-NAME_LAST").text;
var email = session.findById("wnd[0]/usr/tabsTABSTRIP1/tabpADDR/ssubMAINAREA:SAPLSUID_MAINTENANCE:1900/txtSUID_ST_NODE_COMM_DATA-SMTP_ADDR").text;
session.findById("wnd[0]/tbar[0]/okcd").text = "/n";
session.findById("wnd[0]").sendVKey(0);
session.findById("wnd[0]/usr/lblPersonas_1459537639756").text = name;
session.findById("wnd[0]/usr/lblPersonas_1462884636830").text = email;
Kind regards,
Cris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You could use some simple javascript to achieve this. Copy your value as normal and call it say "user".
Use javascript such as " saveduser = args.user"
repeat for the email such as "savedemail = args.email"
When you want to paste them, again using javascript along these lines:
args.user = saveuser
args.email = savedemail
Then create a message combining both values such as:
args.message = "User name is" + args.user + " email address is " + args.email
Finally, paste the message into the resepective text field.
hope this helps,
Like Steve has said, use the calculate in javascript function in Personas 2.(Sorry I should have said use that step in my original reply)
It does work, as it was Steve who helped me out with a very similar issue I had sometime ago.
good luck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, you can concatenate several strings in JavaScript for Personas 3.0 with the + operator
var combinedString = string1 + string2;
To add e.g. a blank use:
var combinedString = string1 + " " + string2;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.