Programmed Search Help in Web Dynpro For ABAP PDF
Programmed Search Help in Web Dynpro For ABAP PDF
Author Bio
Vishal Kapoor is working with Accenture from last two years. He has 5 years of experience in HR ABAP, WebDynpro and OO ABAP.
Table of Contents
What is Freely Programmed Search Help .......................................................................................................... 3 How to Create is Freely Programmed Search Help ........................................................................................... 3 Related Content ................................................................................................................................................ 12 Disclaimer and Liability Notice .......................................................................................................................... 13
Make sure that your view V_FPH is embedded in the window WD_VALUE_HELP and not in the default window created. The window WD_VALUE_HELP comes from the interface implemented above. So Delete the default window created with the component and embed your view in window WD_VALUE_HELP.
Go to the method SET_VALUE_HELP_LISTENER in COMPONENTCONTROLLER. This method has come from the implemented interface. In this method, just store the listener reference in the attribute created in above step.
Create a context node name FLIGHT in COMPONENTCONTROLLER and map it into VIEWCONTROLLER
Create one TABLE UIElement in view V_FPH and bind the context node FLIGHT with DataSOurce property of it.
Create the binding of table with context node so that table can have as many columns as per the attributes defined in context node FLIGHT. For that, right click on the TBL_FLIGHT (name of table UIElement) and select Create Binding from context menu.
Select the standard cell editor as TextView and check all the check boxes for binding.
Click OK to complete the table control design. It looks like below in View Editor.
Create one button in the above screen. This will be used to close the search help screen. Name it Close. Associate OnAction event On_CLOSE with this button.
method ONACTIONON_CLOSE. *Select the currently selected record and pass it to the field where F4 is triggered * i.e our consumer component ZFP_CONSUMER. DATA lo_listener TYPE REF TO if_wd_value_help_listener. DATA lv_attrib_name TYPE string. *Read the attribute CARRID. We will pass this value in input field of consumer component DATA lo_nd_flight TYPE REF TO if_wd_context_node. DATA lo_el_flight TYPE REF TO if_wd_context_element. DATA ls_flight TYPE wd_this->element_flight. DATA lv_carrid TYPE wd_this->element_flight-carrid. * navigate from <CONTEXT> to <FLIGHT> via lead selection lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ). * get element via lead selection lo_el_flight = lo_nd_flight->get_element( ). * get single attribute lo_el_flight->get_attribute( EXPORTING name = `CARRID` IMPORTING value = lv_carrid ). lo_listener = wd_comp_controller->value_help_listener. lv_attrib_name = lo_listener->f4_attribute_info-name. lo_listener->f4_context_element->set_attribute( value = lv_carrid name = lv_attrib_name ). *Fire the event to indicate that data selection is done wd_comp_controller->fire_vh_data_selected_evt( ). *Colse the search help window
wd_comp_controller->value_help_listener->close_window( ). endmethod.
Fill the FLIGHT context node in the WDDOINIT method of COMPONENTCONTROLLER. There will be the possible values for selection.
Create component ZFP_CONSUMER in object navigator (se80) with one view V_FPH. Declare the usage of component ZFP_PROVIDER, created in above steps.
Create 1 node FLIGHT (cardinality 1:1) and 1 attribute named CARRID of type string in the VIEWCONTROLLER. In the properties of attribute CARRID, take input help mode as freely programmed and input help component usage as FREE_SEARCH (or whatever name you have given during defining the component usage of ZFP_PROVIDER in above step).
Create the application for ZFP_CONSUMER component and test it. The browser screen looks like:
Select any row from popup and press Close button. Values will be copied in the input field.
Related Content
Please include at least three references to SDN documents or web pages. Inside SDN For more information, visit the ABAP homepage.