Skip to Content
avatar image
Former Member

Dynamically change search help associated with a field

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 11, 2010 at 04:18 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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