<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Smart table Get all data from one entry in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290983#M4605958</link>
    <description>&lt;P&gt;Hi   &lt;SPAN class="mention-scrubbed"&gt;mio.fujita&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;yes this is right.&lt;/P&gt;&lt;P&gt;It is now working, thank you!&lt;/P&gt;&lt;P&gt;Is there a way to get only all order ids from product id 04 from the oRes.results ?&lt;/P&gt;&lt;P&gt;My filter is not working.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Aug 2020 12:43:21 GMT</pubDate>
    <dc:creator>truckla</dc:creator>
    <dc:date>2020-08-16T12:43:21Z</dc:date>
    <item>
      <title>Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaq-p/12290977</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
  &lt;P&gt;I implemented that you get the ID of the selected line (responive table) with one click and send them to another view.&lt;/P&gt;
  &lt;P&gt;With the help from &lt;SPAN class="mention-scrubbed"&gt;mio.fujita&lt;/SPAN&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://answers.sap.com/questions/13111243/smart-table-press-on-column-and-change-view.html#" target="test_blank"&gt;https://answers.sap.com/questions/13111243/smart-table-press-on-column-and-change-view.html#&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;onItemPress: function (oEvent) {
	var id = oEvent.getSource().getBindingContext().getProperty("ProductID");
	this.getOwnerComponent().getRouter().navTo("Detail", {
		id: id
	});
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;How do I get all entries that exist (of each line with this ID) with the read ID?&lt;/P&gt;
  &lt;P&gt;For example, I now have the ProductID from an order. How do I get the ordered goods or the quantity that is in a row with the read out ProductID?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 13:03:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaq-p/12290977</guid>
      <dc:creator>truckla</dc:creator>
      <dc:date>2020-08-13T13:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290978#M4605953</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;truckla&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Do you mean that you want to display the selected product detail in the next screen?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 08:13:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290978#M4605953</guid>
      <dc:creator>MioYasutake</dc:creator>
      <dc:date>2020-08-14T08:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290979#M4605954</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;mio.fujita&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;maybe the example will make it clearer:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1832045-2.png" /&gt;&lt;/P&gt;&lt;P&gt;I have sent order ID 4 from the first view to the second view (already solved with your help). &lt;/P&gt;&lt;P&gt;Now the new view shows everything that exists for order ID 4:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1832044-1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now I want to pass on this data or further process.&lt;BR /&gt;Everything about order ID 4.&lt;BR /&gt;In the form order ID = 4; product IDs = 1,2,3,4; names= A,B,C,H; quantity= 1,1,2,56&lt;BR /&gt;&lt;BR /&gt;How do I do that? &lt;/P&gt;&lt;P&gt;How do I get the data?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 08:46:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290979#M4605954</guid>
      <dc:creator>truckla</dc:creator>
      <dc:date>2020-08-14T08:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290980#M4605955</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;truckla&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;For example, you can get data using OData model's read operation.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var oModel = this.getView().getModel();
var oFilter = new Filter({
		path: "orderID",
		operator: sap.ui.model.FilterOperator.EQ,
		value1: "4"
	});
