<Annotations Target="ZCUSTOMORDER_SRV.ZCUSTOMORDER_SRV_Entities/zcustom_order">
<Annotation Term="Capabilities.UpdateRestrictions">
<Record Type="Capabilities.UpdateRestrictionsType">
<PropertyValue Property="Updatable" Path="phas0"/>
</Record>
</Annotation>
<Annotation Term="Capabilities.DeleteRestrictions">
<Record Type="Capabilities.DeleteRestrictionsType">
<PropertyValue Property="Deletable" Path="phas0"/>
</Record>
</Annotation>
</Annotations>
//Auto value help logic for Smart Filter
var smFilt = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ListReport.view.ListReport::zcustom_order--listReportFilter");
var conConfig = smFilt.getControlConfiguration();
conConfig.forEach(function(item, idx, arr){
smFilt.removeControlConfiguration(item);
item.setPreventInitialDataFetchInValueHelpDialog(false);
smFilt.addControlConfiguration(item);
}, this);
//Automatic value help for Object Page smart field
var fld = this.oView.byId("zcustomorder::sap.suite.ui.generic.template.ObjectPage.view.Details::zcustom_order--RF1::qmnum::Field");
if (fld) {
var oConfig = fld.getConfiguration();
if (!oConfig) {
oConfig = new sap.ui.comp.smartfield.Configuration();
}
oConfig.setPreventInitialDataFetchInValueHelpDialog(false);
oConfig.setDisplayBehaviour(sap.ui.comp.smartfield.DisplayBehaviour.descriptionAndId);
fld.setConfiguration(oConfig);
}
onInit: function(){
//Somehow the chart entity is not called automatically so we need to call it explicitly to load
this._loadChart();
},
_loadChart: function(){
var url = "/zcustom_order_chart";
var oModel = this.getOwnerComponent().getModel();
var params = {
async: false,
success: function (oData, controller) {
//Do nothing. The Smart chart will automatically read it.
sap.ui.core.BusyIndicator.hide();
},
error: function (oError) {
sap.ui.core.BusyIndicator.hide();
}
};
oModel.read(url, params);
}
onAfterRendering: function () {
// Current timestamp set as default filter for order start but this way we can set any field dynamically
var smFilt = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ListReport.view.ListReport::zcustom_order--listReportFilter"
);
var dat = new Date();//Java script date object
var datStr = dat.toISOString(); // Convert it to format that SAP understands
var jsonString =
'{"SelectionVariantID":"","Parameters":[{"PropertyName":"orderstart","PropertyValue":"' + datStr +'"}]}';
smFilt.setDataSuiteFormat(jsonString);
}
onAfterRendering: function () {
this._oEditButton = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ObjectPage.view.Details::zcustom_order--edit");
this._oEditButton.attachPress(this.onEditPress);
},
onEditPress : function(){
sap.m.MessageToast.show("Edit button pressed");
},
onNotifPress : function(){
var sPath = that.getView().getBindingContext().getPath();
var notifNo = that.getView().getModel().getProperty(sPath + "/qmnum");
var oNavControl = that.extensionAPI.getNavigationController();
oNavControl.navigateExternal("Notification", {
qmnum: notifNo
});
}
jQuery.sap.registerModulePath("google", "https://www.gstatic.com/charts/loader");
jQuery.sap.require("google");
jQuery.sap.includeScript("https://www.gstatic.com/charts/loader.js", "NewId", function () {
google.charts.load('current', {'packages': ['gauge']});
// Put rest of the logic to build the chart
});
@AbapCatalog.sqlViewName: 'ZCUSTORD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Custom Order'
@ObjectModel.createEnabled: true
@ObjectModel.deleteEnabled: true
@ObjectModel.updateEnabled: true
define view zcustom_order
as select from zcustomorder
association [* ] to zcustom_notif as _NotifHelp on _NotifHelp.qmnum = zcustomorder.qmnum
{
@UI : {
lineItem: [{ position: 10 }],
selectionField: [{ position: 10 }],
fieldGroup: [{
qualifier: 'Header1',
position : 10
},
{
qualifier: 'Overview1',
position : 10
}]
}
key aufnr,
@UI : {
lineItem: { position: 20 },
selectionField: { position: 20 },
fieldGroup: {
qualifier: 'Overview1',
position : 20
}
}
ktext,
@UI : {
lineItem: [{ position: 30 }],
selectionField: [{ position: 30 }],
fieldGroup: {
qualifier: 'Overview2',
position : 10
}
}
auart,
@UI : {
lineItem: [{ position: 40 }],
selectionField: [{ position: 40 }],
fieldGroup: {
qualifier: 'Overview2',
position : 20
}
}
@Consumption.filter.defaultValue: '30'
auftyp,
@UI : {
lineItem: [{ position: 50 }],
selectionField: [{ position: 50 }],
fieldGroup: {
qualifier: 'Overview3',
position : 10
}
}
werks,
@UI : {
lineItem: [{ position: 60 }],
selectionField: [{ position: 60 }],
fieldGroup: {
qualifier: 'Overview4',
position : 20
}
}
phas0,
@UI : {
lineItem: [{ position: 10 }],
selectionField: { position: 70 },
fieldGroup: {
qualifier: 'Overview4',
position : 10
}
}
@Consumption.valueHelp: '_NotifHelp'
qmnum,
@UI : {
lineItem: [{ position: 10 }],
selectionField: { position: 80 },
fieldGroup: {
qualifier: 'Overview3',
position : 20
}
}
@Consumption.filter: {selectionType : #SINGLE, multipleSelections: false}
@EndUserText.label: 'Order Start Date'
orderstart,
_NotifHelp
}
@AbapCatalog.sqlViewName: 'ZCUSTORDCHART'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Custom order chart'
@UI.chart: [{
title: 'Availability Information',
qualifier: 'Chart1',
chartType: #PIE,
dimensions: [ 'OrderStatus' ],
measures: [ 'Measure' ]
}]
define view zcustom_order_chart as select from zcustom_order {
key auftyp as OrderCatagory,
key case phas0
when 'X' then 'Open'
else 'Closed' end as OrderStatus,
count(*) as Measure
} group by phas0, auftyp
@AbapCatalog.sqlViewName: 'ZCUSTNOTIF'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@OData.publish: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Custom notification'
@ObjectModel.createEnabled: true
@ObjectModel.deleteEnabled: true
@ObjectModel.updateEnabled: true
define view zcustom_notif
as select from zcustomnotif
{
@UI : {
lineItem: [{position: 10 }],
selectionField: [{position: 10}],
fieldGroup: [{position: 10,
qualifier: 'Overview1' },{position: 10, qualifier: 'Header1'}]
}
key qmnum,
@UI : {fieldGroup: [{position: 10,
qualifier: 'Overview2' }],
selectionField: [{position: 20}],
lineItem: [{position: 20 }]}
qmtxt,
@UI : {fieldGroup: [{position: 10,
qualifier: 'Overview3' }],
selectionField: [{position: 30}],
lineItem: [{position: 30 }]}
qmdat,
@UI : {fieldGroup: [{position: 10,
qualifier: 'Overview4' }],
selectionField: [{position: 40}],
lineItem: [{position: 40 }]}
aufnr,
@UI : {fieldGroup: [{position: 20,
qualifier: 'Overview1' }],
selectionField: [{position: 50}],
lineItem: [{position: 50 }]}
qmart
}
{
"_version": "1.8.0",
"sap.app": {
"id": "zcustomorder",
"type": "application",
"i18n": "i18n/i18n.properties",
"applicationVersion": {
"version": "1.0.0"
},
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"tags": {
"keywords": []
},
"dataSources": {
"ZCUSTOMORDER_SRV": {
"uri": "/sap/opu/odata/sap/ZCUSTOMORDER_SRV/",
"type": "OData",
"settings": {
"localUri": "localService/ZCUSTOMORDER_SRV/metadata.xml",
"annotations": ["localAnnotations", "ZCUSTOMORDER_ANNO_MDL"]
}
},
"localAnnotations": {
"uri": "annotations/annotations.xml",
"type": "ODataAnnotation",
"settings": {
"localUri": "annotations/annotations.xml"
}
},
"ZCUSTOMORDER_ANNO_MDL": {
"uri": "/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations(TechnicalName='ZCUSTOMORDER_ANNO_MDL',Version='0001')/$value/",
"type": "ODataAnnotation",
"settings": {
"localUri": ""
}
}
},
"offline": false,
"sourceTemplate": {
"id": "servicecatalog.connectivityComponentForManifest",
"version": "0.0.0"
},
"crossNavigation": {
"inbounds": {
"intent1": {
"signature": {
"parameters": {},
"additionalParameters": "allowed"
},
"semanticObject": "zcustord",
"action": "manage"
}
},
"outbounds": {
"Notification": {
"semanticObject": "zcustnot",
"action": "manage"
}
}
}
},
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "",
"favIcon": "",
"phone": "",
"phone@2": "",
"tablet": "",
"tablet@2": ""
},
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
},
"supportedThemes": ["sap_hcb", "sap_belize"]
},
"sap.ui5": {
"resources": {
"js": [],
"css": []
},
"dependencies": {
"minUI5Version": "1.38.34",
"libs": {},
"components": {}
},
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"@i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/i18n.properties"
},
"i18n|sap.suite.ui.generic.template.ListReport|zcustom_order": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/ListReport/zcustom_order/i18n.properties"
},
"i18n|sap.suite.ui.generic.template.ObjectPage|zcustom_order": {
"type": "sap.ui.model.resource.ResourceModel",
"uri": "i18n/ObjectPage/zcustom_order/i18n.properties"
},
"": {
"type": "sap.ui.model.odata.v2.ODataModel",
"settings": {
"defaultOperationMode": "Server",
"defaultBindingMode": "OneWay",
"defaultCountMode": "Request"
},
"dataSource": "ZCUSTOMORDER_SRV",
"preload": true
}
},
"extends": {
"extensions": {
"sap.ui.controllerExtensions": {
"sap.suite.ui.generic.template.ObjectPage.view.Details": {
"controllerName": "zcustomorder.ext.controller.ObjectPageExt",
"sap.ui.generic.app": {
"zcustom_order": {
"EntitySet": "zcustom_order",
"Header": {
"Actions": {
"Notification": {
"id": "Notification",
"text": "{@i18n>CREATE}",
"press": "onCreateNotification"
}
}
}
}
}
},
"sap.suite.ui.generic.template.ListReport.view.ListReport": {
"controllerName": "zcustomorder.ext.controller.ListReportExt",
"sap.ui.generic.app": {
"zcustom_order": {
"EntitySet": "zcustom_order",
"Actions": {}
}
}
}
}
}
},
"contentDensities": {
"compact": true,
"cozy": false
}
},
"sap.ui.generic.app": {
"_version": "1.3.0",
"settings": {
"forceGlobalRefresh": false
},
"pages": {
"ListReport|zcustom_order": {
"entitySet": "zcustom_order",
"component": {
"name": "sap.suite.ui.generic.template.ListReport",
"list": true,
"settings": {
"smartVariantManagement": true,
"quickVariantSelectionX": {
"showCounts": false,
"enableAutoBinding": false,
"variants": {
"0": {
"key": "t0",
"entitySet": "zcustom_order",
"annotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#All"
},
"1": {
"key": "t1",
"entitySet": "zcustom_order",
"annotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#Open"
},
"2": {
"key": "t2",
"entitySet": "zcustom_order_chart",
"annotationPath": "com.sap.vocabularies.UI.v1.PresentationVariant#Chart"
}
}
}
}
},
"pages": {
"ObjectPage|zcustom_order": {
"entitySet": "zcustom_order",
"component": {
"name": "sap.suite.ui.generic.template.ObjectPage"
}
}
}
}
}
},
"sap.platform.hcp": {
"uri": ""
}
}
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="/sap/bc/ui5_ui5/ui2/ushell/resources/sap/ushell/components/factsheet/vocabularies/UI.xml">
<edmx:Include Alias="UI" Namespace="com.sap.vocabularies.UI.v1"/>
</edmx:Reference>
<edmx:Reference Uri="/sap/opu/odata/sap/ZCUSTOM_ORDER_CDS/$metadata">
<edmx:Include Alias="ZCUSTOM_ORDER_CDS" Namespace="ZCUSTOM_ORDER_CDS"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml">
<edmx:Include Alias="Aggregation" Namespace="Org.OData.Aggregation.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Authorization.V1.xml">
<edmx:Include Alias="Auth" Namespace="Org.OData.Authorization.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml">
<edmx:Include Alias="Capabilities" Namespace="Org.OData.Capabilities.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470974/Common.xml?api=v2">
<edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470971/Communication.xml?api=v2">
<edmx:Include Alias="Communication" Namespace="com.sap.vocabularies.Communication.v1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
<edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml">
<edmx:Include Alias="Measures" Namespace="Org.OData.Measures.V1"/>
</edmx:Reference>
<edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml">
<edmx:Include Alias="Validation" Namespace="Org.OData.Validation.V1"/>
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="zcustomorder.ZCUSTOMORDER_SRV">
<!--===============================================================================
Entity Type from chosen collection
================================================================================-->
<Annotations Target="ZCUSTOMORDER_SRV.zcustom_orderType">
<Annotation Term="UI.SelectionVariant" Qualifier="Open">
<Record Type="UI.SelectionVariantType">
<PropertyValue Property="ID" String="SEL02"/>
<PropertyValue Property="Text" String="{@i18n>OPEN}"/>
<PropertyValue Property="SelectOptions">
<Collection>
<Record Type="UI.SelectOptionType">
<PropertyValue Property="PropertyName" PropertyPath="phas0"/>
<PropertyValue Property="Ranges">
<Collection>
<Record Type="UI.SelectionRangeType">
<PropertyValue Property="Sign" EnumMember="UI.SelectionRangeSignType/I"/>
<PropertyValue Property="Option" EnumMember="UI.SelectionRangeOptionType/EQ"/>
<PropertyValue Property="Low" Bool="true"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
<Annotation Term="UI.SelectionVariant" Qualifier="All">
<Record Type="UI.SelectionVariantType">
<PropertyValue Property="ID" String="SEL01"/>
<PropertyValue Property="Text" String="{@i18n>ALL}"/>
</Record>
</Annotation>
<Annotation Term="UI.HeaderFacets">
<Collection>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Target" AnnotationPath="@UI.FieldGroup#Header1"/>
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.Facets">
<Collection>
<Record Type="UI.CollectionFacet">
<PropertyValue Property="ID" String="GeneralInformation"/>
<PropertyValue Property="Label" String="{@i18n>OVERVIEW}"/>
<PropertyValue Property="Facets">
<Collection>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Target" AnnotationPath="@UI.FieldGroup#Overview1"/>
</Record>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Target" AnnotationPath="@UI.FieldGroup#Overview2"/>
</Record>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Target" AnnotationPath="@UI.FieldGroup#Overview3"/>
</Record>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="Target" AnnotationPath="@UI.FieldGroup#Overview4"/>
<PropertyValue Property="ID" String="RF1"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Collection>
</Annotation>
</Annotations>
<Annotations Target="ZCUSTOMORDER_SRV.ZCUSTOMORDER_SRV_Entities/zcustom_order">
<Annotation Term="Capabilities.UpdateRestrictions">
<Record Type="Capabilities.UpdateRestrictionsType">
<PropertyValue Property="Updatable" Path="phas0"/>
</Record>
</Annotation>
<Annotation Term="Capabilities.DeleteRestrictions">
<Record Type="Capabilities.DeleteRestrictionsType">
<PropertyValue Property="Deletable" Path="phas0"/>
</Record>
</Annotation>
</Annotations>
<Annotations Target="ZCUSTOMORDER_SRV.zcustom_order_chartType">
<Annotation Term="UI.PresentationVariant" Qualifier="Chart">
<Record Type="UI.PresentationVariantType">
<PropertyValue Property="Visualizations">
<Collection>
<AnnotationPath>@UI.Chart#Chart1</AnnotationPath>
</Collection>
</PropertyValue>
<PropertyValue Property="ID" String="CH1"/>
<PropertyValue Property="Text" String="{@i18n>CHART}"/>
</Record>
</Annotation>
</Annotations>
<Annotations Target="ZCUSTOMORDER_SRV.zcustom_notifType">
<Annotation Term="UI.FilterFacets">
<Collection/>
</Annotation>
</Annotations>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
sap.ui.controller("zcustomorder.ext.controller.ListReportExt", {
onInit: function(){
//Somehow the chart entity is not called automatically so we need to call it explicitly to load
this._loadChart();
//Auto value help logic for Smart Filter
var smFilt = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ListReport.view.ListReport::zcustom_order--listReportFilter"
);
var conConfig = smFilt.getControlConfiguration();
conConfig.forEach(function(item, idx, arr){
smFilt.removeControlConfiguration(item);
item.setPreventInitialDataFetchInValueHelpDialog(false);
smFilt.addControlConfiguration(item);
}, this);
},
onAfterRendering: function () {
// Current timestamp set as default filter for order start but this way we can set any field dynamically
var smFilt = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ListReport.view.ListReport::zcustom_order--listReportFilter"
);
var dat = new Date();//Java script date object
var datStr = dat.toISOString(); // Convert it to format that SAP understands
var jsonString =
'{"SelectionVariantID":"","Parameters":[{"PropertyName":"orderstart","PropertyValue":"' + datStr +'"}]}';
smFilt.setDataSuiteFormat(jsonString);
},
_loadChart: function(){
var url = "/zcustom_order_chart";
var oModel = this.getOwnerComponent().getModel();
var params = {
async: false,
success: function (oData, controller) {
//Do nothing. The Smart chart will automatically read it.
sap.ui.core.BusyIndicator.hide();
},
error: function (oError) {
sap.ui.core.BusyIndicator.hide();
}
};
oModel.read(url, params);
}
});
sap.ui.controller("zcustomorder.ext.controller.ObjectPageExt", {
onInit: function () {
that = this;
//Automatic value help for Object Page smart field
var fld = this.oView.byId("zcustomorder::sap.suite.ui.generic.template.ObjectPage.view.Details::zcustom_order--RF1::qmnum::Field");
if (fld) {
var oConfig = fld.getConfiguration();
if (!oConfig) {
oConfig = new sap.ui.comp.smartfield.Configuration();
}
oConfig.setPreventInitialDataFetchInValueHelpDialog(false);
oConfig.setDisplayBehaviour(sap.ui.comp.smartfield.DisplayBehaviour.descriptionAndId);
fld.setConfiguration(oConfig);
}
//Convert Smart field into URL
var notifFld = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ObjectPage.view.Details::zcustom_order--RF1::qmnum::Field"
);
if (notifFld) {
notifFld.attachPress(this.onNotifPress);
}
},
onNotifPress : function(){
var sPath = that.getView().getBindingContext().getPath();
var notifNo = that.getView().getModel().getProperty(sPath + "/qmnum");
var oNavControl = that.extensionAPI.getNavigationController();
oNavControl.navigateExternal("Notification", {
qmnum: notifNo
});
},
onAfterRendering: function () {
this._oEditButton = this.getView().byId(
"zcustomorder::sap.suite.ui.generic.template.ObjectPage.view.Details::zcustom_order--edit");
this._oEditButton.attachPress(this.onEditPress);
},
onEditPress : function(){
sap.m.MessageToast.show("Edit button pressed");
},
onCreateNotification: function (oEvent) {
var oNavControl = this.extensionAPI.getNavigationController();
var oModel = this.getOwnerComponent().getModel();
var sPath = oEvent.getSource().getBindingContext().getPath();
var notNo = oModel.getProperty(sPath + "/qmnum");
var ordNo = oModel.getProperty(sPath + "/aufnr");
var ordStart = oModel.getProperty(sPath + "/orderstart");
oNavControl.navigateExternal("Notification", {
qmnum: notNo,
aufnr: ordNo,
qmdat: ordStart,
preferredMode: "create"
});
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |