cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to select newly changed drop down value.

0 Kudos

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

0 Kudos

tamas.hoznek

Hi Tamas,

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

Thanks

Parul

Accepted Solutions (1)

Accepted Solutions (1)

Thomas_Mangler
Active Participant
0 Kudos

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
0 Kudos

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;
Thomas_Mangler
Active Participant
0 Kudos

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;

Answers (0)