<?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: inner joins in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619333#M277153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT MAX(MKPF-CPUDT) MAX(MKPF-CPUTM) into (ldate, ltime)&lt;/P&gt;&lt;P&gt;from mkpf inner join mseg on&lt;/P&gt;&lt;P&gt;mkpf&lt;SUB&gt;mblnr = mseg&lt;/SUB&gt;mblnr and mkpf&lt;SUB&gt;mjahr = mseg&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;where mseg&lt;SUB&gt;werks = mchb&lt;/SUB&gt;werks and&lt;/P&gt;&lt;P&gt;mseg&lt;SUB&gt;lgort = mchb&lt;/SUB&gt;lgort and&lt;/P&gt;&lt;P&gt;mseg&lt;SUB&gt;matnr = mchb&lt;/SUB&gt;matnr and&lt;/P&gt;&lt;P&gt;mseg&lt;SUB&gt;charg = mchb&lt;/SUB&gt;charg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Oct 2006 10:27:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-06T10:27:55Z</dc:date>
    <item>
      <title>inner joins</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619331#M277151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;  i am looping at mchb and i need to join on the following conditions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.	Read table MKPF and retrieve MAX (MKPF-CPUDT) inner join MSEG based on MSEG-WERKS = MCHB-WERKS and MSEG-LGORT = MCHB-LGORT and MSEG-MATNR = MCHB-MATNR and MSEG-CHARG = MCHB-CHARG&lt;/P&gt;&lt;P&gt;ii.	Read table MKPF and retrieve MKPF-BDATU MAX (MKPF-CPUTM) inner join MSEG WHERE MSEG-WERKS = MCHB-WERKS, and MSEG-LGORT = MCHB-LGORT and MSEG-MATNR = MCHB-MATNR and MSEG-CHARG = MCHB-CHARG and MKPF-CPUDT = above retrieved date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DETERMINE latest material doc for movement type (MSEG-BWART) 531 using above logic to get latest doc and get MSEG-AUFNR DETERMINE protein contact (AFKO-PLNBEZ)  using MSEG-AUFNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one help me out. its very urgent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 10:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619331#M277151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T10:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: inner joins</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619332#M277152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_data occurs 0,&lt;/P&gt;&lt;P&gt;       MBLNR type MKPF-MBLNR,&lt;/P&gt;&lt;P&gt;       MJAHR type MKPF-MJAHR,&lt;/P&gt;&lt;P&gt;       CPUDT type mkpf-cpudt,&lt;/P&gt;&lt;P&gt;       ZEILE  type MSEG-zeile,&lt;/P&gt;&lt;P&gt;     end of i_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;mblnr a&lt;/SUB&gt;mjahr a&lt;SUB&gt;cpudt b&lt;/SUB&gt;zeile&lt;/P&gt;&lt;P&gt;         into table i_data&lt;/P&gt;&lt;P&gt;        from mkpf as a inner join mseg as b&lt;/P&gt;&lt;P&gt;       on a&lt;SUB&gt;MBLNR = b&lt;/SUB&gt;MBLNR&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;       for all entries in i_mchb  &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;          where b~WERKS  = i_mchb-werks&lt;/P&gt;&lt;P&gt;            and    b~lgort = i_mchb-lgort&lt;/P&gt;&lt;P&gt;           and   b~matnr = i_mcbh-matnr&lt;/P&gt;&lt;P&gt;          and b~charg = i_mcbh-charg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort i_data by CPUDT Descending.&lt;/P&gt;&lt;P&gt;*U will get the latest record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Follow the same step 2 select query also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 10:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619332#M277152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T10:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: inner joins</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619333#M277153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT MAX(MKPF-CPUDT) MAX(MKPF-CPUTM) into (ldate, ltime)&lt;/P&gt;&lt;P&gt;from mkpf inner join mseg on&lt;/P&gt;&lt;P&gt;mkpf&lt;SUB&gt;mblnr = mseg&lt;/SUB&gt;mblnr and mkpf&lt;SUB&gt;mjahr = mseg&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;where mseg&lt;SUB&gt;werks = mchb&lt;/SUB&gt;werks and&lt;/P&gt;&lt;P&gt;mseg&lt;SUB&gt;lgort = mchb&lt;/SUB&gt;lgort and&lt;/P&gt;&lt;P&gt;mseg&lt;SUB&gt;matnr = mchb&lt;/SUB&gt;matnr and&lt;/P&gt;&lt;P&gt;mseg&lt;SUB&gt;charg = mchb&lt;/SUB&gt;charg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 10:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619333#M277153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T10:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: inner joins</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619334#M277154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi bankley,&lt;/P&gt;&lt;P&gt;  thanks for ur answer but have seen it the second point should be based on above retrived data( from point 1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;look at it once again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 10:34:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619334#M277154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T10:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: inner joins</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619335#M277155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Raju,&lt;/P&gt;&lt;P&gt;No need to give 2 sepaerate select queries u can do that in a single query as said by anurag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prakash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 10:37:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619335#M277155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T10:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: inner joins</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619336#M277156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DETERMINE latest material doc for movement type (MSEG-BWART) 531 using above logic to get latest doc and get MSEG-AUFNR DETERMINE protein contact (AFKO-PLNBEZ) using MSEG-AUFNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% certain about your requirement whether you require all three information max-cpudt and time as well as docno for movement type 531 or it is just the docno for 531 movt type ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max(mblnr) into ldocno&lt;/P&gt;&lt;P&gt;from mblnr inner join mseg&lt;/P&gt;&lt;P&gt;on (same as above)&lt;/P&gt;&lt;P&gt;where mseg~bwart = '531'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select afko~plnbez into lplnbez&lt;/P&gt;&lt;P&gt;from afko inner join mseg on&lt;/P&gt;&lt;P&gt;afko&lt;SUB&gt;aufnr = mseg&lt;/SUB&gt;aufnr&lt;/P&gt;&lt;P&gt;where mseg~mblnr = ldocno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;DEL&gt;Please award points to all helpful answers!!&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 10:42:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-joins/m-p/1619336#M277156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T10:42:37Z</dc:date>
    </item>
  </channel>
</rss>

