Skip to Content

Unable to select newly changed drop down value.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 19, 2017 at 12:24 PM

    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
    
    Add comment
    10|10000 characters needed characters exceeded

    • 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;