<?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: Query regarding inner join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790367#M340089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you should try something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select a~begda a~endda b~kostl b~persg "b~anvsh c~pernr
       into corresponding fields of table i_emp
       from pa0000 as a
       inner join pa0001 as b
       on a~pernr = b~pernr
       inner join pa0003 as c
       on a~pernr = c~pernr
       for all entries in pa0002
       where b~pernr = pa0002-pernr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure that you are declaring PA0002 as internal table and you are checking the internal table is not initial.&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>Wed, 20 Dec 2006 06:48:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-20T06:48:51Z</dc:date>
    <item>
      <title>Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790363#M340085</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 anyone explain me the error in this select query and give me the correct answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select 1&lt;SUB&gt;begda 1&lt;/SUB&gt;endda 2&lt;SUB&gt;kostl 2&lt;/SUB&gt;persg 2&lt;SUB&gt;anvsh 3&lt;/SUB&gt;pernr into&lt;/P&gt;&lt;P&gt;corresponding fields of table i_emp from&lt;/P&gt;&lt;P&gt;( ( pa0000 as 1 innerjoin pa0001 as 2 on 1&lt;SUB&gt;pernr = 2&lt;/SUB&gt;pernr )&lt;/P&gt;&lt;P&gt;join pa0003 as 3 on 3&lt;SUB&gt;pernr = pa0002&lt;/SUB&gt;pernr )&lt;/P&gt;&lt;P&gt;for all entries in pa0002 &lt;/P&gt;&lt;P&gt;where 2~pernr = pa0002-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Requirement is :&lt;/P&gt;&lt;P&gt;retreive data from 4 tables :PA0000,PA0001,PA0002,PA0003 based on pernr field.&lt;/P&gt;&lt;P&gt;From PA0000 we need begda and endda.&lt;/P&gt;&lt;P&gt;From PA0001 we need kostl and persg and anvsh.&lt;/P&gt;&lt;P&gt;From PA0002 we need to concatenate VORNA and NACHN fieldsand put this in display_name field of i_emp.How to do this in innerjoin.&lt;/P&gt;&lt;P&gt;From PA0003 we need pernr field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of t_emp is:&lt;/P&gt;&lt;P&gt;types:begin of t_emp,&lt;/P&gt;&lt;P&gt;         start_date like pa0000-begda,&lt;/P&gt;&lt;P&gt;         end_date like pa0000-endda,&lt;/P&gt;&lt;P&gt;         cost_centre like pa0001-kostl,&lt;/P&gt;&lt;P&gt;         active_status like pa0001-persg,&lt;/P&gt;&lt;P&gt;         display_name(80) type c,&lt;/P&gt;&lt;P&gt;         perno like pa0003-pernr,&lt;/P&gt;&lt;P&gt;         activity_type like zpm_activity_typ-lstar,&lt;/P&gt;&lt;P&gt;         contract_id like pa0001-anvsh,&lt;/P&gt;&lt;P&gt;        end of t_emp.&lt;/P&gt;&lt;P&gt;data:i_emp type standard table of t_emp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me the exact select query.The perfect one.&lt;/P&gt;&lt;P&gt;Points will definitely be given.This is really urgent.&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you&lt;/P&gt;&lt;P&gt;chandrika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 06:31:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790363#M340085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T06:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790364#M340086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your select query to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select 1&lt;SUB&gt;begda 1&lt;/SUB&gt;endda 2&lt;SUB&gt;kostl 2&lt;/SUB&gt;persg 2&lt;SUB&gt;anvsh 3&lt;/SUB&gt;pernr into&lt;/P&gt;&lt;P&gt;corresponding fields of table i_emp from&lt;/P&gt;&lt;P&gt;( ( pa0000 as 1 innerjoin pa0001 as 2 on 1&lt;SUB&gt;pernr = 2&lt;/SUB&gt;pernr )&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;join pa0003 as 3 on 3&lt;SUB&gt;pernr = 2&lt;/SUB&gt;pernr )&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;for all entries in pa0002 &lt;/P&gt;&lt;P&gt;where 2~pernr = pa0002-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 06:35:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790364#M340086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T06:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790365#M340087</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;PRE&gt;&lt;CODE&gt;
select 1~begda 
1~endda 
2~kostl 
2~persg 
2~anvsh 
3~pernr 
into corresponding fields of table i_emp from
pa0000 as 1 innerjoin pa0001 as 2 on 1~pernr = 2~pernr
innerjoin pa0003 as 3 on 3~pernr = pa0002~pernr


select pernr VORNA NACHN from pa0002 
into table i_displayname
for all entries in i_emp 
where pernr = i_emp-pernr.

