cancel
Showing results for 
Search instead for 
Did you mean: 

Selection of a View based on Dropdown Values

Former Member
0 Kudos

Hi All,

I have a search view, and a result view for that which is working fine. Now i want to add a new field in the search view with dropdown values,so that when i change the values in the dropdown the search view should change.How can i do this .

which methods should i implement.

Regards,

Amrit

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189678
Active Contributor
0 Kudos

Create an event handler to catch the event of selecting a value from the list. In that method call DO_CONFIG_DETERMINATION.

Also redefine the DO_CONFIG_DETERMINATION method to accomodate your configuration which has to be loaded once you select the Values from teh drop down list.

Regards,

Harshit

Former Member
0 Kudos

Hi Harshit,

thanks for your reply but actually i have created a seperate view referring to "builheaderadvancesearch" (struct.category) for that dropdown field and added to the same viewset in searchview. I have created the search view for "builheaderadvancesearch" and result view for "builheader" .

Now i am able to see the field with dropdown values in searchview with dropdown values like corporate account,group,individual account.... as in "BP_HEAD_SEARCH" but nothing else except this .I am working very similar to the standard component "BP_HEAD_SEARCH".But i am very much confused from the many context nodes created in the standard component like : UI, SEARCH, SHUFFLER, SEARCHRESULT...I am not able to understand why these many context nodes are created in every view.

please suggest me what else should i do.

Thanks & Regards,

Amrit

Former Member
0 Kudos

Hi Harshit,

First make sure that you have created the different configurations to the view with different object types.

Then enhance the DO_CONFIG_DETERMINATION method of the implementation Class of that view,

1. As mentioned by you, the field based on which u wnat the view to be changes is there in the Search view.Si, I guess it can in the SEARCH context node of the view.So, try to read the current entity of the SEARCh context node,

lr_entity ?= me->typed_context->search->collection_wrapper->get_current( ).

2. Now, try to read the value of that dropdown field,

lr_entity->get_property_as_value( EXPORTING iv_attr_name = '<Dropdown-field name>'

IMPORTING ev_result = value ).

3. Now, this value can be either of the dropdown values like, corporate account, group or individual account.Based on this value, do the mapping to the configuration object type and set the config keys,

IF value = 'Corporate'.

me->set_config_keys( iv_object_type = '<Object type for Corporate Config view>'

iv_object_sub_type = 'DEFAULT'

iv_propagate_2_children = abap_true ).

ELSEIF value = 'Group'.

me->set_config_keys( iv_object_type = '<Object type for Group Config view>'

iv_object_sub_type = 'DEFAULT'

iv_propagate_2_children = abap_true )...........

Similarly, do it for all other dropdown values.

Hope this helps you!

Thanks

Veena.

Former Member
0 Kudos

Hi Veena,

Thanks for your reply. I think that this should work but i don't know why i am not able to create different configurations for views.

Even if i am giving the role key,object type and subobject type yet i am not able to create new configuration.

Thanks

Amrit

former_member189678
Active Contributor
0 Kudos

copy the standard configuration and then put the config key and change the necessary attributes which you want to be displayed on the UI.

Regards,

Harshit