SAP MDG · DATA MODEL UI
How do I implement OVS (Object Value Selector) methods in an SAP MDG feeder class?
Implement the feeder class OVS lifecycle by redefining IF_FPM_GUIBB_OVS~HANDLE_PHASE_0 to configure the popup, HANDLE_PHASE_1 to read and normalize query input, HANDLE_PHASE_2 to build and return the result table, and HANDLE_PHASE_3 to transfer the selected row back to the field or event.
Implement the feeder class OVS lifecycle by redefining IF_FPM_GUIBB_OVS~HANDLE_PHASE_0 to configure the popup, HANDLE_PHASE_1 to read and normalize query input, HANDLE_PHASE_2 to build and return the result table, and HANDLE_PHASE_3 to transfer the selected row back to the field or event.
Implement OVS in an MDG feeder class by redefining IF_FPM_GUIBB_OVS~HANDLE_PHASE_0, ~HANDLE_PHASE_1, ~HANDLE_PHASE_2, and ~HANDLE_PHASE_3. Use phase 0 for popup metadata, phase 1 for query handling, phase 2 for the actual lookup and `io_ovs_callback->set_output_table( )`, and phase 3 for returning the selected value to the field or event.
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 the parent implementation first in each phase unless you intentionally replace the standard behavior.
- In phase 0, configure the OVS popup with `io_ovs_callback->set_configuration( )` and set label/column texts.
- In phase 1, read and normalize query parameters if the OVS should react to search input.
- In phase 2, run the DB/API lookup, build the result internal table, and return it using `io_ovs_callback->set_output_table( )`.
- In phase 3, transfer the selected row back to the target field or event.
- Optionally assign the OVS in `GET_DEFINITION` for the feeder field and restrict the custom logic by `iv_field_name`.
- Limit the result set and fall back to a display text when the descriptive field is initial.
Referenced tables
| Object | Purpose |
|---|---|
wdr_name_value_list | Used in the sample to supply OVS label texts and column texts in phase 0. |
ILLUSTRATIVE ABAP SAMPLE
Sample ABAP OVS implementation for an MDG feeder class
Adapt the field name, result structure, and SELECT logic to your own MDG object and check the method signatures in SE24.
1CLASS zcl_demo_ovs_feeder DEFINITION
2 PUBLIC
3 FINAL
4 CREATE PUBLIC.
5
6 PUBLIC SECTION.
7 INTERFACES if_fpm_guibb_ovs.
8ENDCLASS.
9
10CLASS zcl_demo_ovs_feeder IMPLEMENTATION.
11
12 METHOD if_fpm_guibb_ovs~handle_phase_0.
13 super->if_fpm_guibb_ovs~handle_phase_0(
14 EXPORTING
15 iv_field_name = iv_field_name
16 io_ovs_callback = io_ovs_callback ).
17
18 io_ovs_callback->set_configuration(
19 label_texts = VALUE wdr_name_value_list(
20 ( name = 'KEY' value = 'User ID' )
21 ( name = 'TEXT' value = 'User Name' ) )
22 column_texts = VALUE wdr_name_value_list(
23 ( name = 'KEY' value = 'User ID' )
24 ( name = 'TEXT' value = 'User Name' ) ) ).
25 ENDMETHOD.
26
27 METHOD if_fpm_guibb_ovs~handle_phase_1.
28 super->if_fpm_guibb_ovs~handle_phase_1(
29 EXPORTING
30 iv_field_name = iv_field_name
31 io_ovs_callback = io_ovs_callback ).
32
33 " Optional: validate or normalize query parameters here.
34 ENDMETHOD.
35
36 METHOD if_fpm_guibb_ovs~handle_phase_2.
37 TYPES: BEGIN OF ty_result,
38 key TYPE xubname,
39 text TYPE ad_namtext,
40 END OF ty_result.
41
42 DATA lt_result TYPE STANDARD TABLE OF ty_result WITH EMPTY KEY.
43
44 super->if_fpm_guibb_ovs~handle_phase_2(
45 EXPORTING
46 iv_field_name = iv_field_name
47 io_ovs_callback = io_ovs_callback
48 iv_index = iv_index ).
49
50 IF iv_field_name = 'USER_RESP'.
51 SELECT DISTINCT
52 a~uname AS key,
53 c~name_text AS text
54 FROM agr_users AS a
55 INNER JOIN usr21 AS b ON b~bname = a~uname
56 LEFT OUTER JOIN adrp AS c ON c~persnumber = b~persnumber
57 INTO TABLE @lt_result
58 UP TO 100 ROWS.
59
60 LOOP AT lt_result ASSIGNING FIELD-SYMBOL(<ls_result>).
61 IF <ls_result>-text IS INITIAL.
62 <ls_result>-text = <ls_result>-key.
63 ENDIF.
64 ENDLOOP.
65
66 io_ovs_callback->set_output_table(
67 EXPORTING
68 output = lt_result ).
69 ENDIF.
70 ENDMETHOD.
71
72 METHOD if_fpm_guibb_ovs~handle_phase_3.
73 super->if_fpm_guibb_ovs~handle_phase_3(
74 EXPORTING
75 iv_field_name = iv_field_name
76 io_ovs_callback = io_ovs_callback
77 iv_wd_context_attr_name = iv_wd_context_attr_name
78 IMPORTING
79 eo_fpm_event = eo_fpm_event ).
80
81 " Optional: adjust event payload after user selection.
82 ENDMETHOD.
83
84ENDCLASS.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I define and fill IF_FPM_GUIBB_OVS phases 0 to 3?
- How do I add OVS value help to an MDG FPM field?
- How do I configure OVS metadata, search logic, and selection transfer in a feeder class?
Possible questions
- How do I define and fill IF_FPM_GUIBB_OVS phases 0 to 3?
- How do I add OVS value help to an MDG FPM field?
- How do I configure OVS metadata, search logic, and selection transfer in a feeder class?
- How do I link an OVS to a field in GET_DEFINITION?
- How do I return selected OVS values back to the caller?