<?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: Select Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878905#M1478226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 May 2010 14:46:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-05-21T14:46:07Z</dc:date>
    <item>
      <title>Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878899#M1478220</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;After spending some hours I wrote a query which is needed for my project.There are some problems in the query and Iam not 100 % sure wheather it will work.Thats why the post here.(some of the field names wont be exactly right)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM BOM_Test.
data: lv_cdpos_cond type string.     
lv_cdpos_cond = 'cdpos~feldname = '.
concatenate lv_cdpos_cond  'Fmenge'
'and cdpos~chngid = ' 'I'
'OR cdpos~chngid = '  'U'
  'OR cdpos~chngid = ' 'D'
  'and cdpos~tabname = ' 'stpos' INTO lv_cdpos_cond SEPARATED BY space.
  select cdhdr~username cdhdr~udate cdpos~changeid cdpos~valuenew
         cdpos~valueold cdpos~tabname cdpos~feldname stpos~stlr
         stpos~stlr stpos~position stpos~component mast~material
          mara~mattxt into CORRESPONDING FIELDS OF TABLE gt_ditab
         from cdhdr
         INNER JOIN cdpos on cdhdr~OBJECTCLAS = cdpos~OBJECTCLAS
          and cdhdr~changenr = cdpos~changenr
        INNER JOIN stpos on cdpos~tabkey = stpos~(
            mandt+bomtype+bom+nodetype+counter)
        INNER join mast on stpos~stlnr = mast~stlnr
        INNER JOIN mara on mast~matnr = mara~matnr
        where cdhdr~objectclas = 'stue'
        and cdhdr~udate in so_date
        and lv_cdpos_cond and lv_stpos_cond
        and mast~matnr in so_matrange
        and mara-matnr = mast~matnr.
Endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have to select some data from 5 different tables(CDHDR,CDPOS,stpos.mast and mara). As Iam trying it on a test machine from home.Anyway its still not a compilable select query as there are still some holes to plug in.The purpose of this query is to get the changed BOM data.Iam using 1 string in my Select query lv_cdpos_cond to make the query readable. But the strings inside the strings like 'I','U' or 'D' is not concateneted as a string.How could it be done .Also will the "OR " condition in the string lv_cdpos_cond work(if it is used directly in the select query) in the sql query.&lt;/P&gt;&lt;P&gt;The innerJoin " INNER JOIN stpos on cdpos&lt;SUB&gt;tabkey = stpos&lt;/SUB&gt;( mandt&lt;EM&gt;bomtype&lt;/EM&gt;bom&lt;EM&gt;nodetype&lt;/EM&gt;counter)" :Here the cdpos~tabkey is a concateneted value from the fields(mandt&lt;EM&gt;bomtype&lt;/EM&gt;bom&lt;EM&gt;nodetype&lt;/EM&gt;counter) in stpos. how to make a join condition here.&lt;/P&gt;&lt;P&gt;Will this query work :).Will it be a performant query.Would be nice if some one could post a edited query if there are problems in my the query.(spend 2 hrs to write this,Thats why &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;) &lt;/P&gt;&lt;P&gt; Thanks kOH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Kohinoor72 on May 21, 2010 2:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 12:36:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878899#M1478220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T12:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878900#M1478221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's see:&lt;/P&gt;&lt;P&gt;&amp;gt; some of the field names wont be exactly right&lt;/P&gt;&lt;P&gt;&amp;gt; its still not a compilable select query &lt;/P&gt;&lt;P&gt;&amp;gt; there are still some holes to plug &lt;/P&gt;&lt;P&gt;&amp;gt; Would be nice if some one could post a edited query if there are problems in my the query&lt;/P&gt;&lt;P&gt;And you want the forum to fix it for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you should work on it a bit more yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 13:38:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878900#M1478221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T13:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878901#M1478222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if I have offended you with my statement.&lt;/P&gt;&lt;P&gt;As said I worked on this query for 2 hours...(am a beginner in abap )&lt;/P&gt;&lt;P&gt;I could proceed on my own only if someone could help me on the inner join and the string question.&lt;/P&gt;&lt;P&gt;Iam stuck there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 13:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878901#M1478222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T13:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878902#M1478223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No offense taken - but you have to realize that this is not a forum for beginners. You should provide code that has a specific problem and then ask a specific question about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, Please read &lt;SPAN __jive_macro_name="thread" id="927634"&gt;&lt;/SPAN&gt; and &lt;SPAN __jive_macro_name="thread" id="1283414"&gt;&lt;/SPAN&gt; and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 14:21:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878902#M1478223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T14:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878903#M1478224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Kohinoor72  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe you  shoult try to do more then a select.....and not only one with the inner join...it will be more clear.&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 14:21:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878903#M1478224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T14:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878904#M1478225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob.Then I will close this thread as my question was a bit wierd and open another thread with my specific questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 14:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878904#M1478225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T14:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878905#M1478226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 May 2010 14:46:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/6878905#M1478226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-21T14:46:07Z</dc:date>
    </item>
  </channel>
</rss>

