on 02-08-2018 7:13 PM
Hi i'm doing an exercise from opensap course and the bind a table call ProductSet and the expad to ToSupplier, so i want to expand another table call with the navigation ToSalesOrderLineItems, my question is: it is right the way i did it? be cause it does not show nothing i cheked if the navigation does exist and it's already created
so in my code i have:
my list
<List
id="productsList"
items="{
path: '/ProductSet',
sorter: {
path: 'Category',
group: true
},
parameters: {
expand: 'ToSupplier','ToSalesOrderLineItems'
}
}"
growing="true"
growingThreshold = "5"
growingScrollToLoad="false"
mode="SingleSelectMaster"
selectionChange="onItemSelected">
adding my field with an object attribute (ToSalesOrdersLineItems)
<items>
<ObjectListItem
title="{Name}"
number="{
parts: [
{path: 'Price'},
{path: 'CurrencyCode'}
],
type: 'sap.ui.model.type.Currency',
formatOptions: {
showMeasure: false
}
}"
numberUnit="{CurrencyCode}"
numberState="{= ${Price} > 500 ? 'Error' : 'Success'}"
intro="{ProductID}">
<firstStatus>
<ObjectStatus text="{
parts: [
{path: 'WeightUnit'},
{path: 'WeightMeasure'}
],
formatter : '.formatter.delivery'
}"/>
</firstStatus>
<secondStatus>
<ObjectStatus
title="Delivered From"
text="{ToSupplier/Address/City} {ToSupplier/Address/Country}"
/>
</secondStatus>
<attributes>
<ObjectAttribute text="{ToSalesOrderLineItems}" />
</attributes>
</ObjectListItem>
</items>
</List>
Hi Naoto,
IN the code attached by you, you have directly added a Navigation Property (refering to an Entity) to the attribute.
<attributes>
<ObjectAttribute text="{ToSalesOrderLineItems}" />
</attributes>
To Bind a value as text, you would need to specify the Property from the Entity which is being referred by ToSalesOrderLineItems.
Try with something like
<ObjectAttribute text="{ToSalesOrderLineItems/Name}" />
where Name should be a property in your Entity "SalesOrderLine Item
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
like this?
<List
id="productsList"
items="{
path : '/ProductSet',
sorter : {
path : 'Category',
group : true
},
parameters : {
expand : 'ToSupplier/ToSalesOrderLineItems'
}
}"
i get this error on the inspector:
jquery.sap.global-dbg.js:1035 2018-02-12 15:00:31.395070 The following problem occurred: HTTP request failed404,Not Found,{"error":{"code":"005056A509B11EE1B9A8FEC11C21D78E","message":{"lang":"en","value":"Resource not found for the segment 'ToSalesOrderLineItems'."},"innererror":{"transactionid":"B9E0A2A100BE0050E005A4B4E33E3E95","timestamp":"20180212180027.3360800","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"}}}} -
Please check below example.
http://www.techippo.com/2017/09/bind-expand-sapui5-xml-view.html
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.