<?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: why not initial not work in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184257#M1980123</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;loki_luo15&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Instead of IS NOT INITIAL, try IF NOT NULL. Check how the program behaves then we can understand how the data is stored.&lt;/P&gt;&lt;P&gt;Also your code is not right as explained below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;     IF gs_data-rfarea &amp;lt;&amp;gt; ''.   --&amp;gt; Not Rite
          ...
      endif.


***Try this 
     IF gs_data-rfarea &amp;lt;&amp;gt; space.
          ...
      endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2020 05:32:27 GMT</pubDate>
    <dc:creator>former_member1716</dc:creator>
    <dc:date>2020-05-18T05:32:27Z</dc:date>
    <item>
      <title>why not initial not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184256#M1980122</link>
      <description>&lt;P&gt;I use below code to loop an itab but the if condition can't exlude anything.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_data INTO DATA(gs_data).
     IF gs_data-rfarea is not initial.
          ...
      endif.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But if I changed the code to &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_data INTO DATA(gs_data).
     IF gs_data-rfarea &amp;lt;&amp;gt; ''.
          ...
      endif.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;And it worked. So what's the reason? Is this because the SQL which select data into itab?&lt;/P&gt;
  &lt;P&gt;Below is the SQL.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT
        faglflext~rbukrs,
        faglflext~rfarea,
        faglflext~rcntr,
        cskt~ltext,
        faglflext~racct,
        skat~txt50,
        faglflext~hsl01,faglflext~hsl02,faglflext~hsl03,faglflext~hsl04,faglflext~hsl05,faglflext~hsl06,faglflext~hsl07,faglflext~hsl08,faglflext~hsl09,
    faglflext~hsl10,faglflext~hsl11,faglflext~hsl12,faglflext~hsl13,faglflext~hsl14,faglflext~hsl15,faglflext~hsl16
  INTO TABLE @DATA(gt_data)
  FROM faglflext
  LEFT JOIN skat       ON faglflext~racct = skat~saknr
  LEFT JOIN cskt ON faglflext~rcntr = cskt~kostl AND cskt~datbi = '99991231'
 WHERE faglflext~rbukrs IN @company1
   AND faglflext~ryear = @pyear
   AND faglflext~rcntr IN @costc
   AND faglflext~racct IN @acct
   AND FAGLFLEXT~rfarea in @CostP.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 May 2020 03:10:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184256#M1980122</guid>
      <dc:creator>former_member625844</dc:creator>
      <dc:date>2020-05-18T03:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: why not initial not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184257#M1980123</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;loki_luo15&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Instead of IS NOT INITIAL, try IF NOT NULL. Check how the program behaves then we can understand how the data is stored.&lt;/P&gt;&lt;P&gt;Also your code is not right as explained below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;     IF gs_data-rfarea &amp;lt;&amp;gt; ''.   --&amp;gt; Not Rite
          ...
      endif.


***Try this 
     IF gs_data-rfarea &amp;lt;&amp;gt; space.
          ...
      endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 05:32:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184257#M1980123</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2020-05-18T05:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: why not initial not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184258#M1980124</link>
      <description>&lt;P&gt;Your code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT
        faglflext~rbukrs,
        faglflext~rfarea,
        ...
  INTO TABLE @DATA(gt_data)
  FROM faglflext
  ...
LOOP AT gt_data INTO DATA(gs_data).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It means that RFAREA in GT_DATA is of type FAGLFLEXT-RFAREA, so it's &lt;STRONG&gt;CHAR 16.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Conclusion: it means that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;     IF gs_data-rfarea is not initial.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is strictly identical to:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;     IF gs_data-rfarea &amp;lt;&amp;gt; ' '.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and the error is in &lt;STRONG&gt;your analysis or presentation of error&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 06:29:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184258#M1980124</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-18T06:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: why not initial not work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184259#M1980125</link>
      <description>&lt;P&gt;All of these literals/constants are strictly identical in ABAP:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;''
' '
space&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;NB 1: '' is not an empty character literal because the minimum for a literal of type C is one character, so it means one space.&lt;/P&gt;&lt;P&gt;NB 2: I'm not talking about the &lt;STRONG&gt;back quote&lt;/STRONG&gt; (`) here, which is used for literals of type STRING, it has a different meaning and behavior.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 08:27:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-not-initial-not-work/m-p/12184259#M1980125</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-18T08:27:31Z</dc:date>
    </item>
  </channel>
</rss>

