<Association Name="assoc_ECD2BAA0F8BF5B8410B95699E8ED23A2" sap:content-version="1">
<End Type="Z_PO_TUTORIAL_SRV.Z_C_PurchaseorderType" Multiplicity="1" Role="FromRole_assoc_ECD2BAA0F8BF5B8410B95699E8ED23A2"/>
<End Type="Z_PO_TUTORIAL_SRV.Z_C_PurchaseorderitemType" Multiplicity="*" Role="ToRole_assoc_ECD2BAA0F8BF5B8410B95699E8ED23A2"/>
<ReferentialConstraint>
<Principal Role="FromRole_assoc_ECD2BAA0F8BF5B8410B95699E8ED23A2">
<PropertyRef Name="POId"/>
</Principal>
<Dependent Role="ToRole_assoc_ECD2BAA0F8BF5B8410B95699E8ED23A2">
<PropertyRef Name="POId"/>
</Dependent>
</ReferentialConstraint>
</Association>
<List
id="list"
items="{
path: '/Z_C_Purchaseorder',
sorter: [
{path: 'ChangedAt', descending: true},
{path: 'POId', descending: false}],
parameters:{select: 'POId,OrderedByName,SupplierName,GrossAmount,CurrencyCode,ChangedAt,ItemCount'}
}"
<l:VerticalLayout width="100%">
<ObjectHeader id="objectHeader"
intro="{parts:[{path: 'i18n>xfld.orderedBy'}, {path: 'OrderedByName'}], formatter: 'jQuery.sap.formatMessage'}"
number="{parts: [ {path: 'GrossAmount'}, {path: 'CurrencyCode'}], type : 'sap.ui.model.type.Currency', formatOptions: { showMeasure: false }}"
numberUnit="{CurrencyCode}" responsive="true" title="{SupplierName}">
<statuses>
<ObjectStatus id="status"
text="{path: 'ChangedAt', type: 'sap.ui.model.type.Date', formatOptions: { style: 'medium', strictParsing: true, relative: true }}"
title="{/#Z_C_PurchaseorderType/ChangedAt/@sap:label}"/>
</statuses>
</ObjectHeader>
<core:ExtensionPoint name="extensionAfterObjectHeader"/>
<form:SimpleForm class="sapUiForceWidthAuto sapUiResponsiveMargin" columnsL="1" columnsM="1" emptySpanL="5" emptySpanM="5"
id="attributesSimpleForm" labelSpanL="3" labelSpanM="3" layout="ResponsiveGridLayout" maxContainerCols="2" minWidth="1024"
title="{i18n>xtit.formTitle}">
<Label id="poIdLabel" text="{/#Z_C_PurchaseorderType/POId/@sap:label}"/>
<Text id="poIdText" text="{POId}"/>
<Label id="deliveryDateLabel" text="{/#Z_C_PurchaseorderType/DeliveryDateEarliest/@sap:label}"/>
<Text id="deliveryDateText"
text="{=${LaterDelivDateExist} > 1 ? ${parts:[{path: 'i18n>xfld.andLater'}, {path: 'DeliveryDateEarliest', type: 'sap.ui.model.type.Date', formatOptions: { style: 'medium'}}], formatter: 'jQuery.sap.formatMessage'} : ${path:'DeliveryDateEarliest', type: 'sap.ui.model.type.Date', formatOptions: { style: 'medium'}} }"/>
<Label id="deliveryAddressLabel" text="{/#Z_C_PurchaseorderType/DeliveryAddress/@sap:label}"/>
<Text id="deliveryAddressText" text="{DeliveryAddress}"/>
</form:SimpleForm>
<core:ExtensionPoint name="extensionAfterForm"/>
</l:VerticalLayout>
<Table busyIndicatorDelay="{detailView>/lineItemTableDelay}" class="sapUiResponsiveMargin" id="lineItemsList" items="{to_PurchaseOrderItems}"
noDataText="{i18n>detailLineItemTableNoDataText}" updateFinished="onListUpdateFinished" width="auto">
<headerToolbar>
<Toolbar id="lineItemsToolbar">
<Title id="lineItemsHeader" text="{detailView>/lineItemListTitle}"/>
</Toolbar>
</headerToolbar>
<columns>
<!--Product description-->
<Column id="productColumn" width="30%">
<header>
<Label id="productLabel" text="{/#Z_C_PurchaseorderitemType/Product/@sap:label}"/>
</header>
</Column>
<!--Delivery Date-->
<Column demandPopin="true" id="deliveryDateColumn" minScreenWidth="Tablet" popinDisplay="Inline" width="15%">
<header>
<Label id="itemDeliveryDateLabel" text="{/#Z_C_PurchaseorderitemType/DeliveryDate/@sap:label}"/>
</header>
</Column>
<!--Ordered Quantity-->
<Column demandPopin="true" hAlign="Right" id="quantityColumn" minScreenWidth="Tablet" popinDisplay="Inline" width="15%">
<header>
<Label id="quantityLabel" text="{/#Z_C_PurchaseorderitemType/Quantity/@sap:label}"/>
</header>
</Column>
<!--Item price-->
<Column demandPopin="true" hAlign="Right" id="priceColumn" minScreenWidth="Tablet" popinDisplay="Inline" width="20%">
<header>
<Label id="priceLabel" text="{/#Z_C_PurchaseorderitemType/Price/@sap:label}"/>
</header>
</Column>
<!--Total value of the item-->
<Column demandPopin="true" hAlign="Right" id="grossAmountColumn" minScreenWidth="Tablet" popinDisplay="Inline" width="20%">
<header>
<Label id="grossAmountLabel" text="{/#Z_C_PurchaseorderitemType/GrossAmount/@sap:label}"/>
</header>
</Column>
</columns>
_onObjectMatched : function (oEvent) {
var sObjectId = oEvent.getParameter("arguments").objectId;
this.getModel().metadataLoaded().then( function() {
var sObjectPath = this.getModel().createKey("/Z_C_Purchaseorder", {
POId : sObjectId
});
this.getGlobalModel().setProperty("/currentPOId", sObjectId); // NEW
this._bindView("/" + sObjectPath);
}.bind(this));
},
if (this._iOpenCallsCount === 0) {
var oResourceBundle = oView.getModel("i18n").getResourceBundle(),
sSuccessMessage = "";
if (aPOIds.length === 1) {
var sSupplier = oModel.getProperty("/Z_C_Purchaseorder('" + aPOIds[0] + "')").SupplierName;
sSuccessMessage = oResourceBundle.getText(bApprove ? "ymsg.approvalMessageToast" : "ymsg.rejectionMessageToast", [sSupplier]);
} else {
sSuccessMessage = oResourceBundle.getText(bApprove ? "ymsg.massApprovalMessageToast" : "ymsg.massRejectionMessageToast");
}
sap.ui.require(["sap/m/MessageToast"], function(MessageToast) {
MessageToast.show(sSuccessMessage);
});
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
10 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |