cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying standard field's search help with collective search help

Former Member
0 Kudos

Hi,

We have a requirement to modify one standard input field search help with a collective search help. The new search help should have one "Structure search" and the other one should be a dictionary search help.

Please guide me on how to achieve this functionality.

Regards,

Suman

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Suman,

Could you elaborate your requirement litle more.

Are you referring to the standard input field in WDA?

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

I meant standard WDA's input field. In one of the standard WDA there is a input field called "location" with elementary search help. We are trying to modify this by adding Collective search help. The catch is one of the search helps should be of tree structure like org structure.

Regards,

Suman

ramakrishnappa
Active Contributor
0 Kudos

Hi Suman,

You can achieve your requirement as below

  • Create a custom search help like ZSH_LOCATIONS
  • Go to the view of the standard component and enhance the view
  • Now, you will be able to use PRE-EXIT, POST-EXIT & OVERWRITE EXITS
  • Go to the method WDDOMODIFYVIEW( ) and create an POST_EXIT method
  • Add the below code in the method

DATA lo_node TYPE REF TO if_wd_context_node.
  DATA lo_node_info  TYPE REF TO if_wd_context_node_info.


  CHECK first_time EQ abap_true.


  " Get node ref
  "==========================
  lo_node = wd_context->get_child_node( name =
wd_this->wdctx_personaldata ).

  " get node info reference
  "=============================
  IF lo_node IS BOUND.
    lo_node_info = lo_node->get_node_info( ).
  ENDIF.
  " Rerurn the control if lo_nod_info is not bound
  "==========================
  IF lo_node_info IS NOT BOUND.
    RETURN.
  ENDIF.
  " set the value help for attribute: firstname
  "==========================
  lo_node_info->set_attribute_value_help(
    EXPORTING
      name            = 'LOCATION'  " This is the attribute name of context node
   value_help_mode = if_wd_context_node_info=>c_value_help_mode-DDIC
      value_help      = 'ZSH_LOCATIONS'   " this is the search help name
  ).

Note: Replace node name and attribute names in the above code as per your requirement

Please refer the below document to know more about how to enhance standard component

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

  The above is really helpful. As part of this requirement, we need to show a standard tree component as search help. Please check the below screenshot.

Again thanks for your timely help.

 

Regards,

Suman