Skip to Content

How to expand a second table

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>

metadata.png (86.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 09 at 04:40 AM

    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

    Add comment
    10|10000 characters needed characters exceeded