<?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 SQL Syntax Question in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566404#M1077656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone: I am trying to write an SQL query in ABAP function. I know how to write it in Oracle but not sure how to write it in ABAP. For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of wa_ITAB_SALESRECS,&lt;/P&gt;&lt;P&gt;ZVBELN type VBELN_VA,&lt;/P&gt;&lt;P&gt;ZPOSNR type POSNR_VA,&lt;/P&gt;&lt;P&gt;end of WA_ITAB_SALESRECS,&lt;/P&gt;&lt;P&gt;ITAB_SALESRECS LIKE HASHED TABLE OF WA_ITAB_SALESRECS WITH UNIQUE KEY ZVBELN ZPOSNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select VBAK, '' from VBAK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNION ALL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select VBELN, POSNR from VBAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to enter the result into wa_itab_salesrecs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that '' in the first select statement is a blank. I don't know the syntax for blanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I want to know is:&lt;/P&gt;&lt;P&gt;1. What is the syntax to enter blank&lt;/P&gt;&lt;P&gt;2. What is the syntax for UNION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2008 06:17:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-07T06:17:16Z</dc:date>
    <item>
      <title>SQL Syntax Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566404#M1077656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone: I am trying to write an SQL query in ABAP function. I know how to write it in Oracle but not sure how to write it in ABAP. For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: begin of wa_ITAB_SALESRECS,&lt;/P&gt;&lt;P&gt;ZVBELN type VBELN_VA,&lt;/P&gt;&lt;P&gt;ZPOSNR type POSNR_VA,&lt;/P&gt;&lt;P&gt;end of WA_ITAB_SALESRECS,&lt;/P&gt;&lt;P&gt;ITAB_SALESRECS LIKE HASHED TABLE OF WA_ITAB_SALESRECS WITH UNIQUE KEY ZVBELN ZPOSNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select VBAK, '' from VBAK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNION ALL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select VBELN, POSNR from VBAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to enter the result into wa_itab_salesrecs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that '' in the first select statement is a blank. I don't know the syntax for blanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I want to know is:&lt;/P&gt;&lt;P&gt;1. What is the syntax to enter blank&lt;/P&gt;&lt;P&gt;2. What is the syntax for UNION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 06:17:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566404#M1077656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T06:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Syntax Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566405#M1077657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;         from vbak  &lt;/P&gt;&lt;P&gt;into table it_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln &lt;/P&gt;&lt;P&gt;         posnr&lt;/P&gt;&lt;P&gt;       from vbap&lt;/P&gt;&lt;P&gt;for all entries in it_vbak&lt;/P&gt;&lt;P&gt;where vbeln  = it_vbak-vbeln.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 06:23:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566405#M1077657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T06:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Syntax Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566406#M1077658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use inner join or for all enteries&lt;/P&gt;&lt;P&gt;use F1 help by typing this in editor &lt;/P&gt;&lt;P&gt;hope u will get that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 06:52:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566406#M1077658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T06:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Syntax Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566407#M1077659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mohammed, what part of my question is your response answering? Looks like you're very new to SAP so let me know if you really didn't understand the question at all and I can clarifiy it for you. Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Janagar: I was looking for the exact syntax and I'm not sure how using the inner join can fix the problem but Ill follow your suggestion about using F1 for help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you gentlemen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 17:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566407#M1077659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T17:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Syntax Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566408#M1077660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Romina, what do you mean by blank in the &lt;STRONG&gt;SELECT&lt;/STRONG&gt; statement. I believe what Mohammad given will solve your problem. or else try the below statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_auart like vbak-auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select a&lt;SUB&gt;Vbeln b&lt;/SUB&gt;posnr a~vbtyp into table it_vbakvbap &lt;/P&gt;&lt;P&gt;from VBAK as A  &lt;/P&gt;&lt;P&gt;JOIN VBAP as B &lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;mandt = b&lt;/SUB&gt;mandt and&lt;/P&gt;&lt;P&gt;       a&lt;SUB&gt;vbeln   = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;        auart = l_auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Jey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 03:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566408#M1077660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-08T03:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Syntax Question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566409#M1077661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Romina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Be 'nicer'  to people who answer your queries. I am refering to your 'new to SAP' in response to Mohammed's reply. Appreciate that he has tried to answer your query..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madan...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2008 03:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-syntax-question/m-p/4566409#M1077661</guid>
      <dc:creator>madan_ullasa</dc:creator>
      <dc:date>2008-10-08T03:59:49Z</dc:date>
    </item>
  </channel>
</rss>

