<?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 error using line_exists() inside COND-operator in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662551#M1944428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Armin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;line_exists( ... )&lt;/STRONG&gt; is a predicate in the same sense as &lt;STRONG&gt;IS INITIAL &lt;/STRONG&gt;(one is a predicate function, the other a predicate expression).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You wouldn't write &lt;STRONG&gt;ELSE IS INITIAL&lt;/STRONG&gt; either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, ABAP does not support a real Boolean type (the old discussion) and you can use logical expressions and especially predicate expressions or predicate functions only in positions for logical expressions (e.g. behind &lt;STRONG&gt;IF&lt;/STRONG&gt; or &lt;STRONG&gt;WHEN&lt;/STRONG&gt;). But we don't have fields of that type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, &lt;STRONG&gt;xsdbool&lt;/STRONG&gt; is one of the workarounds to convert the result of a logical expression into a type that can be used for a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Horst&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2016 13:16:49 GMT</pubDate>
    <dc:creator>retired_member</dc:creator>
    <dc:date>2016-05-12T13:16:49Z</dc:date>
    <item>
      <title>Syntax error using line_exists() inside COND-operator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662550#M1944427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we got a strange syntax error while using the function line_exists() inside the COND-operator. Here is the generalized coding therefore (rf_result is of type ABAP_BOOL):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rf_result = COND #( WHEN iv_id IS INITIAL THEN abap_false ELSE line_exists( mt_data[ id = iv_id ] ) ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax check says: line_exists is not a field&lt;/P&gt;&lt;P&gt;I expected that the statement uses the boolean result of the function line_exists and returns it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We currently use as workaround the function xsdbool() surrounding the function line_exists().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this an error or do I something miss? Has someone an explanation about the behavior or an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Armin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: system status = NW 7.4 SP08&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 12:18:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662550#M1944427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-12T12:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error using line_exists() inside COND-operator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662551#M1944428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Armin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;line_exists( ... )&lt;/STRONG&gt; is a predicate in the same sense as &lt;STRONG&gt;IS INITIAL &lt;/STRONG&gt;(one is a predicate function, the other a predicate expression).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You wouldn't write &lt;STRONG&gt;ELSE IS INITIAL&lt;/STRONG&gt; either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, ABAP does not support a real Boolean type (the old discussion) and you can use logical expressions and especially predicate expressions or predicate functions only in positions for logical expressions (e.g. behind &lt;STRONG&gt;IF&lt;/STRONG&gt; or &lt;STRONG&gt;WHEN&lt;/STRONG&gt;). But we don't have fields of that type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, &lt;STRONG&gt;xsdbool&lt;/STRONG&gt; is one of the workarounds to convert the result of a logical expression into a type that can be used for a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Horst&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 13:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662551#M1944428</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2016-05-12T13:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error using line_exists() inside COND-operator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662552#M1944429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Horst,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ahh, I got it. Thank you very much for the explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Armin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 13:48:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662552#M1944429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-12T13:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error using line_exists() inside COND-operator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662553#M1944430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PS: xsdbool is the correct wrapper to produce a pseudo boolean of type c length 1, as ABAP_BOOL. boolc returns a string that is OK for assignments as you do it here, but can make problems in comparisons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 15:34:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662553#M1944430</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2016-05-12T15:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error using line_exists() inside COND-operator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662554#M1944431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good hint. We already decided to use only xsdbool() to avoid a mixture.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 06:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-error-using-line-exists-inside-cond-operator/m-p/11662554#M1944431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-13T06:51:25Z</dc:date>
    </item>
  </channel>
</rss>

