<?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 'IF data IS INITIAL' not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536055#M244572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody else experienced this problem and if so what was your solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a select statement that gets data from table VBKD, the problem relates specifically to the field bstdk_e.  The data is initially stored in a temporary table but is then split into two seperate internal tables depedning on the value of POSNR.  All of the itabs and work areas use the same type declaration which contains a field 'bstdk_e' with type 'vbkd-bstdk_e'.  Later in the program I check to see if this field is not initial i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT itab-bstdk_e IS INITIAL.
* do some stuff
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the program is returning true at the IF statement when the contents of bstdk_e are INITIAL i.e. '00000000'. I have tried with other date fields on VBKD and they work fine.  All of the date fields I tried use the same domain (datum) and are type declared in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imagine I could get it to work by using the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF itab-bstdk_e &amp;lt;&amp;gt; '00000000'.
* do some stuff
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I'm not sure if this is safe and am concerned the problem is a symptom of something more serious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Aug 2006 11:15:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-29T11:15:40Z</dc:date>
    <item>
      <title>'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536055#M244572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody else experienced this problem and if so what was your solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a select statement that gets data from table VBKD, the problem relates specifically to the field bstdk_e.  The data is initially stored in a temporary table but is then split into two seperate internal tables depedning on the value of POSNR.  All of the itabs and work areas use the same type declaration which contains a field 'bstdk_e' with type 'vbkd-bstdk_e'.  Later in the program I check to see if this field is not initial i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT itab-bstdk_e IS INITIAL.
* do some stuff
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the program is returning true at the IF statement when the contents of bstdk_e are INITIAL i.e. '00000000'. I have tried with other date fields on VBKD and they work fine.  All of the date fields I tried use the same domain (datum) and are type declared in the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imagine I could get it to work by using the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF itab-bstdk_e &amp;lt;&amp;gt; '00000000'.
* do some stuff
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I'm not sure if this is safe and am concerned the problem is a symptom of something more serious.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:15:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536055#M244572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536056#M244573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BSTKD_E is character field of length 35, Hence the initial value of that field is '0000000' but blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know why you have '0000000' as one of the entries in VBKD, but it is not correct. you can check out the assosiated Order and get it corrected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:20:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536056#M244573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536057#M244574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field in question is bstdk_e not bstkd_e - which I agree is a little confusing!!!  bstdk_e is a field of domain datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:25:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536057#M244574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536058#M244575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I hope  the internal table field itab-bstdk_e must have been declared like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bstdk_e(10) type c or it may refer a data element,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if you declare like this the condition always fails, because for all &amp;lt;b&amp;gt;the character fields the initial value will be a blank space and for the date fields with type d it will be '0000000'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; when you move the date field to a character field your condition fails.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishnakumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:26:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536058#M244575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536059#M244576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krishnakumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field is declared in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_itab,
bstdk_e TYPE vbkd-bstdk_e,
END OF ty_itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore, I think it should contain '00000000' as its initial value and there is no type conversion occuring as all fields containing data from bstdk_e are of type bstdk_e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:31:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536059#M244576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536060#M244577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been testing the code, and it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i put :(with value 00000000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn´t enter:&lt;/P&gt;&lt;P&gt;if not vbkd-bstdk_e is initial.&lt;/P&gt;&lt;P&gt;    write 'a'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It enters:&lt;/P&gt;&lt;P&gt;if vbkd-bstdk_e is initial.&lt;/P&gt;&lt;P&gt;    write 'a'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:38:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536060#M244577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536061#M244578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The field which you mentioned here is BSTDK_E, its an date field so it can't allow as initial, you have to mention like&lt;/P&gt;&lt;P&gt;if BSTDK_E &amp;lt;&amp;gt; '00000000'.&lt;/P&gt;&lt;P&gt;**do some stuff&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;This is right statement which you have to use.&lt;/P&gt;&lt;P&gt;I used these types in so many programs.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Satheesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536061#M244578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T11:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536062#M244579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i just tried this simple code and it works as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: vbkd .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab LIKE vbkd OCCURS 0 WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * UP TO 10 ROWS FROM vbkd INTO TABLE itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab .&lt;/P&gt;&lt;P&gt;  IF NOT itab-bstdk_e IS INITIAL .&lt;/P&gt;&lt;P&gt;write:/ 'Success' .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 11:46:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536062#M244579</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-08-29T11:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536063#M244580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raja&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried running this on our system and it doesn't work!  We're on Release 4.6C on Windows OS using an Oracle 9.2 DB - if that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 13:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536063#M244580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T13:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536064#M244581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since it is a Date Field , you have to do the check in this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if itab-BSTDK_E+0(4) &amp;lt;&amp;gt; '0000'.
"field is with data..
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 14:07:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536064#M244581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-29T14:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: 'IF data IS INITIAL' not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536065#M244582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case of date better check for initial using the operator CO/CN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab_bstdk_e CN '0 '.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do some stuff.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2006 14:12:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-data-is-initial-not-working/m-p/1536065#M244582</guid>
      <dc:creator>former_member195698</dc:creator>
      <dc:date>2006-08-29T14:12:46Z</dc:date>
    </item>
  </channel>
</rss>

