-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddF4toCustomField
121 lines (91 loc) · 4.04 KB
/
AddF4toCustomField
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
METHOD get_v_standardaddress.
DATA:
lv_fieldname TYPE name_komp,
lt_fieldname_additional TYPE crmt_attr_name_tab.
lv_fieldname = 'STANDARDADDRESS'. "#EC NOTEXT
INSERT lv_fieldname INTO TABLE lt_fieldname_additional.
CALL METHOD cl_crm_uiu_bp_cust_get=>get_vhelp_for_field
EXPORTING
iv_fieldname = 'STANDARDADDRESS' "#EC NOTEXT
iv_fieldname_alternative = 'ADDRESS' "#EC NOTEXT
it_fieldname_additional = lt_fieldname_additional
RECEIVING
rv_valuehelp_descriptor = rv_valuehelp_descriptor
EXCEPTIONS
OTHERS = 0.
* DATA: ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
* lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
* lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
*
* ls_map-context_attr = 'STRUCT.E_MAILSMT'." This is the Field create via AET
* ls_map-f4_attr = 'KEY'. " This the Field from the Search Help
*
* APPEND ls_map TO: lt_inmap, lt_outmap.
*
* CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr
* EXPORTING
* iv_help_id = 'CRM_MAIL_ADDRESS'
* iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
* iv_input_mapping = lt_inmap
* iv_output_mapping = lt_outmap.
ENDMETHOD.
*1) Contect node->attribute generate get_v method
method GET_V_ZZ_OKED_CODE.
CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_navdescr
EXPORTING
iv_outbound_plug = 'FIND_OKED'.
endmethod.
*ON EVENT
method OP_FIND_OKED.
DATA: lv_title TYPE string.
* Get title 'Search: Employees'
lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BP_HEAD/EMPLOYEE_SEARCH' ).
IF gr_oked_search_popup IS NOT BOUND.
gr_oked_search_popup = comp_controller->window_manager->create_popup(
iv_interface_view_name = 'ZOKED_SEARCH/MainWindow'
iv_usage_name = 'ZCU_OKED_SEARCH'
iv_title = lv_title ).
ENDIF.
gr_oked_search_popup->set_on_close_event( iv_view = me iv_event_name = 'SEL_OKED' ).
gr_oked_search_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
gr_oked_search_popup->open( ).
endmethod.
*Обработчик события
METHOD eh_onsel_oked.
*Added by wizard: Handler for event 'SEL_OKED'
DATA: lv_col_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
lv_current TYPE REF TO if_bol_bo_property_access,
lv_context_node TYPE REF TO cl_bsp_wd_context_node,
lr_entity TYPE REF TO cl_crm_bol_entity,
lv_outbound_plug TYPE seocmpname,
lv_value TYPE string.
DATA: lv_index TYPE int4,
lv_event_string TYPE string,
lv_entity TYPE REF TO cl_crm_bol_entity.
* Get Context Node of Search Window
TRY .
lv_context_node = gr_oked_search_popup->get_context_node( iv_cnode_name = 'SELECTCODE' ).
lv_col_wrapper = lv_context_node->collection_wrapper.
lv_current ?= lv_col_wrapper->get_current( ).
CATCH cx_root.
ENDTRY.
IF lv_current IS BOUND.
* Check Outbound Plug
lv_outbound_plug = gr_oked_search_popup->get_fired_outbound_plug( ).
CHECK lv_outbound_plug = 'TOOVERVIEW'.
cl_chtmlb_config_utility=>outbound_plug_event_info( EXPORTING iv_event_string = lv_event_string
IMPORTING ev_index = lv_index ).
* lv_index = cl_crm_uiu_prod_tools=>get_tableindex_by_id( htmlb_event_ex->event_id ).
lr_entity ?= me->typed_context->ztd_bp_oked->collection_wrapper->find( iv_index = lv_index ).
IF lr_entity IS BOUND.
TRY.
lr_entity->set_property_as_string(
EXPORTING
iv_attr_name = 'ZZ_OKED_CODE' " Component Name
iv_value = lv_current->get_property_as_string( 'CODE' )
).
CATCH cx_sy_conversion_error. "
ENDTRY.
ENDIF.
ENDIF.
ENDMETHOD.