<?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 subroutines ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917304#M938832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; When do we basically look forward to use dynamic subroutines ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pranhsu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2008 08:46:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-06T08:46:45Z</dc:date>
    <item>
      <title>subroutines ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917304#M938832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; When do we basically look forward to use dynamic subroutines ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pranhsu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 08:46:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917304#M938832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-06T08:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: subroutines ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917305#M938833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rastogi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below example explains how to create a select query with dynamically selecting the fieldnames: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zdynamic_sql_test4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: bkpf, t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Internal table for dynamic field name selection&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab_fieldname OCCURS 0,&lt;/P&gt;&lt;P&gt;          fieldname TYPE dd03l-fieldname,&lt;/P&gt;&lt;P&gt;          END OF itab_fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Internal table for selection of data&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab_selection OCCURS 0,&lt;/P&gt;&lt;P&gt;          bukrs TYPE bkpf-bukrs,&lt;/P&gt;&lt;P&gt;          belnr TYPE bkpf-belnr,&lt;/P&gt;&lt;P&gt;          END OF itab_selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Selection screen parameters&lt;/P&gt;&lt;P&gt;PARAMETERS :  p_bukrs   TYPE t001-bukrs,&lt;/P&gt;&lt;P&gt;                       p_belnr   TYPE bkpf-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT p_bukrs IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE *&lt;/P&gt;&lt;P&gt;  FROM t001&lt;/P&gt;&lt;P&gt;  WHERE bukrs EQ p_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**If user has entered value for BUKRS on selection screen, Insert the&lt;/P&gt;&lt;P&gt;**fieldname for dynamic selection.&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;    INSERT 'BUKRS' INTO itab_fieldname INDEX 1.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT p_belnr IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT SINGLE *&lt;/P&gt;&lt;P&gt;    FROM bkpf&lt;/P&gt;&lt;P&gt;    WHERE belnr EQ p_belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**If user has entered BUKRS as well as BELNR on selection screen,&lt;/P&gt;&lt;P&gt;**Insert the fieldname for dynamic selection.&lt;/P&gt;&lt;P&gt;    IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;      INSERT 'BELNR' INTO itab_fieldname INDEX 2.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;    IF NOT p_belnr IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT SINGLE *&lt;/P&gt;&lt;P&gt;      FROM bkpf&lt;/P&gt;&lt;P&gt;      WHERE belnr EQ p_belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**If user has entered only BELNR on selection screen,&lt;/P&gt;&lt;P&gt;**Insert the fieldname for dynamic selection.&lt;/P&gt;&lt;P&gt;       IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;          INSERT 'BELNR' INTO itab_fieldname INDEX 1.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Selection of fields using dynamic feidname selection&lt;/P&gt;&lt;P&gt;SELECT (itab_fieldname)&lt;/P&gt;&lt;P&gt;FROM bkpf&lt;/P&gt;&lt;P&gt;INTO TABLE itab_selection&lt;/P&gt;&lt;P&gt;WHERE bukrs EQ p_bukrs&lt;/P&gt;&lt;P&gt;      OR belnr EQ p_belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ability of Dynamic Open SQL is far more than just what explained in this paper, however using these simple examples we understand that there is always a way to develop our Open SQL queries in dynamic form and reducing a potential coding time and increasing the maintainability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a particular requirement where in you are not able to use these basic principles, one can write the dynamic subroutines pools to achieve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i think this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reagards,&lt;/P&gt;&lt;P&gt;sindhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 12:00:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917305#M938833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-06T12:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: subroutines ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917306#M938834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/ravishankar.rajan/blog/2007/03/27/using-subroutine-pools-for-dynamic-programming&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 13:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subroutines/m-p/3917306#M938834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-06T13:27:15Z</dc:date>
    </item>
  </channel>
</rss>

