Skip to Content

Change Date Format to User's Locale in Design Studio 1.6

pic-1.jpg pic-2.jpg

Hello,

I am having a requirement to change the Date format according to user's locale in Design Studio.

I have defined a variable of type "String" in Global Script Variables of my Design Studio Application which is exposed as URL Parameter.

I am passing a date range in this URL parameter from Web Dynpro Application in a range in the format MM/DD/YYYY - MM/DD/YYYY e.g. 4/19/2018 - 12/31/2018.

This Is later assigned to a Bex variable (of the type interval) -

4/19/2018 - 12/31/2018 .

Now when user changes the language from browser to English UK or German DE then this gives an error message that "Value 4/19/2018 - 12/31/2018 is not a correct value ".

This Design Application is opened in a separate browser Window when a button is clicked in Web Dynpro application. User is changing language in browser window where Design Studio application is opened.

Please help if this problem can be solved? Is there any way in Design Studio application to convert it into user Locale?

pic-1.jpg (84.1 kB)
pic-2.jpg (81.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 20 at 12:39 PM

    Hi Harry,

    On further thought, I suggest you try the following code:

    APPLICATION.setVariableValueExt("D0COMP_COD_CDOOI", X_COMP_CODE);
    APPLICATION.setVariableValueExt("DDBG_CDOOI01", X_DBG);
    var d1 = Convert.subString(X_CH_ON, 0 , 8);
    var d2 = Convert.subString(X_CH_ON, 11 , 19);
    DS.setFilter(<Date Dimension>, {"low": d1, "high": d2});

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Harry,

      Unfortunately, I haven’t managed to find a range syntax that will work with a Selection Option BEx Variable. Going by some other older posts it seems there is a possibility this might not be supported in Design Studio but I can’t say for sure.

      I’ll let you know if I find something concrete. There might be a mention of it in the Product Availability Matrix for Design Studio.

      Regards,

      Mustafa.

  • Apr 19 at 10:44 PM

    Hi Harry,

    I am guessing you are using setVariableValueExt() to set the BEx Variable. If so, I suggest you use setVariableValue() instead and pass the date range in internal format.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Dear Experts,

      Can any one help me with format to Pass Values to Bex Variable of the type Selection Options? Couldnt find it any where.

      I am trying to pass two Dates D1 and D2 with Between Option in Design Studio to a Bex Variable.

      pic-4.jpg (63.0 kB)
  • Apr 20 at 10:23 AM

    Dear Mustafa,

    Thanks for your response. I tried as suggested above however the value is not passed to the bex variable. Do i need to split before assigning the range to bex variable ?

    I tried splitting the values in Design Studio and assign it to Bex Variable ( range type), However, didnt work. It is working if I pass only one value.

    CASE 1

    APPLICATION.setVariableValueExt("D0COMP_COD_CDOOI", X_COMP_CODE);
    APPLICATION.setVariableValueExt("DDBG_CDOOI01", X_DBG);
    var d1 = Convert.subString(X_CH_ON, 0 , 8);
    var d2 = Convert.subString(X_CH_ON, 11 , 19);
    APPLICATION.setVariableValue("D0CH_ON_CDIOI01", (d1+ "-" +d2));

    this doesn't pass value to Bex Variable

    Case 2

    APPLICATION.setVariableValueExt("D0COMP_COD_CDOOI", X_COMP_CODE);
    APPLICATION.setVariableValueExt("DDBG_CDOOI01", X_DBG);
    var d1 = Convert.subString(X_CH_ON, 0 , 8);
    var d2 = Convert.subString(X_CH_ON, 11 , 19);
    APPLICATION.setVariableValueExt("D0CH_ON_CDIOI01", (d1+ "-" +d2));

    this doesn't pass value to Bex Variable

    CASE 3

    APPLICATION.setVariableValueExt("D0COMP_COD_CDOOI", X_COMP_CODE);
    APPLICATION.setVariableValueExt("DDBG_CDOOI01", X_DBG);
    var d1 = Convert.subString(X_CH_ON, 0 , 8);
    var d2 = Convert.subString(X_CH_ON, 11 , 19);
    APPLICATION.setVariableValue("D0CH_ON_CDIOI01", d1);

    With this one I can see the Date value as per User setting.

    So, struggling to pass the Date Range.

    Add comment
    10|10000 characters needed characters exceeded