loop at i_emp assigning &amp;lt;fieldsymbol&amp;gt;.
read table i_displayname with key pernr = &amp;lt;fieldsymbol&amp;gt;-pernr.
if sy-subrc eq 0.
concatenate &amp;lt;fieldsymbol&amp;gt;-vorna &amp;lt;fieldsymbol&amp;gt;-nachn into i_emp-display_name separated by space.
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 06:40:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790365#M340087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T06:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790366#M340088</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;Instead of using inner join,use logical database PNP in the attributes of the report.&lt;/P&gt;&lt;P&gt;infotypes : p0000, p0001, p0002, p0003.&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;get pernr.&lt;/P&gt;&lt;P&gt;rp_provide_from_last p0000 space pn-begda pn-endda.&lt;/P&gt;&lt;P&gt;if pnp-sw-found = 1.&lt;/P&gt;&lt;P&gt;w_emp-begda = p0000-begda.&lt;/P&gt;&lt;P&gt; w_emp-enda = p0000-endda.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;rp_provide_from_last p0001 space pn-begda pn-endda.&lt;/P&gt;&lt;P&gt;if pnp-sw-found = 1.&lt;/P&gt;&lt;P&gt; w_emp-kostl = p0001-kostl.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;append w_emp to i_emp.&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 06:41:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790366#M340088</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-20T06:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790367#M340089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you should try something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select a~begda a~endda b~kostl b~persg "b~anvsh c~pernr
       into corresponding fields of table i_emp
       from pa0000 as a
       inner join pa0001 as b
       on a~pernr = b~pernr
       inner join pa0003 as c
       on a~pernr = c~pernr
       for all entries in pa0002
       where b~pernr = pa0002-pernr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure that you are declaring PA0002 as internal table and you are checking the internal table is not initial.&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>Wed, 20 Dec 2006 06:48:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790367#M340089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T06:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790368#M340090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make use of Logical databse PNP (mention in attributes of prgram) and copy this code below ,it will work and dont forget to award me points - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZGILL_TEST11                                                *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZGILL_TEST11                   message-id rp&lt;/P&gt;&lt;P&gt;                             line-size 250&lt;/P&gt;&lt;P&gt;                             line-count 65          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;infotypes: 0000,&lt;/P&gt;&lt;P&gt;           0001,&lt;/P&gt;&lt;P&gt;           0002,&lt;/P&gt;&lt;P&gt;           0003.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants: c_1(1)       type c               value '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table for Output&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: begin of t_output occurs 0    ,&lt;/P&gt;&lt;P&gt;       pernr like pernr-pernr       ,&lt;/P&gt;&lt;P&gt;       name(80),&lt;/P&gt;&lt;P&gt;       begda like p0000-begda       ,&lt;/P&gt;&lt;P&gt;       endda like p0000-endda       ,&lt;/P&gt;&lt;P&gt;       kostl like p0001-kostl,&lt;/P&gt;&lt;P&gt;       persg like p0001-persg,&lt;/P&gt;&lt;P&gt;       ansvh like p0001-ansvh.&lt;/P&gt;&lt;P&gt;data: end of t_output           .&lt;/P&gt;&lt;P&gt;Start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear t_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read Infotype 0&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  rp-provide-from-last p0000 space pn-begda pn-endda.&lt;/P&gt;&lt;P&gt;  check pnp-sw-found eq c_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read Infotype 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  rp-provide-from-last p0001 space pn-begda pn-endda.&lt;/P&gt;&lt;P&gt;  check pnp-sw-found eq c_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read Infotype 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  rp-provide-from-last p0002 space pn-begda pn-endda.&lt;/P&gt;&lt;P&gt;  check pnp-sw-found eq c_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  rp-provide-from-last p0003 space pn-begda pn-endda.&lt;/P&gt;&lt;P&gt;   check pnp-sw-found eq c_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Gather all the required information related to the emp&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  move: pernr-pernr to t_output-pernr,&lt;/P&gt;&lt;P&gt;        p0000-begda to t_output-begda,&lt;/P&gt;&lt;P&gt;        p0000-endda to t_output-endda,&lt;/P&gt;&lt;P&gt;        p0001-kostl to t_output-kostl,&lt;/P&gt;&lt;P&gt;        p0001-persg to t_output-persg,&lt;/P&gt;&lt;P&gt;        p0001-ansvh to t_output-ansvh.&lt;/P&gt;&lt;P&gt;concatenate p0002-vorna p0002-nachn  into t_output-name separated by space.&lt;/P&gt;&lt;P&gt;append t_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; perform print_report.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 06:59:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790368#M340090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T06:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790369#M340091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it gives an error "(" has no closing ")" for the query which u gave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 08:24:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790369#M340091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T08:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Query regarding inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790370#M340092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message : Warning !! Do not put irrelevant comments while closing old threads.  &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar on Sep 5, 2011 11:04 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2011 05:18:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-regarding-inner-join/m-p/1790370#M340092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-05T05:18:02Z</dc:date>
    </item>
  </channel>
</rss>

