<?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 Re: Error in CDS View in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003271#M1896577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you inputs but the issue persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked for you because it was a single table in the example, but as mentioned in your second response "&lt;SPAN style="color: #333333; font-size: 12px;"&gt; &lt;STRONG&gt;the key fields of the database view are derived implicitly from the key fields of the basis tables and the join conditions. If this is not possible, all fields of the database view are key fields.&lt;/STRONG&gt;&lt;/SPAN&gt;" This is what exactly happening to my CDS View, all the fields are becoming key fields though I am joining to tables with their key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key fields in each of the tables: - &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDID4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DOCNUM---&amp;gt;Used to join&lt;/P&gt;&lt;P&gt;COUNTER&lt;/P&gt;&lt;P&gt;SEGNUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIDS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DOCNUM&lt;SPAN style="font-size: 13.3333330154419px;"&gt;---&amp;gt;Used to join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOGDAT&lt;/P&gt;&lt;P&gt;LOGTIM&lt;/P&gt;&lt;P&gt;COUNTR(status)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIDC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DOCNUM&lt;SPAN style="font-size: 13.3333330154419px;"&gt;---&amp;gt;Used to join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 17:55:51 GMT</pubDate>
    <dc:creator>former_member195431</dc:creator>
    <dc:date>2015-04-08T17:55:51Z</dc:date>
    <item>
      <title>Error in CDS View</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003268#M1896574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my program I am fetching a certain type of inbound IDOC which in 53 status and updating my custom table, for which I have written a select query which executes perfectly but gives me an error while executing as a DDL source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Query in Program: -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/680107" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DDL Source: -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/680189" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error:- Preceding INT2 field cannot be a key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though I haven't declare INT2 field as a key field, the view which is being created (after commenting field sdata) is considering that. Please help me fix this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/680190" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 12:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003268#M1896574</guid>
      <dc:creator>former_member195431</dc:creator>
      <dc:date>2015-04-08T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CDS View</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003269#M1896575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you would need to add additional fields to your CDS-view in a way that makes a key-calculation possible. E.g. the following CDS-view results in the above error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define view ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; as select from edid4&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; dtint2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; sdata&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when you insert the fields&lt;/P&gt;&lt;P&gt;&amp;nbsp; docnum,&lt;/P&gt;&lt;P&gt;&amp;nbsp; counter,&lt;/P&gt;&lt;P&gt;&amp;nbsp; segnum,&lt;/P&gt;&lt;P&gt;before&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dtint2,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; sdata&lt;/P&gt;&lt;P&gt;then activation is possible !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is F1-Help available at the Key-checkboxes of the DDIC view. Note that these &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Key-checkboxes are not related to the 'key' statement in the CDS-view.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:19:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003269#M1896575</guid>
      <dc:creator>christian_seitel</dc:creator>
      <dc:date>2015-04-08T14:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CDS View</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003270#M1896576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;some additional explanation from F1 help on 'KEY'-statement in CDS-view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KEY is used to define the current element as the key element of the current CDS entity. Any elements of a SELECT list can be defined as key elements. The key elements of the CDS entity are used to document the semantics of the data model. The addition key is ignored when the CDS view is activated and when accesses are performed in program executions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More specifically, the key elements defined using KEY are ignored by the key of the CDS database view. Like in classic views, the key fields of the database view are derived implicitly from the key fields of the basis tables and the join conditions. If this is not possible, all fields of the database view are key fields. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 16:32:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003270#M1896576</guid>
      <dc:creator>christian_seitel</dc:creator>
      <dc:date>2015-04-08T16:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CDS View</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003271#M1896577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you inputs but the issue persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked for you because it was a single table in the example, but as mentioned in your second response "&lt;SPAN style="color: #333333; font-size: 12px;"&gt; &lt;STRONG&gt;the key fields of the database view are derived implicitly from the key fields of the basis tables and the join conditions. If this is not possible, all fields of the database view are key fields.&lt;/STRONG&gt;&lt;/SPAN&gt;" This is what exactly happening to my CDS View, all the fields are becoming key fields though I am joining to tables with their key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key fields in each of the tables: - &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDID4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DOCNUM---&amp;gt;Used to join&lt;/P&gt;&lt;P&gt;COUNTER&lt;/P&gt;&lt;P&gt;SEGNUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIDS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DOCNUM&lt;SPAN style="font-size: 13.3333330154419px;"&gt;---&amp;gt;Used to join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOGDAT&lt;/P&gt;&lt;P&gt;LOGTIM&lt;/P&gt;&lt;P&gt;COUNTR(status)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIDC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DOCNUM&lt;SPAN style="font-size: 13.3333330154419px;"&gt;---&amp;gt;Used to join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 17:55:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003271#M1896577</guid>
      <dc:creator>former_member195431</dc:creator>
      <dc:date>2015-04-08T17:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error in CDS View</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003272#M1896578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajit,&lt;/P&gt;&lt;P&gt;you are right, my simplified example only served the purpose of showing the basic principle, you would have to add several fields from several tables. This is inconvenient, but I think currently another workaround does not exist.&lt;BR /&gt;Regards, Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 07:37:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-in-cds-view/m-p/11003272#M1896578</guid>
      <dc:creator>christian_seitel</dc:creator>
      <dc:date>2015-04-09T07:37:13Z</dc:date>
    </item>
  </channel>
</rss>