oModel.read("/Orders", {
	filters: [oFilter],
	success: function (oRes) {
		//here you can get data
	}
});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;*If orderId is the unique key of your entity, you can just do this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;oModel.read("/Orders('4')", {
	success: function (oRes) {
		//here you can get data
	}
});
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;oRes will be a JSON array like below.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1830921-m2ha6.png" /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mio&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 12:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290980#M4605955</guid>
      <dc:creator>MioYasutake</dc:creator>
      <dc:date>2020-08-14T12:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290981#M4605956</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;mio.fujita&lt;/SPAN&gt;  and thank you very much!&lt;/P&gt;&lt;P&gt;I don't understand where can I get my right value that is in your example "Orders" ? Where can I read it out from?&lt;/P&gt;&lt;P&gt;And where should I insert the code, in the onInit ?&lt;/P&gt;&lt;P&gt;If I try the root with "/" it doesn't work. I don't know where can I find the oModel.read("/&lt;STRONG&gt;Orders&lt;/STRONG&gt;...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;oModel2.read("/", {
                success: function (oRes) {
                    //here you can get data
                }
            });&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 16 Aug 2020 09:07:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290981#M4605956</guid>
      <dc:creator>truckla</dc:creator>
      <dc:date>2020-08-16T09:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290982#M4605957</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;Let me clarify your requirement.&lt;/P&gt;&lt;P&gt;Your second view already shows the list of data which belong to order 4, and you want to send this data for further processing.&lt;/P&gt;&lt;P&gt;What is the trigger for sending the data? (button press, just after navigating to the second view...)&lt;/P&gt;&lt;P&gt;The path you specify in read request ( in below example, "/Orders" ) will be the entityset which is bound to the smartTable in the first view.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;oModel.read("/Orders",&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v2.ODataModel%23methods/read"&gt;https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v2.ODataModel%23methods/read&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2020 11:22:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290982#M4605957</guid>
      <dc:creator>MioYasutake</dc:creator>
      <dc:date>2020-08-16T11:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290983#M4605958</link>
      <description>&lt;P&gt;Hi   &lt;SPAN class="mention-scrubbed"&gt;mio.fujita&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;yes this is right.&lt;/P&gt;&lt;P&gt;It is now working, thank you!&lt;/P&gt;&lt;P&gt;Is there a way to get only all order ids from product id 04 from the oRes.results ?&lt;/P&gt;&lt;P&gt;My filter is not working.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2020 12:43:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290983#M4605958</guid>
      <dc:creator>truckla</dc:creator>
      <dc:date>2020-08-16T12:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290984#M4605959</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;Great that the read request is now working!&lt;/P&gt;&lt;P&gt;Is your OData developed in SEGW project or from CDS?&lt;/P&gt;&lt;P&gt;In the case of SEGW, you need to implement filter operation in DPC_EXT class.&lt;/P&gt;&lt;P&gt;Also, make sure that "Filterable" attribute is checked in Entity definition.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" /&gt;&lt;A href="https://answers.sap.com/storage/temp/1834461-filterable.png"&gt;filterable.png&lt;/A&gt;&lt;IMG alt="" style="background-color: initial; font-size: 15px;" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290984#M4605959</guid>
      <dc:creator>MioYasutake</dc:creator>
      <dc:date>2020-08-17T10:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290985#M4605960</link>
      <description>&lt;P&gt;Hi  &lt;SPAN class="mention-scrubbed"&gt;mio.fujita&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;my OData is from CDS.&lt;/P&gt;&lt;P&gt;How can I access individual values of the oRes.results?&lt;BR /&gt;For example, if I need to get only all order ids from product id 04 from the oRes.results.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 11:46:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290985#M4605960</guid>
      <dc:creator>truckla</dc:creator>
      <dc:date>2020-08-17T11:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Smart table Get all data from one entry</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290986#M4605961</link>
      <description>&lt;P&gt;You can for example use array's reduce function.&lt;/P&gt;&lt;P&gt;I'm assuming that you want to get values in below format.&lt;/P&gt;&lt;P&gt;&amp;gt;In the form order ID = 4; product IDs = 1,2,3,4; names= A,B,C,H; quantity= 1,1,2,56&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var initalObj = { ProductId: [], ProductName: [] };
var oResult = oRes.results.reduce(function(acc, current) {
    acc.ProductId.push(current.ProductID);
    acc.ProductName.push(current.ProductName);
    return acc;
}, initalObj);					
console.log(oResult);&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is what you'll get as oResult.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1834497-depon.png" /&gt;&lt;/P&gt;&lt;P&gt;And the blow code will return the values concatenated by comma.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1834496-oqfey.png" /&gt;&lt;/P&gt;&lt;P&gt;If you only want unique values, then you need to implement some check before pushing values into array.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    //check if the same value already exists in the array
    acc.ProductId.push(current.ProductID);
    acc.ProductName.push(current.ProductName);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Aug 2020 11:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-get-all-data-from-one-entry/qaa-p/12290986#M4605961</guid>
      <dc:creator>MioYasutake</dc:creator>
      <dc:date>2020-08-18T11:41:43Z</dc:date>
    </item>
  </channel>
</rss>

