@AbapCatalog.sqlViewName: 'ZMSSTK1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@EndUserText.label: 'Material Stock Storage Location'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.semanticKey: ['Product' , 'Plant' , 'StorageLocation']
@Metadata.allowExtensions: true
define view ZMS_MaterialStock
as select from nsdm_e_mard as mard
inner join mara on mard.matnr = mara.matnr
{
key mard.matnr as Product,
key mard.werks as Plant,
key mard.lgort as StorageLocation,
@Semantics.unitOfMeasure: true
mara.meins as BaseUnit,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
mard.labst as Unrestricted,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
mard.insme as Quanlity,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
mard.speme as Blocked
}
where
mard.lvorm = ''
@Metadata.layer: #CORE
annotate view ZMS_MaterialStock with
{
@UI.lineItem: [{ position: 20 }]
StorageLocation;
@UI.lineItem: [{ position: 30 }]
Unrestricted;
@UI.lineItem: [{ position: 40 }]
Quanlity;
@UI.lineItem: [{ position: 50 }]
Blocked;
}
@AbapCatalog.sqlViewName: 'ZMSSTK2'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Material Stock By Plant'
@ObjectModel.semanticKey: ['Product' , 'Plant']
@OData.publish: true
@Metadata.allowExtensions: true
define view ZMS_MaterialStock_Plant
as select from ZMS_MaterialStock
association [*] to ZMS_MaterialStock as _Stock_StorageLocation
on $projection.Product = _Stock_StorageLocation.Product
and $projection.Plant = _Stock_StorageLocation.Plant
association [1] to I_Product as _Product
on $projection.Product = _Product.Product
association [1] to I_Plant as _Plant
on $projection.Plant = _Plant.Plant
{
key Product,
key Plant,
@Semantics.unitOfMeasure: true
BaseUnit,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
sum( Unrestricted ) as Unrestricted,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
sum( Quanlity ) as Quality,
@Semantics.quantity.unitOfMeasure: 'BaseUnit'
sum( Blocked ) as Blocked,
_Stock_StorageLocation,
_Product,
_Plant
}
group by
Product,
Plant,
BaseUnit
@Metadata.layer: #CORE
@UI.headerInfo: { typeName: 'Material' ,
typeNamePlural: 'Materials' ,
title: { type: #STANDARD , value: 'Product'} ,
description: { type: #STANDARD, value: 'Product' } }
annotate view ZMS_MaterialStock_Plant with
{
@UI.facet: [
{ type: #COLLECTION ,
id: 'idGeneralInformation' ,
label: 'General Information' ,
position: 10 } ,
{ type: #IDENTIFICATION_REFERENCE ,
id: 'idIdentification' ,
label : 'Plant Stock',
parentId: 'idGeneralInformation',
position: 10 },
{ type : #LINEITEM_REFERENCE ,
id: 'idLineItemMatPlant' ,
label: 'Stock By Storage Location' ,
position: 20 ,
targetElement: '_Stock_StorageLocation'}
]
@UI.lineItem: [{ position: 10 }]
@UI.selectionField: [{position: 10 }]
Product;
@UI.lineItem: [{ position: 20 }]
@UI.selectionField: [{ position: 20 }]
@UI.identification: [{ position: 10 }]
Plant;
@UI.lineItem: [{ position: 30 }]
@UI.identification: [{ position: 20 }]
Unrestricted;
@UI.lineItem: [{ position: 40 }]
@UI.identification: [{ position: 30 }]
Quality;
@UI.lineItem: [{ position: 50 }]
@UI.identification: [{ position: 40 }]
Blocked;
}
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m">
<Column>
<Text text="Stock Position"/>
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "StockPosition" , "columnIndex" : "999"}'/>
</customData>
</Column>
</core:FragmentDefinition>
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns:m="sap.m" xmlns="sap.suite.ui.microchart">
<StackedBarMicroChart size="S" press="press" precision="0" class="sapUiSmallMargin">
<bars>
<StackedBarMicroChartBar value="{ path: 'Unrestricted', formatter : '.getFLoatFromString'}"
displayValue="{ path: 'Unrestricted' }"
valueColor="Good"/>
<StackedBarMicroChartBar value="{ path: 'Quality', formatter : '.getFLoatFromString'}"
displayValue="{ path: 'Quality' }"
valueColor="Critical"/>
<StackedBarMicroChartBar value="{ path: 'Blocked', formatter : '.getFLoatFromString'}"
displayValue="{ path: 'Blocked' }"
valueColor="Error"/>
</bars>
</StackedBarMicroChart>
</core:FragmentDefinition>
Wizard will add file ListReportExt.controller.js under folder ext->controller and descriptor in the manifest file. Now remove lines highlighted in below screenshot.
"extends": {
"extensions": {
"sap.ui.viewExtensions": {
"sap.suite.ui.generic.template.ListReport.view.ListReport": {
"ResponsiveTableColumnsExtension|ZMS_MaterialStock_Plant": {
"type": "XML",
"className": "sap.ui.core.Fragment",
"fragmentName": "stackedmicrochartbar.ext.view.StackBarTableColumn"
},
"ResponsiveTableCellsExtension|ZMS_MaterialStock_Plant": {
"type": "XML",
"className": "sap.ui.core.Fragment",
"fragmentName": "stackedmicrochartbar.ext.view.StackBarTableCell"
}
}
},
"sap.ui.controllerExtensions": {
"sap.suite.ui.generic.template.ListReport.view.ListReport": {
"controllerName": "stackedmicrochartbar.ext.controller.ListReportExt"
}
}
}
},
sap.ui.controller("stackedmicrochartbar.ext.controller.ListReportExt", {
getFLoatFromString: function(sValue) {
if (!sValue) {
return "";
}
return parseFloat(sValue);
}
});
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 | |
6 | |
6 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 | |
4 |