<?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: Problem with select query when it returns a NULL value in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426666#M1245236</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jessica ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic which u gave will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only modification u need to do is write the the if condition with the table name followed by the field into which ur are storing the value for VBELN.&lt;/P&gt;&lt;P&gt;lets say u r stroing value for vbeln into field vbeln of internal table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If itab-vbeln  = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u r storing the value into a variable then u need to give the variable name only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If z_vbeln = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;&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;Anuj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ANUJ SRIVASTAVA on Apr 7, 2009 10:57 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ANUJ SRIVASTAVA on Apr 7, 2009 11:06 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Apr 2009 20:52:41 GMT</pubDate>
    <dc:creator>anuj_srivastava</dc:creator>
    <dc:date>2009-04-07T20:52:41Z</dc:date>
    <item>
      <title>Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426664#M1245234</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;I have a d/b table called QMEL and i picked VBELN from that table. Now if the VBELN value in that table is NULL i have to wtite an if condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can i say it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF VBELN = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: enter into the if condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: enter into the else condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or should is say some thing else? my objective is ..i should execute some statments if VBELN has no value and i should execute some othet statements if VBELN has a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help..as even though i put above condition..it deosnot work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jessica Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 20:44:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426664#M1245234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-07T20:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426665#M1245235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can validate as you mentioned or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if qmel-vbeln is initial.   " I think qmel is your internal table 
   " do something
else.
   " do something
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 20:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426665#M1245235</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-04-07T20:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426666#M1245236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jessica ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic which u gave will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only modification u need to do is write the the if condition with the table name followed by the field into which ur are storing the value for VBELN.&lt;/P&gt;&lt;P&gt;lets say u r stroing value for vbeln into field vbeln of internal table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If itab-vbeln  = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u r storing the value into a variable then u need to give the variable name only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If z_vbeln = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;&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;Anuj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ANUJ SRIVASTAVA on Apr 7, 2009 10:57 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ANUJ SRIVASTAVA on Apr 7, 2009 11:06 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 20:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426666#M1245236</guid>
      <dc:creator>anuj_srivastava</dc:creator>
      <dc:date>2009-04-07T20:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426667#M1245237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;IF VBELN = space.

write: enter into the if condition.

ELSE.

write: enter into the else condition.

ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2009 20:54:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426667#M1245237</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-07T20:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426668#M1245238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to use Internal table name followed by field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e ITAB-FIELD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same is applicable always when you are working on the records of the internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 03:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426668#M1245238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T03:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426669#M1245239</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;check this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u r using selection optins  use this code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT s_material[] IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT material                              &lt;/P&gt;&lt;P&gt;    FROM marc&lt;/P&gt;&lt;P&gt;           INTO  l_material&lt;/P&gt;&lt;P&gt;         WHERE material IN s_material.                      &lt;/P&gt;&lt;P&gt;    ENDSELECT.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0 AND l_material IS INITIAL.&lt;/P&gt;&lt;P&gt;      MESSAGE e302 WITH space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u r using parameter then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT P_material IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT material                              &lt;/P&gt;&lt;P&gt;    FROM marc&lt;/P&gt;&lt;P&gt;           INTO  l_material&lt;/P&gt;&lt;P&gt;         WHERE material EQ P_material.                      &lt;/P&gt;&lt;P&gt;    ENDSELECT.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0 AND l_material IS INITIAL.&lt;/P&gt;&lt;P&gt;      MESSAGE e302 WITH space.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~linganna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: katigiri linganna on Apr 8, 2009 5:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 03:58:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426669#M1245239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T03:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426670#M1245240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After your Select Query when it fills some internal table suppose&lt;/P&gt;&lt;P&gt;itab, then you can use statement :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

If not itab is initial.               "that is your intenral table contains some value
                                         " and is not empty
Then your logic.

endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 04:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426670#M1245240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T04:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426671#M1245241</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;u can write like this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

IF itab-VBELN = ' '.

write: enter into the if condition.

ELSE.

write: enter into the else condition.

ENDIF.

or 

IF itab-VBELN is INITIAL.

write: enter into the if condition.

ELSE.

write: enter into the else condition.

ENDIF.




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 04:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426671#M1245241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T04:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426672#M1245242</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;I am putting this condition in an iterative loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So should I be clearing the qmel-vbeln field each time before entering into the loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because it is not working as exptected.so i am wondring what else could be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jessica Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 17:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426672#M1245242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T17:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426673#M1245243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you are using a work area it should not be a problem, if you are using the old Header line concept you might have to clear the header line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 17:28:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426673#M1245243</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-04-08T17:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426674#M1245244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say, my_wa-vbeln = 000123456&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, do u mean that, If I use explicit work area(my_wa), then, there is no need to CLEAR (my_wa-vbeln) in every iteration? Is it automatically CLEARs the value(say, 000123456)  in every iteration?as layed-off,  these days, i dont hv SAP access to check my self.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Jessica,&lt;/P&gt;&lt;P&gt;Just info: I guess, you can not write logic solely depending on VBELN(space/value) value of the VQMEL/QMEL table...I mean, u hv to add some more conditions too it(ur IF condition).......ask ur functional guy.&lt;/P&gt;&lt;P&gt;thanq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: SAP ABAPer on Apr 8, 2009 11:20 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2009 21:16:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426674#M1245244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-08T21:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with select query when it returns a NULL value</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426675#M1245245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks every body....soleved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2009 15:19:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-select-query-when-it-returns-a-null-value/m-p/5426675#M1245245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-09T15:19:46Z</dc:date>
    </item>
  </channel>
</rss>

