Skip to Content
avatar image
Former Member

Set a Default Period for the Drop down Box in SAP Design Studio

Hi Everyone, i am struck on a requirement and need assistance. I have a HANA view specifically built to populate Month values. Data looks as below

Month Key Month Name

201701 Jan 2017

201702 Feb 2017

201703 Mar 2017

..........................................

201709 Sep 2017

In my Drop down box i want the default value to be shown as Aug 2017. When i used the binding properties to bind the Month Name dimension to the drop down box the default value assigned is Jan 2017. No matter how i sort it in edit initial view it still defaults the Month value as Jan 2017 and Sep 2017 is in the bottom of the list. I tried to change the Sort --> By Member --> By Ascending or Descending and it still shows Jan 2017 as default.

My users are ok if Jan 2017 appears top in the list but default value should be Aug 2017 for the current month. And Sep 2017 should be default when the dashboard is opened in October.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 15, 2017 at 03:55 AM

    Hi Rajasekhar,

    Have you tried using the setSelectedValue() script method of the Dropdown Box to set the desired default value?

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 02, 2017 at 06:38 AM

    Hi Rajasekhar,

    As Mustafa mentioned, you have to give internal key value as setSelectedValue() on startup. In order to make it dynamic based on current month, you can write a simple logic by fetching current date from APPLICATION.getInfo().DateNowInternalformat . That will bring you 20171002 today. substring() and get your month and calculate previous month. Then you can set this variable with year as selected month as per your requirement.

    Regards,

    Nikhil Joy

    Add comment
    10|10000 characters needed characters exceeded