SAP MDG · DATA MODEL UI
How do I implement OVS value help in an SAP MDG FPM feeder class?
Implement OVS by redefining all four IF_FPM_GUIBB_OVS phase methods in the feeder class, calling super-> first, configuring labels/columns in phase 0, preparing and returning the result table in phase 2, and finalizing the selection in phase 3. Link the field to the OVS implementation in IF_FPM_GUIBB_FORM~GET_DEFINITION using ovs_name, and make the field nullable if users must clear it.
Implement OVS by redefining all four IF_FPM_GUIBB_OVS phase methods in the feeder class, calling super-> first, configuring labels/columns in phase 0, preparing and returning the result table in phase 2, and finalizing the selection in phase 3. Link the field to the OVS implementation in IF_FPM_GUIBB_FORM~GET_DEFINITION using ovs_name, and make the field nullable if users must clear it.
Implement OVS in the feeder class by redefining the four IF_FPM_GUIBB_OVS phase methods and following the standard lifecycle: phase 0 sets popup metadata, phase 1 reads query input, phase 2 builds and returns the result list, and phase 3 finalizes the value handover. In MDG form feeders, wire the target field to the current feeder class with ovs_name in IF_FPM_GUIBB_FORM~GET_DEFINITION, and set the field to nullable if users must be able to clear it.
Process flow
- Redefine IF_FPM_GUIBB_OVS~HANDLE_PHASE_0, ~HANDLE_PHASE_1, ~HANDLE_PHASE_2, and ~HANDLE_PHASE_3 in the feeder class.
- Call super->if_fpm_guibb_ovs~... first in each phase method.
- In HANDLE_PHASE_0, configure label_texts and column_texts with io_ovs_callback->set_configuration( ).
- In HANDLE_PHASE_1, read or normalize query parameters if custom search filtering is needed.
- In HANDLE_PHASE_2, build the result internal table and pass it with io_ovs_callback->set_output_table( ).
- In HANDLE_PHASE_3, finalize value handover and optionally enrich eo_fpm_event.
- In IF_FPM_GUIBB_FORM~GET_DEFINITION, assign ovs_name for the target field.
- If the value must be clearable, mark the field nullable in the form definition.
IF_FPM_GUIBB_FORM~GET_DEFINITION
Link the target field to the OVS implementation by setting ovs_name on the field metadata.
IF_FPM_GUIBB_FORM~GET_DEFINITION
Allow clearing/deleting the value by making the field nullable where required.
Referenced tables
| Object | Purpose |
|---|---|
wdr_name_value_list | Used in HANDLE_PHASE_0 to define OVS label_texts and column_texts. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1" OVS_SEARCH_HELP.abap
2" ABAP-only template for FPM OVS phases (ready to paste into class definition/implementation includes).
3" Adjust class name, field names, and SELECT logic to your scenario.
4
5" ==============================
6" 1) CLASS DEFINITION SNIPPET
7" ==============================
8" Add these method declarations in your feeder class DEFINITION section:
9"
10" METHODS if_fpm_guibb_ovs~handle_phase_0 REDEFINITION.
11" METHODS if_fpm_guibb_ovs~handle_phase_1 REDEFINITION.
12" METHODS if_fpm_guibb_ovs~handle_phase_2 REDEFINITION.
13" METHODS if_fpm_guibb_ovs~handle_phase_3 REDEFINITION.
14
15" =================================
16" 2) CLASS IMPLEMENTATION SNIPPET
17" =================================
18" Paste these method bodies in your class IMPLEMENTATION include.
19
20METHOD if_fpm_guibb_ovs~handle_phase_0.
21 " Phase 0: configure OVS popup metadata (labels/columns).
22 super->if_fpm_guibb_ovs~handle_phase_0(
23 EXPORTING
24 iv_field_name = iv_field_name
25 io_ovs_callback = io_ovs_callback ).
26
27 io_ovs_callback->set_configuration(
28 label_texts = VALUE wdr_name_value_list(
29 ( name = 'KEY' value = 'User ID' )
30 ( name = 'TEXT' value = 'User Name' ) )
31 column_texts = VALUE wdr_name_value_list(
32 ( name = 'KEY' value = 'User ID' )
33 ( name = 'TEXT' value = 'User Name' ) ) ).
34ENDMETHOD.
35
36
37METHOD if_fpm_guibb_ovs~handle_phase_1.
38 " Phase 1: receive/validate query input (optional custom logic).
39 super->if_fpm_guibb_ovs~handle_phase_1(
40 EXPORTING
41 iv_field_name = iv_field_name
42 io_ovs_callback = io_ovs_callback ).
43
44 " Optional example:
45 " DATA lr_query TYPE REF TO data.
46 " lr_query = io_ovs_callback->query_parameters.
47 " Read and normalize search criteria from lr_query if required.
48ENDMETHOD.
49
50
51METHOD if_fpm_guibb_ovs~handle_phase_2.
52 " Phase 2: execute lookup and send result table to OVS.
53 TYPES: BEGIN OF ty_result,
54 key TYPE xubname,
55 text TYPE ad_namtext,
56 END OF ty_result.
57
58 DATA lt_result TYPE STANDARD TABLE OF ty_result WITH EMPTY KEY.
59
60 super->if_fpm_guibb_ovs~handle_phase_2(
61 EXPORTING
62 iv_field_name = iv_field_name
63 io_ovs_callback = io_ovs_callback
64 iv_index = iv_index ).
65
66 " Run custom lookup only for the target OVS field.
67 IF iv_field_name = 'USER_RESP'.
68
69 SELECT DISTINCT
70 a~uname AS key,
71 c~name_text AS text
72 FROM agr_users AS a
73 INNER JOIN usr21 AS b ON b~bname = a~uname
74 LEFT OUTER JOIN adrp AS c ON c~persnumber = b~persnumber
75 INTO TABLE @lt_result
76 UP TO 100 ROWS.
77
78 " Fallback: show user id if name is missing.
79 LOOP AT lt_result ASSIGNING FIELD-SYMBOL(<ls_result>).
80 IF <ls_result>-text IS INITIAL.
81 <ls_result>-text = <ls_result>-key.
82 ENDIF.
83 ENDLOOP.
84
85 io_ovs_callback->set_output_table(
86 EXPORTING
87 output = lt_result ).
88 ENDIF.
89ENDMETHOD.
90
91
92METHOD if_fpm_guibb_ovs~handle_phase_3.
93 " Phase 3: finalize selected value handover.
94 super->if_fpm_guibb_ovs~handle_phase_3(
95 EXPORTING
96 iv_field_name = iv_field_name
97 io_ovs_callback = io_ovs_callback
98 iv_wd_context_attr_name = iv_wd_context_attr_name
99 IMPORTING
100 eo_fpm_event = eo_fpm_event ).
101
102 " Optional: enrich eo_fpm_event if post-selection behavior is needed.
103ENDMETHOD.
104
105
106" =================================
107" 3) LOGICAL OVS 4-STEP SEQUENCE
108" =================================
109" Step 1: HANDLE_PHASE_0 -> setup labels and columns.
110" Step 2: HANDLE_PHASE_1 -> validate/search input.
111" Step 3: HANDLE_PHASE_2 -> read values and build KEY/TEXT output.
112" Step 4: HANDLE_PHASE_3 -> return selected value via FPM event.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I add OVS to a custom MDG field?
- Which methods must I redefine for IF_FPM_GUIBB_OVS?
- How do I build the OVS popup list and return the selected value?
Possible questions
- How do I add OVS to a custom MDG field?
- Which methods must I redefine for IF_FPM_GUIBB_OVS?
- How do I build the OVS popup list and return the selected value?
- How do I make the OVS field nullable in GET_DEFINITION?
- How do I implement OVS for a JVA field such as ZCTRVNAME?