Skip to Content
0

Rolling Periods on Fiscal Year/Period -Design Studio 1.6

Sep 21, 2017 at 07:19 PM

210

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Mustafa Bensan Sep 21, 2017 at 07:50 PM
0

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.

Show 11 Share
10 |10000 characters needed characters left characters exceeded

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

capture.png (6.4 kB)
0

Hi Jothi,

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

Regards,

Mustafa.

0

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

k4capture.png (5.4 kB)
0

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.

0

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

0

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.

0

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

0

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

0
Show more comments

Jothi,

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

0

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

0
avatar image
Former Member Dec 05, 2017 at 09:48 AM
0

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


error-script.jpg (13.5 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Poovarasan,

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

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

Thanks for the info Mustafa..

0