<?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 to construct Dynamic Join in ABAP? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917115#M58367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ALL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am typically faced with a situvation where in I need to write a dynamic JOIN SQL statement in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTEST .&lt;/P&gt;&lt;P&gt;PARAMETERS: TBLNAME(50) DEFAULT 'SPFLI'.&lt;/P&gt;&lt;P&gt;DATA: TOTAL_ROWS TYPE P.&lt;/P&gt;&lt;P&gt;SELECT COUNT(*) FROM (TBLNAME) INTO TOTAL_ROWS. &lt;/P&gt;&lt;P&gt;WRITE: / TBLNAME, TOTAL_ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, here the fetch from Table is dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as if i have to conisder the following SQL statement which is a normal JOIN statement in ABAP, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;  mara~matnr&lt;/P&gt;&lt;P&gt;  marc~werks&lt;/P&gt;&lt;P&gt;  from mara&lt;/P&gt;&lt;P&gt;  join marc on mara&lt;SUB&gt;matnr = marc&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;  into table it_join&lt;/P&gt;&lt;P&gt;  where mara~mtart = 'FERT' and&lt;/P&gt;&lt;P&gt;        marc~werks = '3000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i convert this into DYNAMIC JOIN STATEMENT&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your responses.&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>Tue, 18 Jan 2005 06:53:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-01-18T06:53:52Z</dc:date>
    <item>
      <title>How to construct Dynamic Join in ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917115#M58367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ALL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am typically faced with a situvation where in I need to write a dynamic JOIN SQL statement in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTEST .&lt;/P&gt;&lt;P&gt;PARAMETERS: TBLNAME(50) DEFAULT 'SPFLI'.&lt;/P&gt;&lt;P&gt;DATA: TOTAL_ROWS TYPE P.&lt;/P&gt;&lt;P&gt;SELECT COUNT(*) FROM (TBLNAME) INTO TOTAL_ROWS. &lt;/P&gt;&lt;P&gt;WRITE: / TBLNAME, TOTAL_ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above example, here the fetch from Table is dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as if i have to conisder the following SQL statement which is a normal JOIN statement in ABAP, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;  mara~matnr&lt;/P&gt;&lt;P&gt;  marc~werks&lt;/P&gt;&lt;P&gt;  from mara&lt;/P&gt;&lt;P&gt;  join marc on mara&lt;SUB&gt;matnr = marc&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;  into table it_join&lt;/P&gt;&lt;P&gt;  where mara~mtart = 'FERT' and&lt;/P&gt;&lt;P&gt;        marc~werks = '3000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i convert this into DYNAMIC JOIN STATEMENT&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward to your responses.&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>Tue, 18 Jan 2005 06:53:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917115#M58367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-18T06:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct Dynamic Join in ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917116#M58368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is from the ABAP keyword help in 6.40, not sure if it works in previous releases or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Dynamic specification of the inner joins. The column specification after SELECT is also dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_cityfr TYPE spfli-cityfrom, &lt;/P&gt;&lt;P&gt;            p_cityto TYPE spfli-cityto. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa, &lt;/P&gt;&lt;P&gt;         fldate TYPE sflight-fldate, &lt;/P&gt;&lt;P&gt;         carrname TYPE scarr-carrname, &lt;/P&gt;&lt;P&gt;         connid   TYPE spfli-connid, &lt;/P&gt;&lt;P&gt;       END OF wa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE SORTED TABLE OF wa &lt;/P&gt;&lt;P&gt;               WITH UNIQUE KEY fldate carrname connid. &lt;/P&gt;&lt;P&gt;DATA: column_syntax TYPE string, &lt;/P&gt;&lt;P&gt;      dbtab_syntax TYPE string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;column_syntax = `c&lt;SUB&gt;carrname p&lt;/SUB&gt;connid f~fldate`. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dbtab_syntax = `( ( scarr AS c ` &lt;/P&gt;&lt;P&gt;  &amp;amp; ` INNER JOIN spfli AS p ON p&lt;SUB&gt;carrid  = c&lt;/SUB&gt;carrid` &lt;/P&gt;&lt;P&gt;  &amp;amp; ` AND p~cityfrom = p_cityfr` &lt;/P&gt;&lt;P&gt;  &amp;amp; ` AND p~cityto   = p_cityto )` &lt;/P&gt;&lt;P&gt;  &amp;amp; ` INNER JOIN sflight AS f ON f&lt;SUB&gt;carrid = p&lt;/SUB&gt;carrid ` &lt;/P&gt;&lt;P&gt;  &amp;amp; ` AND f&lt;SUB&gt;connid = p&lt;/SUB&gt;connid )`. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT (column_syntax) &lt;/P&gt;&lt;P&gt;       FROM (dbtab_syntax) &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa. &lt;/P&gt;&lt;P&gt;  WRITE: / wa-fldate, wa-carrname, wa-connid. &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;Vilmos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2005 08:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917116#M58368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-19T08:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct Dynamic Join in ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917117#M58369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nagy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response and is very helful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I did not understand the "ABAP keyword help in 6.40".&lt;/P&gt;&lt;P&gt;Besides I also tried to use the program that you gave me, but I get a syntax error. Is it because , I have R/3 release 4.6c?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get this workaround in  R/3 release 4.6c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Ranjan MR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2005 04:25:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917117#M58369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-20T04:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct Dynamic Join in ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917118#M58370</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;The keyword help is what comes up when you click the blue 'i' icon in SE38 and select the third option with a keyword.&lt;/P&gt;&lt;P&gt;It is very much possible that this functionality is not present in 4.6C. Then you have to dynamically generate a program or subroutine pool to do the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regars&lt;/P&gt;&lt;P&gt;Vilmos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2005 07:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917118#M58370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-20T07:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct Dynamic Join in ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917119#M58371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vilmos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, in my case I have already made a dynamic program and this select should be a call within the dynamic program ie dynamic within a dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get ABAP keyword release 4.6? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards &lt;/P&gt;&lt;P&gt;Ranjan MR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2005 09:44:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917119#M58371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-20T09:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to construct Dynamic Join in ABAP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917120#M58372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2008 10:55:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-construct-dynamic-join-in-abap/m-p/917120#M58372</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-03T10:55:06Z</dc:date>
    </item>
  </channel>
</rss>

