<?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 code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632204#M282049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select &amp;lt;data&amp;gt; from table T1 into itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;data&amp;gt; from table T2 into itab2 &lt;/P&gt;&lt;P&gt;for all entries in itab1&lt;/P&gt;&lt;P&gt;where stsma = itab1-stsma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;data&amp;gt; from table T3 into itab3&lt;/P&gt;&lt;P&gt;for all entries in itab2&lt;/P&gt;&lt;P&gt;where stsma = itab2-stsma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is one method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;- Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Oct 2006 08:37:45 GMT</pubDate>
    <dc:creator>gopi_narendra</dc:creator>
    <dc:date>2006-10-19T08:37:45Z</dc:date>
    <item>
      <title>Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632201#M282046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem on coding this,&lt;/P&gt;&lt;P&gt;Using the Status Profile (STSMA) from i_tab1 and Status (STAT)from i_tab2, get the value of Status Description (TXT30) from table TJ30 and store in i_tab3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table TJ30 has the ff fields:&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;STSMA&lt;/P&gt;&lt;P&gt;ESTAT&lt;/P&gt;&lt;P&gt;SPRAS&lt;/P&gt;&lt;P&gt;TXT04&lt;/P&gt;&lt;P&gt;TXT30&lt;/P&gt;&lt;P&gt;LTEXT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:24:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632201#M282046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632202#M282047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can use FOR ALL ENTRIES option &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sowjanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:29:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632202#M282047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632203#M282048</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;but SAP does not allow two FOR ALL ENTRIES statement in a select command.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632203#M282048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632204#M282049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select &amp;lt;data&amp;gt; from table T1 into itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;data&amp;gt; from table T2 into itab2 &lt;/P&gt;&lt;P&gt;for all entries in itab1&lt;/P&gt;&lt;P&gt;where stsma = itab1-stsma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;data&amp;gt; from table T3 into itab3&lt;/P&gt;&lt;P&gt;for all entries in itab2&lt;/P&gt;&lt;P&gt;where stsma = itab2-stsma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is one method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;- Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632204#M282049</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2006-10-19T08:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632205#M282050</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;But i_tab1 does not have a key field in i_tab2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:40:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632205#M282050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632206#M282051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in that case it wont be possible. you must have some field of itab2 in itab1. if not we can not get the required data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;OR ELSE JOIN T1 AND T2&amp;lt;/b&amp;gt; &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;- Gopi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gopi Narendra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:42:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632206#M282051</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2006-10-19T08:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632207#M282052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create other internal table which contains STSMA, STAT or you can add one more field STAT in i_itab1 and append corresponding value into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use SELECT...FOR ALL ENTRIES in table i_itab1 or the new internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vibha &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:43:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632207#M282052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632208#M282053</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;can you be more specific of the tables you are using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sowjanya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:44:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632208#M282053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632209#M282054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best way would be to form another internal table say itab with stsma and stat.&lt;/P&gt;&lt;P&gt;*Assuming there is no link between i_tab1 and i_tab2.&lt;/P&gt;&lt;P&gt;Loop at i_tab1.&lt;/P&gt;&lt;P&gt;loop at i_tab2.&lt;/P&gt;&lt;P&gt;  move i_tab1-stsma to itab-stsma.&lt;/P&gt;&lt;P&gt;  move i_tab2-stat to itab-stat.&lt;/P&gt;&lt;P&gt;  collect itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;SELECT stsma estat txt30 into table i_tab3&lt;/P&gt;&lt;P&gt;from tj30 &lt;/P&gt;&lt;P&gt;for all entries in itab&lt;/P&gt;&lt;P&gt;where stsma = itab-stsma&lt;/P&gt;&lt;P&gt;and estat = itab-stat&lt;/P&gt;&lt;P&gt;and spras = sy-langu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*If there is a link you can straight use i_tab2 in for all enteries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632209#M282054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632210#M282055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two ways to achieve this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;Combine itab1 and itab2 into one table: itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select txt30 into itab3&lt;/P&gt;&lt;P&gt;from tj30 for all entries in itab&lt;/P&gt;&lt;P&gt;where stsma = itab-stsma &lt;/P&gt;&lt;P&gt;and estat = itab-stat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;P&gt;get data originally from database tables and then go for a for all entries approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;lt;dbtab1&amp;gt;-stsma &amp;lt;dbtab2&amp;gt;-stat into itab1 from &amp;lt;dbtab1&amp;gt; join &amp;lt;dbtab2&amp;gt; on &amp;lt;dbtab1&amp;gt;-field1 = &amp;lt;dbtab2&amp;gt;-field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select txt30 into itab3&lt;/P&gt;&lt;P&gt;from tj30 for all entries in itab1&lt;/P&gt;&lt;P&gt;where stsma = itab1-stsma &lt;/P&gt;&lt;P&gt;and estat = itab1-stat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any further queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to mark helpful answers!&lt;/P&gt;&lt;P&gt;Gaurav Parmar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 08:47:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632210#M282055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T08:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632211#M282056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I guess you are trying to get the statuses and their descriptions within a status profile. If that is the case, i guess below code can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: tj20, tj30, tj30t.

types: begin of t_stat,
         stsma like tj20-stsma,
         estat like tj30-estat,
         txt30 like tj30t-txt30,
       end of t_stat.
data: it_status type standard table of t_stat,
      wa_status type t_stat.


select a~stsma b~estat c~txt30
       into table it_status
       from tj20 as a
       inner join tj30 as b
       on a~stsma = b~stsma
       inner join tj30t as c
       on b~stsma = c~stsma
       and  b~estat = c~estat
       where a~stsma eq 'SD_00001'.

break-point.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy the above code to a temporary program, give a status profile name in the where condition and check the values in internal table IT_STATUS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2006 09:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-code/m-p/1632211#M282056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-19T09:08:27Z</dc:date>
    </item>
  </channel>
</rss>

