cancel
Showing results for 
Search instead for 
Did you mean: 

Search Functionality in SAC Application Deisgner for Dropdown

varun0555
Explorer
0 Kudos

HI ,

Wanted to apply Search function for dropdown by using inputfield

Previously have done in Sup lumira by using below blog

https://blogs.sap.com/2014/11/21/sap-design-studio-tips-tricks-6-search-functionality-in-a-dashboard...

Can anyone let me how to replicate in SAC .?

any help would be highly appreciated

Thanks,

Varun

Accepted Solutions (0)

Answers (4)

Answers (4)

JefB
Active Contributor
0 Kudos

Since QRC3 release you can use the "input controls" widget in applications which have a standard search functionality.

saurabh_sonawane
Active Contributor
0 Kudos

Hi,

var Input= this.getValue(); 

var i=0; 

var variable_name=Table.getDataSource().getMembers("Dimension"); 
var filter_data = {""};
var a =0;for(i=0;i<variable_name.length;i++) 
var des = variable_name[i].description;{if(des.startsWith(Input)){ 
filter_data[a]= variable_name[i].id;	
a++;}} 

Table_1.getDataSource().setDimensionFilter("Customer_Name_",filter_data);
saurabh_sonawane
Active Contributor
0 Kudos

hi

var filter_data ={""};
make the filter_data as a array in the code.

Thanks,

Saurabh S.

saurabh_sonawane
Active Contributor
0 Kudos

Hi varun0555,

If your issue is solved can you please accept the answer.

Thanks,

Saurabh S.

saurabh_sonawane
Active Contributor
0 Kudos

Hi varun0555,

If you find above info helpful, feel free to up-vote (arrows on the left) and accept (accept button at the bottom). This will help grow knowledge based.

Thanks,

Saurabh S.

former_member692417
Participant
0 Kudos

Error in code. Please check again.

saurabh_sonawane
Active Contributor
0 Kudos

Hi,

var Input= this.getValue(); 

var i=0; 

var variable_name=Table.getDataSource().getMembers("Dimension"); 
var filter_data;
var a =0;for(i=0;i<variable_name.length;i++) 
var des = variable_name[i].description;{if(des.startsWith(Input)){ 
filter_data[a]= variable_name[i].id;	
a++;}} 

Table_1.getDataSource().setDimensionFilter("Customer_Name_",filter_data);

Try this

varun0555
Explorer
0 Kudos

Looks like some issue at filter_data[a]

it is saying please use dot operator for member access

any idea?

saurabh_sonawane
Active Contributor
0 Kudos

Hi,

Step 1 - Create a global variable it should be array = matinput

step 1 Insert the Image of search in the canvas (on click event try to display the popups)

step 2 .try to develop a one new popups

step3 - on popups try to insert one input text box and one OK button

step4 - on OK select button write the below code

matinput = InputField_1.getValue().split(",");

CheckboxGroup_Material.setSelectedKeys(Matinput);

after this apply the filter to the chart .using matinput variable.

Note when user input in the text box they have to insert commo after every material .

Check the below link

https://answers.sap.com/questions/13043320/how-to-add-search-option-to-checkbox-group-in-sac.html

Thanks ,

Saurabh S.

varun0555
Explorer
0 Kudos

HI Saurabh,

Thanks for your reply

Just followed your script (below) in other blog like where input field should act as filter to table and set value to dropdown

but somehow it is not working when i type anything table is empty it is fitering out but table is empty it is not capturing data

do i need to enter full name in input field?

can you please help me?

var Input= this.getValue(); 

var i=0; 

var variable_name=Table.getDataSource().getMembers("Dimension"); 
var filter_data;
var a =0;for(i=0;i<variable_name.length;i++) 
var des = variable_name[i].description;{if(des.startsWith(Input)){ 
filter_data[a]= des;	
a++;}} 

Table_1.getDataSource().setDimensionFilter("Customer_Name_",filter_data);
0 Kudos

Hello Suresh,

I am getting an error from SPLIT function on runtime, "cannot read properties of undefined (reading 'split')".

I am getting the value from UI5 widget, might this cause the error that the variable is not recognised by SAC?

Thanks,

Tomas.