ABAP Web Dynpro – Adding a Custom Dropdown w/Search Help

Home / Blog / ABAP Web Dynpro – Adding a Custom Dropdown w/Search Help

I recently struggled for a while with my latest challenge.  I’m back in the Web Dynpro world and I was trying to add a custom drop down list to the service material (for anyone that has used this, wouldn’t it be nice to only see the service materials, not the full pulldown for any material?).  Anyway, the issue I encountered is that if the data element has an explicit search help defined (matnr/matsv both have this).  Well, you can just override this.  I found that you need to explicitly turn the search help off.  Here’s the example code to do it.

in my example, MATSV is an attribute within a node.

data: NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
L_NODE type ref to IF_WD_CONTEXT_NODE.
data: LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST ,
L_VALUE type WDR_CONTEXT_ATTR_VALUE.
L_NODE = WD_CONTEXT->GET_CHILD_NODE( ‘REPAIR’ ).
NODE_INFO = L_NODE->GET_NODE_INFO( ).

***Fill value table: LT_VALUESET
*** the next line is needed if you find that just assigning the value set isn’t working or if you know
*** there is an explicit search help assigned.
NODE_INFO->SET_ATTRIBUTE_VALUE_HELP( NAME = ‘MATSV’ VALUE_HELP_MODE = ‘111’ VALUE_HELP = ” ).
*** ‘111’ is for automatic search help.  set the help to blank.
*** then you can set the value set for the attribute.
NODE_INFO->SET_ATTRIBUTE_VALUE_SET( NAME = ‘MATSV’ VALUE_SET = LT_VALUESET ).

It seems I only need to remove the search help when the search help is directly tied to the data type.

thanks for reading,

As always, thanks for reading and don't forget to check out our SAP Service Management Products at my other company JaveLLin Solutions,
Mike

Leave a Reply

Your email address will not be published. Required fields are marked *