Wd_this->SHelp_listener->f4_context_element->set_attribute(Įxporting name = wd_this->SHelp_listener->f4_attribute_info-name * Returns value to field that called search help
)->get_controller( )->get_context( )->add_context_attribute_change(Įlement = wd_this->SHelp_listener->f4_context_elementĪttribute_name = wd_this->SHelp_listener->f4_attribute_info-name Wd_this->SHelp_listener->f4_context_element->get_node( )->get_node_info(
* so that it knows fields have changed otherwise ignores new returned values * Only required when adding as enhancement to FPM application, sets change attribute * If no value entered, add some text just so something is returned to original field Importing static_attributes = element_struc ). Name = if_componentcontroller=>wdctx_my_node ).Ĭontext_element = context_node->get_element( ). * Retrieve value of webDynpro field on search/value help screenĬontext_node = wd_context->get_child_node( name = 'MY_NODE').Ĭontext_node->GET_ATTRIBUTE( exporting NAME = 'VH_FIELD'Ĭontext_node = wd_context->get_child_node(
#WEB DYNPRO SELECT OPTIONS CODE#
which was added when you implemented the IWD_VALUE_HELP interfaceĪdd the following ABAP code to the RETURN method method RETURN.ĭata: context_node type ref to if_wd_context_node,Ĭontext_element type ref to if_wd_context_element,Įlement_struc type if_componentcontroller=>element_my_node. Step 7 - Component controller Methods First take note of the existing methods for example the SET_VALUE_HELP_LISTENER. Right click on component name and select activate) Step 6 - Activate It is a good idea to activate everything created so far!!! (i.e. Now create a custom event called SELECTED_VALUE Step 5 - Component controller Events First notice the events that have already been created by implementing the VALUE_HELP interface. Also ensure you tick the public checkbox. SHELP_LISTENER) with type IF_WD_VALUE_HELP_LISTENER. Step 4 - Component controller Attributes Notice the auto created Component controller attributes which are available to youĪdd a new attribute (i.e. Step 3 - Create context node/attribute within component controller We just need a quick example node and attribute to capture a value on our search help screen.Ĭreate a node (i.e. Notice the red traffic light, click Reimplement button and this should turn to a green traffic light. Step 2 - Implement Value Help interface Within the Implemented interfaces tab of the new WDP component add the IWD_VALUE_HELP interface Step 1 - Create new Web Dynpro Component Within SE80 create a new Web Dynpro Component (i.e. The second way is to build a custom value help which is called when the user clicks on the search help /F4 dropdown option.īelow are the very simple steps required to create a custom programed search help and use it on a UI input field. You could then pass back any resultant value to the calling screen field. One way to do this would be to simply add a button UI element next to your field which calls a popup view or second screen where you can add all your search help functionality.
via SE11.Īutomatically using standard search helps can be very useful and is one of the benefits of Web Dynpro applications.īut there may be times when you want to add your own custom built search help which does something a bit more complicated than displaying a list of values with search boxes. Just for info I am going to try and refer to these as a search helps rather than a value helps as this is what they have always been called, and are still called in core SAP i.e.
If you assign a dictionary data type to a UI field it will automatically use any search help assigned to this field.