cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically change search help associated with a field

Former Member
0 Kudos

Hi all,

I have a field on my web dynpro app which is associated with a table field and displays fine with the correct search help. Is there an easy way to dynamically change the search help it uses? For example could i add some code to the WDDOMODIFYVIEW method which changes which search help this field used based on certain criteria?

Regards

Mart

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can achieve this feature without writing any code in WDDOMODIFYVIEW.

*Get the reference of context node information

Data: lo_node type ref to if_wd_context_node.

data lo_node_info type ref to if_wd_context_node_info.

lo_node = wd_context->get_child_node( 'Your context node name' ).

lo_node_info = lo_node>get_node_info( ).

*To set the search help, call the method

CALL METHOD lo_node_info->set_attribute_value_help

EXPORTING

name = 'Your attribute name with which you want to attach search help at run time''

value_help_mode = 101

value_help = 'your search help name of component usage name as per the search help selected'

Below values of value help mode you can use

deactivated = 101,

automatic = 111,

ddic = 121,

ovs = 131,

application_defined = 141,

Add this code to appropriate hook method or action handler which decides at run time for the value help attachment.

Regards

Vishal Kapoor

Former Member
0 Kudos

Thats great thanks very much,

just on question though how do i get the 'search help name of component usage name as per the search help selected'. Say if i wanted to display the standard search help 'PREMN' how would i go about getting a component usage for this or is that not how it works?

Regards

Mart

Former Member
0 Kudos

Hi

in the same method suppose if you want to use the ovs help then input help mode will be OVS ( number related to it ) and value_help parameter will have component usage name.

Same goes with freely programmed search help

in case of dictonary search help, just pass the search help name in CAPS in value_help parameter

Thanks

Vishal Kapoor

Edited by: vishal kapoor on Oct 12, 2010 2:52 PM

Former Member
0 Kudos

Hmmm my mistake indeed if you set it to 121 you can simply enter a SAP search help i.e.

CALL METHOD context_info->set_attribute_value_help

EXPORTING

name = 'DEPT'

value_help_mode = '121'

value_help = 'PREMN'.

Am sure i tried that before an it didnt work, oh well it does now so thank you very much. Dont suppose you know how I would implement this into a table. For example if i want the same field on different rows to use a different search help. I have got the following code to find the specific row of the table but am not sure how to assign the search help to just this row. any ideas?

Data: context_node TYPE REF TO if_wd_context_node,

lr_element TYPE REF TO if_wd_context_element.

context_node = wd_context->get_child_node( name = 'CONTEXT').

lr_element = context_node->get_element( ld_tabix ).

Regards

Mart

Answers (0)