cancel
Showing results for 
Search instead for 
Did you mean: 

Rolling Periods on Fiscal Year/Period -Design Studio 1.6

jyothirmayee_s
Active Contributor
0 Kudos

I have a requirement to show 13 month rolling period where the user will select intially from the Fiscal Year/Period prompt.

I was able to get 13 month rolling periods in a drop down but when the user selects , application forces to enter prompt values and when they select, then only that period values are displaying.

I have Drop Down On select as DS_1.setVariableValueExt("0P_FPER", DROPDOWN_1.getSelectedValue());

Any help is appreciated,

Thanks,

Jothi

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member265529
Contributor
0 Kudos

Hi Jyothi,

In your script, it seems to be you are passing value to info object not the variable.

You need to provide the variable name instead of info object name in the highlighted area.

Please let me know if you faced issue after the change.

Thanks,

Poovarasan

MustafaBensan
Active Contributor
0 Kudos

Hi Poovarasan,

I believe “0P_FPER” is one of the standard SAP BEx Variables rather than an info object name.

Regards,

Mustafa.

former_member265529
Contributor
0 Kudos

Thanks for the info Mustafa..

MustafaBensan
Active Contributor
0 Kudos

Jothi,

How are you populating the dropdown box? It looks like you are using a BEx data source. In that case, I suggest you use setVariableValue() instead of setVariableValueExt() and make sure the dropdown is populated with internal key values of Fiscal Period.

Regards,

Mustafa.

jyothirmayee_s
Active Contributor
0 Kudos

Thanks for the reply.

I have a FY Period structure from 0-12 months in BEx query with FYP prompt.

I tried that, still drop down gives me only the month I have selected and not 13 months from the selected month though,

Just like Navigation filter in Analyzer.

DS_1.setVariableValue("0P_FPER", DROPDOWN_1.getSelectedValue());

May the FYP in drop down is not interacting with the prompt I'm entering.

Also, Is there is a way that user doesn't need to enter prompt second time and just get 13 months rolling after selecting month and year from Drop down?.

Thanks,

Jothi

MustafaBensan
Active Contributor
0 Kudos

Hi Jothi,

Can you clarify how you are actually populating the dropdown box?

Regards,

Mustafa.

jyothirmayee_s
Active Contributor
0 Kudos

Hi Mustafa,

I have a code that actually brings in LoV's in Drop down box.

I was able to display 13 months rolling after selecting value from drop down, Only issue is after selecting month and year from the drop down, Prompting me to reenter FYP, which I want to bypass.

Here is the warning msg I get when I pick FYP.

Thanks,

Jothi

MustafaBensan
Active Contributor
0 Kudos

Hi Jothi,

In order to help you further, can you post the following?

1) The script code for populating the dropdown box with the LoV and a confirmation of where in the application this code is executed;

2) The script code in the "On Select" event of the dropdown box.

Thanks,

Mustafa.

jyothirmayee_s
Active Contributor
0 Kudos

Here are the details Mustafa,

1) The script code for populating the dropdown box with the LoV and a confirmation of where in the application this code is executed;

Pretty much similar to the code below.

var defaultYear = DS_1.getVariableValueText("0P_FPER"); var defaultYearValue = Convert.stringToInt(defaultYear); var yearMemberKey = ""; var yearMemberKeyValue = 0; var yearMemberText = ""; var yearList = DS_2.getMembers("0FISCPER", 100);

yearList.forEach(function(yearMember, index)

{ yearMemberKey = yearMember.internalKey; yearMemberKeyValue = Convert.stringToInt(yearMemberKey); yearMemberText = yearMember.text;

if (yearMemberKeyValue <= defaultYearValue)

{ DROPDOWN_1.addItem(yearMember.internalKey, yearMember.text); } });

DROPDOWN_1.sort(true); DROPDOWN_1.setSelectedValue(defaultYear);

2) The script code in the "On Select" event of the dropdown box.

DS_1.setVariableValue("0P_FPER", DROPDOWN_1.getSelectedValue());

Thanks,

Jothi

MustafaBensan
Active Contributor
0 Kudos

Hi Jothi,

There could be a number of issues at play:

1) 0FISCPER is compounded with Fiscal Year Variant, which appears to be "K4" for in your case. Make sure "K4" is specified as a default value for the Fiscal Year Variant in the BEx Query definition so that you are not prompted for it each time;

2) There could be a mismatch between the formatting of the Fiscal Year Period (0FISCPER) key value obtained from the getMembers() method compared to the expected format of the 0P_FPER variable. You should check the expected format of the 0P_FPER variable as follows:

(a) Display the value of defaultYear after it has been set in your code

(b) Display the value of DROPDOWN_1.getSelectedValue() and compare the format to the format of defaultYear to ensure they are the same.

Regards,

Mustafa.

jyothirmayee_s
Active Contributor
0 Kudos

Hi Mustafa,

1. FY variant is default set to K4.

2. Yes, that's what it is happening.Mismatch with FYP key values.

a) defaultYear is giving 008/2017 - Prompt 0P_FPER is fine.. Only 0FISCPER is showing Key values as "K42017008"....so on.

Do you suggest to do a substring on the array?. I didn't find that option on Arrays

Thanks,

Jothi

MustafaBensan
Active Contributor
0 Kudos

You an do a substring on yearMemberKey and use that to populate the dropdown with correctly formatted values.

jyothirmayee_s
Active Contributor
0 Kudos

HI Mustafa,

Yes, I tried yearMemberKey = Convert.subString(yearMember.internalKey,2,9);

and it giving me 2017008 after truncating K4 but dropdown doesn't populate though.

Thanks,

Jothi

MustafaBensan
Active Contributor
0 Kudos

Jothi,

What do you mean by "the dropdown doesn't populate"? Are you applying the new substringed yearMemberKey in the DROPDOWN_1.addItem() call?

jyothirmayee_s
Active Contributor
0 Kudos

Apologies for the late reply Mustafa,

Yr.forEach(function(Yrlist, index) {

YrMemkey = Convert.subString(Yrlist.internalKey, 2,9);

Yrkeyvalue = Convert.stringToInt(YrMemkey);

Yrmemtext = Yrlist.text; if(Yrkeyvalue <= defaultyr){

//DROPDOWN_1.addItem(Yrlist.internalKey, Yrlist.text);

DROPDOWN_1.addItem(YrMemkey,Yrmemtext); } });

DROPDOWN_1.setSelectedValue(selectedValue);

Dropdown box doesn't display any values

Any input is greatly appreciated.

Thanks,

Jothi