Skip to Content
0

Unable to select newly changed drop down value.

Dec 13, 2017 at 06:49 AM

61

avatar image

Hi Experts,

I want to use custom drop down instead of using F4 help. For this I am using script applied on onSelect event of drop down. I am copying the selected value from drop down and pasting it to standard F4 help input field. But every time I select value from drop down it gives me the previously selected value instead of new one.

I am using SAP Screen Personas 3.0 with SP04.

Help me out if anyone knows the solution.

Thanks in advance.

Regards

Parul garg

10 |10000 characters needed characters left characters exceeded

@tamas.hoznek

Hi Tamas,

Kindly look into the issue as I am not getting any solution for this issue.

Thanks

Parul

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Thomas Mangler Dec 19, 2017 at 12:24 PM
0

Hi,

when using the "onSelect event" you can get the new value with "newKey".

var thisismynewkey = newKey;  'save newKey in variable
session.findById("wnd[0]/usr/cmbPersonas_150520833899797").key = newKey; 'set newKey in your Dropdown
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Thomas,

Thanks for your answer. Now through this line of code I am getting the updated key but text is still not updated. As you suggested to use 'newKey' for key, is there anything for text.

Following is the script I am using:

//save newKey in variable coming from dropdown
var thisismynewkey = newKey;
//save text in variable coming from Dropdown
var text = session.findById("wnd[0]/usr/cmbPersonas_151124865221376").text;
//set text to standard F4 help field
session.findById("wnd[0]/usr/ctxtSTC_SCN_HDR-SCENARIO_ID").text = text;
0

Hi Parul,

I think this is a bug in SP04 in the "onSelect Event". The Screen doesn't refresh after the event is fired.

Try it like this.

//save newKey in variable coming from dropdown
var thisismynewkey = newKey;
// set newKey in Dropdown
session.findById("wnd[0]/usr/cmbPersonas_151124865221376").key = newKey;
// Screen Refresh
sap.personas.scripting.executeScriptInternal({src:""});
//save text in variable coming from Dropdown (Not necessary, it's the same than "thisismynewkey")
var text = session.findById("wnd[0]/usr/cmbPersonas_151124865221376").text;
//set text to standard F4 help field
session.findById("wnd[0]/usr/ctxtSTC_SCN_HDR-SCENARIO_ID").text = text;
0