<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:ui="sap.ui.layout">
<ui:form.SimpleForm id="OpportunityEditExtension" minWidth="1024" maxContainerCols="2" editable="true" layout="ResponsiveGridLayout"
labelSpanL="3" labelSpanM="3" emptySpanL="4" emptySpanM="4" columnsL="1" columnsM="1" class="editableForm" >
<ui:content>
<Label id="opportunityCreatedByLbael" text="Created By">
</Label>
<Input id="createdByInput" value="Jerry"></Input>
</ui:content>
</ui:form.SimpleForm>
</core:FragmentDefinition>
sap.ui.controller("cus.crm.opportunity.CRM_OPPRTNTYExtension.view.extS4", {
onInit : function () {
//Execute onInit for the base class BaseMasterController
sap.ca.scfld.md.controller.BaseDetailController.prototype.onInit.call(this);
},
extHookAddCustomHeaderFields : function(oEntry) {
// "createdByInput" is the id for extension UI element defined in extS4CreatedBy.fragment.xml
var oExtensionControl = this.byId("createdByInput");
// get the current value that end user has entered in extension field in detail view
var extensionValue = oExtensionControl.getValue();
oEntry.extCreatedBy = extensionValue;
}
});
METHOD /iwbep/if_mgw_appl_srv_runtime~patch_entity.
CALL METHOD super->/iwbep/if_mgw_appl_srv_runtime~patch_entity
EXPORTING
iv_entity_name = iv_entity_name
iv_entity_set_name = iv_entity_set_name
iv_source_name = iv_source_name
io_data_provider = io_data_provider
it_key_tab = it_key_tab
it_navigation_path = it_navigation_path
io_tech_request_context = io_tech_request_context
IMPORTING
er_entity = er_entity.
FIELD-SYMBOLS: <header_from_ui> TYPE crmt_odata_oppt_header,
<header_buffer> TYPE crmt_opport_h_com,
<value_ui> TYPE crmt_odata_oppt_header-ext_created_by,
<value_db> TYPE crmt_opport_h_com-fld00008b,
<input_fields> LIKE LINE OF cl_crm_opportunity_impl=>gt_input_fields.
DATA: ls_input TYPE crmt_input_field_names.
CHECK iv_entity_name = 'Opportunity'.
ASSIGN er_entity->* TO <header_from_ui>.
CHECK sy-subrc = 0.
READ TABLE cl_crm_opportunity_impl=>gt_opport_h ASSIGNING <header_buffer> INDEX 1.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'EXT_CREATED_BY' OF STRUCTURE <header_from_ui> TO <value_ui>.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'FLD00008B' OF STRUCTURE <header_buffer> TO <value_db>.
CHECK sy-subrc = 0.
<value_db> = <value_ui>.
READ TABLE cl_crm_opportunity_impl=>gt_input_fields ASSIGNING <input_fields>
WITH KEY objectname = 'OPPORT_H'.
CHECK sy-subrc = 0.
* Notify One order function module that we want to persist the value of this field
ls_input-fieldname = 'FLD00008B'.
INSERT ls_input INTO TABLE <input_fields>-field_names.
ENDMETHOD.
DATA: lv_created_by TYPE crmd_orderadm_h-created_by.
SELECT SINGLE created_by INTO lv_created_by FROM crmd_orderadm_h WHERE guid = <s_guid>-value.
IF sy-subrc = 0.
<created_by> = lv_created_by.
ENDIF.
DATA: lv_created_by TYPE crmd_opport_h-fld00008b.
SELECT SINGLE fld00008b INTO lv_created_by FROM crmd_opport_h WHERE guid = <s_guid>-value.
IF sy-subrc = 0.
<created_by> = lv_created_by.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
12 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 |