HCM Processes & Forms: Web Dynpro ABAP Search Helps
After reading (and relying on) the many excellent blogs by Chris Solomon and the recent one by Derrick Banks, I thought it only fair to share some knowledge on an area that I find most useful (and previously frustrating) – search helps.
I came across the WDA search helps while implementing a bespoke version of the E-recruiting Requisition form (form scenario S_HRMSSRCF_REQUISITION). On this form there are two buttons ‘Select Template’ and ‘Select Position’. These both trigger Web Dynpro ABAP (WDA) search helps and return the data selected to the form. Since then, I have used this to apply WDA type search helps to several other forms with huge success.
How it works in a nutshell
HRASR00_PROCESS_EXECUTE uses IF_HRASR00_FORM_WINDOW as a component
and the search help implements IF_HRASR00_FORM_WINDOW as an interface.
The onMouseDown event of the button has code used by the WDDOMODIFYVIEW method of the FORM_EDIT view of WDA component HRASR00_PROCESS_EXECUTE. (I am sure you know this well as the main WDA HCM P&F component).
The WDDOMODIFYVIEW method uses the value used for the HRASR_FORM_WINDOW field and calls the popup window of that component. The data is then displayed according to how the component has been developed (OADP or ALV component usage probably) and selected. The values are then returned to the HRASR00_PROCESS_EXECUTE component via the interface node VALUE_HELP_DATA.
How it works in detail
To expand on the above:
1. The onMouseDown event of the button must pass the name of the Web Dynpro ABAP component.
In the example, this is HRRCF_C_POSITION. It must also pass the name of the ISR_EVENT as USER_EVENT_POPUP.
$record.CONTROL_PARAM.ISR_EVENT = “USER_EVENT_POPUP”
$record.HRASR_FORM_WINDOW.DATA[*].FIELD.value = “HRRCF_C_POSITION”
This is because the 2 values are processed by the WDDOMODIFYVIEW method of the FORM_EDIT view of WDA component HRASR00_PROCESS_EXECUTE. (I am sure you know this well as the main WDA HCM P&F component) and the search help popup window is displayed with the special data being passed though the method’s interface.
DATA component_name TYPE string.
CONSTANTS hrasr_form_window TYPE qisrdfieldname VALUE ‘HRASR_FORM_WINDOW’.
CONSTANTS user_event_popup TYPE string VALUE ‘USER_EVENT_POPUP’.
CONSTANTS user_event_check TYPE string VALUE ‘USER_EVENT_CHECK’.
DATA node_value_help_data TYPE REF TO if_wd_context_node.
DATA value_help_datas TYPE TABLE OF qisrsspecial_param.
DATA value_help_data TYPE qisrsspecial_param.
TRY.
* Evaluate name of search component
component_name = wd_comp_controller->isr_interface->get_special_data_with_index(
i_fieldindex = 1
i_fieldname = hrasr_form_window ).
CATCH cx_root.
ENDTRY.
IF NOT component_name IS INITIAL.
* Launch popup and Initialize variable for help component name so
* that help popup is only launched once.
wd_comp_controller->isr_interface->set_special_data_with_index(
i_fieldindex = 1
i_fieldname = hrasr_form_window
i_fieldvalue = space ).
wd_comp_controller->raise_popup( component_name = component_name ).
TRY.
CATCH cx_root.
ENDTRY.
ENDIF.
2. The MAIN window of the search help component will then display the data requested
In the case of the HRRCF_C_POSITION search help, this is via an OADP component usage. A row is selected via an interface method and the data is returned to the calling WDA via the CLOSE_POPUP event on the component controller by populating the VALUE_HELP_DATA interface node.
* send selected position back to form fields
value_help_data-fieldname = ‘POSITION_ID’.
value_help_data-fieldindex = 1.
value_help_data-fieldvalue = wd_this->position_id.
APPEND value_help_data TO value_help_datas.
value_help_data-fieldname = ‘POSITION_TEXT’.
value_help_data-fieldindex = 1.
value_help_data-fieldvalue = wd_this->position_text.
APPEND value_help_data TO value_help_datas.
* fill context for fields
node_value_help_data = wd_context->get_child_node( name = wd_this->wdctx_value_help_data ).
node_value_help_data->bind_table( value_help_datas ).
3. The second half of the WDDOMODIFYVIEW is then valid:
IF wd_comp_controller->cmp_form_window IS BOUND.
* Write data from the search compoinent back to ISR context
node_value_help_data = wd_context->get_child_node( name = wd_this->wdctx_value_help_data ).
node_value_help_data->get_static_attributes_table(
IMPORTING
table = value_help_datas ).
node_value_help_data->invalidate( ).
IF NOT value_help_datas IS INITIAL.
LOOP AT value_help_datas INTO value_help_data.
wd_comp_controller->isr_interface->set_special_data_with_index( EXPORTING
i_fieldindex = value_help_data-fieldindex
i_fieldname = value_help_data-fieldname
i_fieldvalue = value_help_data-fieldvalue ).
ENDLOOP.
* Refresh ISR context
wd_comp_controller->isr_interface->call_isr_process_event( i_eventname = user_event_popup ).
wd_comp_controller->isr_interface->call_isr_process_event( i_eventname = user_event_check ).
ELSE.
wd_comp_controller->isr_interface->call_isr_process_event( i_eventname = user_event_popup ).
ENDIF.
ENDIF.
Therefore, this is how the search help, the main WDA and the form communicate.
The example shown above shows one of the standard search helps that is probably in your system already, the following table showing all of them. All the HRRCF prefixed ones are for erecruiting.
HRASR_C_ORGUNIT |
Search Help for Org. Unit |
HRASR_C_POSITION |
Search Help for Position |
HRASR_C_QUALIFICATION_BLK |
Search Help for Qualification Block |
HRRCF_C_BRANCH |
Search Help for Branch |
HRRCF_C_POSITION |
Search Help for Position |
HRRCF_C_REQUI_DEFAULT |
Search Help for Branch |
I have written several bespoke search helps, both using OADP component usage and ALVs and they are now the method of choice if anything more than a dropdown is required.



