<?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 How do i write select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733502#M898578</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 declaring the internal table like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it_mska occurs 0.&lt;/P&gt;&lt;P&gt;include structure mska.&lt;/P&gt;&lt;P&gt;data : prctr like marc-prctr.&lt;/P&gt;&lt;P&gt;data : end of it_mska.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want join the MSKA and MARC. But I want all the fields from MSKA and prctr from MARC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help me in this .&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Apr 2008 16:21:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-28T16:21:43Z</dc:date>
    <item>
      <title>How do i write select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733502#M898578</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 declaring the internal table like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it_mska occurs 0.&lt;/P&gt;&lt;P&gt;include structure mska.&lt;/P&gt;&lt;P&gt;data : prctr like marc-prctr.&lt;/P&gt;&lt;P&gt;data : end of it_mska.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want join the MSKA and MARC. But I want all the fields from MSKA and prctr from MARC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help me in this .&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2008 16:21:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733502#M898578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-28T16:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do i write select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733503#M898579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll want to add some WHERE clauses, but this should get you in the ball game&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: mara, marc.

DATA : BEGIN OF it_mska OCCURS 0.
        INCLUDE STRUCTURE mska.
DATA : prctr LIKE marc-prctr.
DATA : END OF it_mska.


SELECT * INTO CORRESPONDING FIELDS OF TABLE it_mska
  FROM mara AS a
  JOIN marc AS b ON a~matnr = b~matnr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2008 16:27:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733503#M898579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-28T16:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do i write select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733504#M898580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   do this way  ....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : begin of it_mska occurs 0.
include structure mska.
data : end of it_mska.

data : begin of it_marc occurs 0,
     matnr like marc-matnr,
     werks like marc-werks,
     prctr like marc-prctr,
   end of it_marc.

data : begin of it_final occurs 0.
include structure mska.
data : prctr like marc-prctr.
data : end of it_final.

select * from mska into table it_mska where &amp;lt;conditions&amp;gt;.
if sy-subrc = 0.
endif.

if not it_mska[] is initial.
  select matnr werks prctr from marc into it_marc 
     for all entries of it_mska
     where matnr = it_mska-matnr and
              werks = it_mska-werks.
  if sy-subrc = 0.
    sort it_marc by matnr werks.
  endif.
endif.
 
loop at it_mska.
  read table it_marc with key matnr = it_mska-matnr 
                                          werks = it_mska-werks.
  if sy-subrc = 0.
    move-corresponding it_marc to it_final.
    move-corresponding it_mska to it_final.
    append it_final.
    clear it_final.
 endif.
endloop. 
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2008 16:31:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733504#M898580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-28T16:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do i write select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733505#M898581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ajay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: mara, marc.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA : BEGIN OF it_mska OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE mska.&lt;/P&gt;&lt;P&gt;DATA : prctr LIKE marc-prctr.&lt;/P&gt;&lt;P&gt;DATA : END OF it_mska.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Select  * &lt;/P&gt;&lt;P&gt;    into corresponding fields of table it_mska&lt;/P&gt;&lt;P&gt;    from MSKA as S &lt;/P&gt;&lt;P&gt;  LEFT OUTER JOIN MARC AS p ON s&lt;SUB&gt;matnr   =  p&lt;/SUB&gt;matnr  &lt;/P&gt;&lt;P&gt;  AND s&lt;SUB&gt;werks = p&lt;/SUB&gt;werks..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Khan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 28, 2008 12:48 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2008 16:38:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-write-select/m-p/3733505#M898581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-28T16:38:25Z</dc:date>
    </item>
  </channel>
</rss>

