<?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: Syntax Check warning in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643840#M27468</link>
    <description>&lt;P&gt;can you please show the code that you have used to for #EC and also the Extendend check screenshot showing which #EC to be used. &lt;/P&gt;</description>
    <pubDate>Wed, 18 Apr 2018 03:40:39 GMT</pubDate>
    <dc:creator>former_member564522</dc:creator>
    <dc:date>2018-04-18T03:40:39Z</dc:date>
    <item>
      <title>Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643833#M27461</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Hi all,&lt;/P&gt;
  &lt;P&gt;I was updating tcode to add two more field to filter. The code shows below run fine but I got a syntax check warning says condition for the key field "MJAHR" does not test for equality. Bit strange I didn't use that field. Could anyone please give me a hand to explain why this happened?&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; Thanks a lot!&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Lynn&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Clear lv_mseg_lgort.
Select single lgort Into lv_mseg_lgort
From mseg
Where mblnr = ls_output-refbn and
      zeile = ls_output-refbz.
If sy-subrc = 0.
      ls_output-lgort = lv_mseg_lgort.
Else.
      ls_output-lgort = ''.
Endif.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;"Syntax check warning&lt;BR /&gt;This warning is only displayed in SLIN&lt;BR /&gt; In "SELECT SINGLE ...", the WHERE condition for the key field "MJAHR" does not&lt;BR /&gt; test for equality. Therefore, the single record in question is possibly not&lt;BR /&gt; unique.&lt;BR /&gt;Internal Message Code: MESSAGE GSB"&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 07:33:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643833#M27461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-17T07:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643834#M27462</link>
      <description>&lt;P&gt;Lynn,&lt;/P&gt;
  &lt;P&gt;Use MJAHR also in the where clause.That will satisfy the primary key requirement and at the same time result will be consistent.&lt;/P&gt;
  &lt;P&gt;K.Kiran.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 08:59:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643834#M27462</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2018-04-17T08:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643835#M27463</link>
      <description>&lt;P&gt;It's telling you that technically it's possible to have multiple entries with the same MBLNR in the database, each belonging to a different MJAHR. Combined with SELECT SINGLE, it's telling you that you're just going to get a random result if this is the case. &lt;/P&gt;
  &lt;P&gt;Only if you add MJAHR, you're guaranteed to get exactly the record you want.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 09:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643835#M27463</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2018-04-17T09:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643836#M27464</link>
      <description>&lt;P&gt;Hi Lynn,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Select single is usually to get the unique row from table , i.e to pass the complete key. &lt;/P&gt;
  &lt;P&gt;when key is partially , Extended check will show an error as it might pick up random row .&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;You can get the more information at &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapselect_single.htm" target="_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapselect_single.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;To solve the problem , You can either pass the complete key in where clause or you can use select upto 1 rows&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 10:12:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643836#M27464</guid>
      <dc:creator>former_member564522</dc:creator>
      <dc:date>2018-04-17T10:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643837#M27465</link>
      <description>&lt;P&gt;Hi Himanshu, &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thank you for your reply. The problem is the key MJAHR value are different in somehow in the tables. The system suggest use #EC but shows "Unknown column name "#EC" " .&lt;/P&gt;
  &lt;P&gt;Is there anything like this #etc I can use ?&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;
  &lt;P&gt;Lynn&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 00:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643837#M27465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-18T00:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643838#M27466</link>
      <description>Morning Mike, 
  &lt;P&gt;Thank you for your reply. &lt;/P&gt;
  &lt;P&gt;The system suggest use #EC but shows "Unknown column name "#EC" " . &lt;/P&gt;
  &lt;P&gt;Is there anything like this #etc I can use rather than add MJAHR ?&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Cheers,&lt;/P&gt;
  &lt;P&gt;Lynn&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 00:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643838#M27466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-18T00:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643839#M27467</link>
      <description>&lt;P&gt;Thanks Kiran the problem is solved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 02:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643839#M27467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-18T02:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643840#M27468</link>
      <description>&lt;P&gt;can you please show the code that you have used to for #EC and also the Extendend check screenshot showing which #EC to be used. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 03:40:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643840#M27468</guid>
      <dc:creator>former_member564522</dc:creator>
      <dc:date>2018-04-18T03:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643841#M27469</link>
      <description>&lt;P&gt;Hi Lynn, &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;#EC.. comments are &lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenpseudo_comment_ci.htm"&gt;pseudocomments&lt;/A&gt;, special comments to provide additional info to the compiler. They are deprecated, but the checks still show them. Most have been replaced by &lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenpragma.htm"&gt;pragmas&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Here it presumably suggests #EC WARN_OK which tells the check to suppress the warning because you know what you're doing. The equivalent statement with a pragma would be: &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;select single blah from tab where foo = bar  ##warn_ok.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But it's still best practice to supply the full key if possible, it's better for performance too. &lt;/P&gt;
  &lt;P&gt;Regards,&lt;BR /&gt;Mike&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:14:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643841#M27469</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2018-04-18T06:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643842#M27470</link>
      <description>&lt;P&gt;#EC should be entered as an inline comment.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;Select single lgort Into lv_mseg_lgort   " #EC ...
From mseg
Where mblnr = ls_output-refbn and
      zeile = ls_output-refbz.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;BUT&lt;/STRONG&gt; you should figure out how you can use MJAHR. Otherwise you could end up selecting&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;MJAHR = 2018 MBLNR = 123456789012 ZEILE = 1&lt;BR /&gt;instead of&lt;BR /&gt;MJAHR = 2017 MBLNR = 123456789012 ZEILE = 1&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;You should only suppress these warnings where you know that they don't apply. You should also comment &lt;EM&gt;why&lt;/EM&gt; they don't apply. &lt;/P&gt;
  &lt;P&gt;Remember the goal is not have ATC/SLIN give your program a clean bill of health, with no warnings or errors, the goal is to have error free code. ATC/SLIN is warning you of a potentially serious error - i.e. you'll select the wrong record, because you're not using MJAHR.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:27:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643842#M27470</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-04-18T06:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643843#M27471</link>
      <description>&lt;P&gt;Thanks a lot Mike!!&lt;/P&gt;
  &lt;P&gt;Solved problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643843#M27471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-18T06:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643844#M27472</link>
      <description>&lt;P&gt;Hi Himanshu, &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The problem is solved thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643844#M27472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-04-18T06:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643845#M27473</link>
      <description>&lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://blogs.sap.com/2015/03/11/selecting-one-line-from-an-database-table/"&gt;https://blogs.sap.com/2015/03/11/selecting-one-line-from-an-database-table/&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; "The syntax documents the semantics of your statement in the program and the extended program check warns you, if you do not specify the full key."&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:47:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643845#M27473</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2018-04-18T06:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Check warning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643846#M27474</link>
      <description>&lt;P&gt;Thanks Matthew you were right I should figure out the why.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Cheers, &lt;/P&gt;
  &lt;P&gt;lyn&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 06:01:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-warning/m-p/643846#M27474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-12T06:01:08Z</dc:date>
    </item>
  </channel>
</rss>