It was while implementing a bank details form on my first project (EhP2) that I came across the restriction you mention. We couln't expect the employees to scroll through such a huge hit list, so the F4 help was removed instead.
My current project is EhP3 (and the next on 1st March, Ehp4) so at least they will be available for the forseeable future.
I thought your blog on the workflow aspect of HCM P&F was superb as detailed in the comments. I will be steering the new team towards it if they do not already know about it.
Cheers
Ian
Can somebody tell me if its possible to submit some custom event round trip to back end SAP_PA and Generci Services after selection is made in the Search Help and "OK" selected
It depends on what EhP and SP you are on! If you are on EhP3 or EhP4 SP<20/21 you will be fine in triggering the user event as we were doing just that by having the trigger in the click event of the button. Since upgrading to SP21 this doesn't work anymore. I currently have an OSS request in for this. I'll update the blog when I get an answer.
Cheers
Ian
We are Ehp4 22. Can you give me little more details. Right now on click there is javascript ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");. How you specify custom event? or you mean it was triggering round trip before automaticaly after "ok" selected but stop working with SP > 20
Thanks,
Oleg
You are correct. The roundtrip was triggering but now it is not.
Cheers
Ian
Please keep me posted.
Thanks,
Oleg
One more question. Before when you were able to submit. What kind of event was it? Standard Initialize or Check. What if we want to send user event that we configured? Is there a way to do it?
We sort of found a solution in SAP note 1035630. If you use the scripting at the bottom of the note, it may help out (it worked on one form for us but not the second - odd!)
Cheers
Ian
Thanks Ian,Oleg
I rechecked with my colleague and it does not work for the WDA search help after all. It was a standard search help he was also testing with that now works.
If we find a solution to the WDA roundtrip, I will post it but be more thorough in my testing next time...
I have similar kind of requirement in Web Dynpro java interactive form. Can any one post the link in Web Dynpro java.
I have tried the similar scenario of calling the ORG UNIT help on the Adobe Form. I have put these two lines behind the mouse down event
"$record.CONTROL_PARAM.ISR_EVENT = "USER_EVENT_POPUP"
$record.HRASR_FORM_WINDOW.DATA[*].FIELD.value = "HRASR_C_ORGUNIT"
I am getting the Org Unit pop up and search result but when I click OK I don't get the selected value on my Adobe form Org Unit field.
Am I missing some thing?
Have you named the field in your config the same as the one transferred from the WDA?
Check the CLOSE_POPUP event on the component controller and make sure your fieldnames match.
Cheers
Ian
Hi Ian,
I'm trying to implement a custom HCM Form. In my form process I have 2 different scenario steps. In the first step the field instructions is hidden.In the second step the field instructions is editable.
This is working just until I use a WDA value help for a field. After the submit event all data in the UI_Attributes is cleared and All fields are visible.
What is going wrong?
kr,
Joachim
Hi Joachim
Apologies but I've only just seen this. I don't seem to get notifications, so I'll have to recify that.
I assume you solved your issue?
Ian
Do you ever tried to call this kind of webdynpro pop-up a second time after a first selection?
For us, the second time, the pop-up appears BEHIND the form, any idea?
Hi Emanuel
As above, I have just seen this. Again ,did you solve your issue? I recall (it's over 2 years since I worked with HCM P&F) that the popup could be called multiple times but I've never heard of it being rendered behind the form.
Ian
Hi Ian,
A wonderful blog!!.
It almost solved all my doubts but still i have one doubt in you're above example (which is related to Recruitment Requisition Request) after selecting position i need to click on next to bring salary band, task & requirement. So could you tell where the next button code is exactly written.As i searched couldn't find out the location but couldnt get it.
Thanks in Advance,
Bob.
You don't click a "next" button. You would either (1) create your own button on the form with your own "user event" behind/for it. (2) similar to #1, on the selection of the position (drop down or input field) bind a user event to that "action" and do the same.
Christopher,
There is already a standard FPM 'next' button in Recruitment Requisition Request form which actually brings certain values onto the form based on position.So is it possible to execute the next button event after selecting the position.Below is the screenshot.
I would look at the "event" behind it ...then in your own generic service and/or configuration, you can act accordingly.
Christopher thank you 🙂 ..got my issue resolved.
Glad you liked the blog, Bob, and many thanks for stepping in and helping Bob out, Chris.
It's been such a long time I'm not sure I would have remembered the solution!
Cheers
Ian