cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh query with selected dropdown on MonthYear

paumcl
Explorer
0 Kudos
287

Hello dear community,

I would need your help/idees on my following issue:

I have four queries that are all restricted to a single CalMonth in the global filter via an user exit. The query is embedded in a SAC story. The requirement is, that the user can change the CalMonth.

My idea would have been to create another query with the current year and add it to the story with a DropDown box.

The problem that I face now is, how can I transfer the selected CalMonth from the DropDown to the queries?

I used the following coding in the DropDown:

var month = InputControl_1.getInputControlDataSource().getActiveSelectedMembers();

TILE_KPI_EBIT.getDataSource().setVariableValue("X_CALMONTH_05", month);

This fails because of an invalid argument because the system can not convert from “Array of MemberInfo” to “string…”

But I didn’t find any way of converting correctly.

Alternatively, is there a way of refreshing the Story via a button and open the prompt variable window? Editing the prompts does not really work as I can not select all datasources at once. Merging the variables in not really an option as this is not visible for the enduer.

Thanks in advance

Clemens Paumgartten

moshenaveh
Community Manager
Community Manager
0 Kudos

Welcome to the SAP Community! Thank you for visiting us to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Secondly, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.

Finally, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

Accepted Solutions (1)

Accepted Solutions (1)

N1kh1l
Active Contributor
0 Kudos

paumcl

The return from the below API is of type member info array and not string array

var month = InputControl_1.getInputControlDataSource().getActiveSelectedMembers();

try the below and see

TILE_KPI_EBIT.getDataSource().setVariableValue("X_CALMONTH_05", month[0].displayId);

Br.

Nikhil

N1kh1l
Active Contributor
0 Kudos

paumcl

There was some issue with formatting option in code. I have updated it now as below

TILE_KPI_EBIT.getDataSource().setVariableValue("X_CALMONTH_05", month[0].displayId);

Answers (1)

Answers (1)

paumcl
Explorer
0 Kudos

Hello Nikhil,

thanks a lot for your help, highly appreciated!

I had to do some slicing, as the month[0].displayID is delivering e.g. 06.2023 and the varible X_Calmonth_05 requests 202306. But now it is working fine.

BR Clemens

N1kh1l
Active Contributor
0 Kudos

paumcl

I was not aware of the format of the month value returned but I am glad its working.

Br.

Nikhil