<?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: Join problems in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359639#M521832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Glen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; How did u define w_extract-eindt, w_extract-menge, w_extract-ebeln,&lt;/P&gt;&lt;P&gt;                          w_extract-matnr, w_extract-meins,   w_extract-wladg?&lt;/P&gt;&lt;P&gt;If u define them as variables, then u will get only the first  line .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u need all the records , then u can define an internal table with the fields .&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF it_eket OCCURS 0,&lt;/P&gt;&lt;P&gt;eindt like eket-eindt,&lt;/P&gt;&lt;P&gt;menge like eket-menge,&lt;/P&gt;&lt;P&gt;ebeln like eket-ebeln,&lt;/P&gt;&lt;P&gt;matnr like ekpo-matnr,&lt;/P&gt;&lt;P&gt;meins like ekpo-meins,&lt;/P&gt;&lt;P&gt;wladg like maw1-wladg,&lt;/P&gt;&lt;P&gt;END OF it_eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then u can write a select statement as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a~eindt&lt;/P&gt;&lt;P&gt;       a~menge&lt;/P&gt;&lt;P&gt;       a~ebeln&lt;/P&gt;&lt;P&gt;       b~matnr&lt;/P&gt;&lt;P&gt;       b~meins&lt;/P&gt;&lt;P&gt;       c~wladg&lt;/P&gt;&lt;P&gt;  into table it_eket&lt;/P&gt;&lt;P&gt;  from eket as a join ekpo as b&lt;/P&gt;&lt;P&gt;  on a&lt;SUB&gt;ebeln eq b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;  and a&lt;SUB&gt;ebelp eq b&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;  join maw1 as c&lt;/P&gt;&lt;P&gt;  on b&lt;SUB&gt;matnr eq c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;  where c~wladg in s_wladg&lt;/P&gt;&lt;P&gt;    and a~eindt in s_eindt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will get u all the records into internal table it_eket .&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;Sree&lt;/P&gt;&lt;P&gt;PS: Rewards points if Useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2007 10:04:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-14T10:04:51Z</dc:date>
    <item>
      <title>Join problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359635#M521828</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 trying to extract some PO item data using a join statement and I only get one line in w_extract, the data from the first line in EKET and the corresponding data from MAW1 and EKPO. Can someone see what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked EKET and I have nine items corresponding to the EINDT-selection. I do not fill s_wladg in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also checked EKPO and found the same nine items as in EKET and checked MAW1 for the materials and all have a WLADG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select a~eindt
       a~menge
       a~ebeln
       b~matnr
       b~meins
       c~wladg
  into (w_extract-eindt,
       w_extract-menge,
       w_extract-ebeln,
       w_extract-matnr,
       w_extract-meins,
       w_extract-wladg)
  from eket as a join ekpo as b
  on a~ebeln eq b~ebeln
  and a~ebelp eq b~ebelp
  join maw1 as c
  on b~matnr eq c~matnr
  where c~wladg in s_wladg
    and a~eindt in s_eindt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Glenn Karlsson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 09:51:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359635#M521828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T09:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Join problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359636#M521829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Select statement look s fine&lt;/P&gt;&lt;P&gt;But the sequence of data flow is first into EKPO then EKET&lt;/P&gt;&lt;P&gt;so change little bit like&lt;/P&gt;&lt;P&gt;select b~ebeln&lt;/P&gt;&lt;P&gt;         a~eindt&lt;/P&gt;&lt;P&gt;       a~menge&lt;/P&gt;&lt;P&gt;       b~matnr&lt;/P&gt;&lt;P&gt;       b~meins&lt;/P&gt;&lt;P&gt;       c~wladg&lt;/P&gt;&lt;P&gt;  into (w_extract-ebeln,&lt;/P&gt;&lt;P&gt;         w_extract-eindt,&lt;/P&gt;&lt;P&gt;       w_extract-menge,&lt;/P&gt;&lt;P&gt;        w_extract-matnr,&lt;/P&gt;&lt;P&gt;       w_extract-meins,&lt;/P&gt;&lt;P&gt;       w_extract-wladg)&lt;/P&gt;&lt;P&gt;  from ekpo as b join eket as a&lt;/P&gt;&lt;P&gt;  on a&lt;SUB&gt;ebeln eq b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;  and a&lt;SUB&gt;ebelp eq b&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;  join maw1 as c&lt;/P&gt;&lt;P&gt;  on b&lt;SUB&gt;matnr eq c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;  where a~eindt in s_eindt and&lt;/P&gt;&lt;P&gt;c~wladg in s_wladg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for useful Answers&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 09:57:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359636#M521829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T09:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Join problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359637#M521830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am not sure whether you have pasted full select or not because endselect is not there ... and if you are not using select single as per your query then you will get an error.&lt;/P&gt;&lt;P&gt;data : itab like w_extract occurs 0 with header line.&lt;/P&gt;&lt;P&gt;select a~eindt&lt;/P&gt;&lt;P&gt;       a~menge&lt;/P&gt;&lt;P&gt;       a~ebeln&lt;/P&gt;&lt;P&gt;       b~matnr&lt;/P&gt;&lt;P&gt;       b~meins&lt;/P&gt;&lt;P&gt;       c~wladg&lt;/P&gt;&lt;P&gt;  into (w_extract-eindt,&lt;/P&gt;&lt;P&gt;       w_extract-menge,&lt;/P&gt;&lt;P&gt;       w_extract-ebeln,&lt;/P&gt;&lt;P&gt;       w_extract-matnr,&lt;/P&gt;&lt;P&gt;       w_extract-meins,&lt;/P&gt;&lt;P&gt;       w_extract-wladg)&lt;/P&gt;&lt;P&gt;  from eket as a join ekpo as b&lt;/P&gt;&lt;P&gt;  on a&lt;SUB&gt;ebeln eq b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;  and a&lt;SUB&gt;ebelp eq b&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;  join maw1 as c&lt;/P&gt;&lt;P&gt;  on b&lt;SUB&gt;matnr eq c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;  where c~wladg in s_wladg&lt;/P&gt;&lt;P&gt;    and a~eindt in s_eindt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append w_extract to itab.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab. " put break point and check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 09:58:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359637#M521830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T09:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Join problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359638#M521831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The problem probably lies in the work area declaration.&lt;/P&gt;&lt;P&gt;I think that you are selecting the values in a work area which can at most have just one record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want a number of records then try to select the values into an internal table directly using the INTO TABLE command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is best to select all the values at once rather than selecting into a work arae or using SELECT ...ENDSELECT commands for performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sandeep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 10:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359638#M521831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T10:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Join problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359639#M521832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Glen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; How did u define w_extract-eindt, w_extract-menge, w_extract-ebeln,&lt;/P&gt;&lt;P&gt;                          w_extract-matnr, w_extract-meins,   w_extract-wladg?&lt;/P&gt;&lt;P&gt;If u define them as variables, then u will get only the first  line .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u need all the records , then u can define an internal table with the fields .&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF it_eket OCCURS 0,&lt;/P&gt;&lt;P&gt;eindt like eket-eindt,&lt;/P&gt;&lt;P&gt;menge like eket-menge,&lt;/P&gt;&lt;P&gt;ebeln like eket-ebeln,&lt;/P&gt;&lt;P&gt;matnr like ekpo-matnr,&lt;/P&gt;&lt;P&gt;meins like ekpo-meins,&lt;/P&gt;&lt;P&gt;wladg like maw1-wladg,&lt;/P&gt;&lt;P&gt;END OF it_eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then u can write a select statement as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a~eindt&lt;/P&gt;&lt;P&gt;       a~menge&lt;/P&gt;&lt;P&gt;       a~ebeln&lt;/P&gt;&lt;P&gt;       b~matnr&lt;/P&gt;&lt;P&gt;       b~meins&lt;/P&gt;&lt;P&gt;       c~wladg&lt;/P&gt;&lt;P&gt;  into table it_eket&lt;/P&gt;&lt;P&gt;  from eket as a join ekpo as b&lt;/P&gt;&lt;P&gt;  on a&lt;SUB&gt;ebeln eq b&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;  and a&lt;SUB&gt;ebelp eq b&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;  join maw1 as c&lt;/P&gt;&lt;P&gt;  on b&lt;SUB&gt;matnr eq c&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;  where c~wladg in s_wladg&lt;/P&gt;&lt;P&gt;    and a~eindt in s_eindt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will get u all the records into internal table it_eket .&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;Sree&lt;/P&gt;&lt;P&gt;PS: Rewards points if Useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 10:04:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359639#M521832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T10:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Join problems</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359640#M521833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all. Combining a couple of the answers I fixed the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 10:28:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-problems/m-p/2359640#M521833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T10:28:44Z</dc:date>
    </item>
  </channel>
</rss>

