<?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>topic Calling CDS associations in ABAP programs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-cds-associations-in-abap-programs/m-p/644706#M27534</link>
    <description>&lt;P&gt;I'm trying to find the correct syntax to retrieve data from CDS associations from an ABAP program.&lt;/P&gt;
  &lt;P&gt;This is my CDS view with 3 associations.&lt;/P&gt;
  &lt;P&gt;define view y_ddl_flights as select from scustom as customer &lt;/P&gt;
  &lt;P&gt;association [1..*] to sbook as _bookings on customer.id = _bookings.customid { customer.id, &lt;/P&gt;
  &lt;P&gt; customer.name, &lt;/P&gt;
  &lt;P&gt;, _bookings[class = 'C'] as business_flights,&lt;/P&gt;
  &lt;P&gt; _bookings[class = 'Y'] as economy_flights, &lt;/P&gt;
  &lt;P&gt; _bookings[class = 'F'] as firstclass_flights }&lt;/P&gt;
  &lt;P&gt;Now how to get data from the association business_flights in an ABAP program.&lt;/P&gt;
  &lt;P&gt;I tried the following but it shows syntax error.&lt;/P&gt;
  &lt;P&gt;TYPES:BEGIN OF t_test,&lt;BR /&gt; id TYPE s_customer,&lt;BR /&gt; name TYPE s_custname,&lt;BR /&gt; carrid TYPE s_carr_id,&lt;BR /&gt; END OF t_test.&lt;BR /&gt;&lt;BR /&gt; DATA: it_test TYPE STANDARD TABLE OF t_test.&lt;BR /&gt; &lt;BR /&gt; SELECT id,name,\business_flights\_carrid FROM y_ddl_flights&lt;BR /&gt; INTO CORRESPONDING FIELDS OF TABLE @it_test&lt;BR /&gt; WHERE id = '00000001'.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 17:11:17 GMT</pubDate>
    <dc:creator>ramesh_mohan3</dc:creator>
    <dc:date>2018-02-14T17:11:17Z</dc:date>
    <item>
      <title>Calling CDS associations in ABAP programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-cds-associations-in-abap-programs/m-p/644706#M27534</link>
      <description>&lt;P&gt;I'm trying to find the correct syntax to retrieve data from CDS associations from an ABAP program.&lt;/P&gt;
  &lt;P&gt;This is my CDS view with 3 associations.&lt;/P&gt;
  &lt;P&gt;define view y_ddl_flights as select from scustom as customer &lt;/P&gt;
  &lt;P&gt;association [1..*] to sbook as _bookings on customer.id = _bookings.customid { customer.id, &lt;/P&gt;
  &lt;P&gt; customer.name, &lt;/P&gt;
  &lt;P&gt;, _bookings[class = 'C'] as business_flights,&lt;/P&gt;
  &lt;P&gt; _bookings[class = 'Y'] as economy_flights, &lt;/P&gt;
  &lt;P&gt; _bookings[class = 'F'] as firstclass_flights }&lt;/P&gt;
  &lt;P&gt;Now how to get data from the association business_flights in an ABAP program.&lt;/P&gt;
  &lt;P&gt;I tried the following but it shows syntax error.&lt;/P&gt;
  &lt;P&gt;TYPES:BEGIN OF t_test,&lt;BR /&gt; id TYPE s_customer,&lt;BR /&gt; name TYPE s_custname,&lt;BR /&gt; carrid TYPE s_carr_id,&lt;BR /&gt; END OF t_test.&lt;BR /&gt;&lt;BR /&gt; DATA: it_test TYPE STANDARD TABLE OF t_test.&lt;BR /&gt; &lt;BR /&gt; SELECT id,name,\business_flights\_carrid FROM y_ddl_flights&lt;BR /&gt; INTO CORRESPONDING FIELDS OF TABLE @it_test&lt;BR /&gt; WHERE id = '00000001'.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:11:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-cds-associations-in-abap-programs/m-p/644706#M27534</guid>
      <dc:creator>ramesh_mohan3</dc:creator>
      <dc:date>2018-02-14T17:11:17Z</dc:date>
    </item>
  </channel>
</rss>

