<?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: Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463843#M218634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. in the FM,&lt;/P&gt;&lt;P&gt;   pass the parameter in &lt;/P&gt;&lt;P&gt;   TABLES (not IMPORT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. and make it like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BUKRS LIKE RNG_BUKRS&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(In TABLES Tab of se37)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;NOTE:&lt;/P&gt;&lt;P&gt;RNG_BUKRS is nothing but a RANGE for BUKRS,&lt;/P&gt;&lt;P&gt;which is nothing but copy of&lt;/P&gt;&lt;P&gt;select-option for bukrs field.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. then while calling the FM,&lt;/P&gt;&lt;P&gt;   pass the select-option (eg. MYBUKRS)&lt;/P&gt;&lt;P&gt;  using TABLES (and not EXPORTING)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. In this way, in your FM,&lt;/P&gt;&lt;P&gt;   u shall be able to fire query  &lt;/P&gt;&lt;P&gt; IN BUKRS&lt;/P&gt;&lt;P&gt;  (similar to select-option)&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;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jul 2006 13:05:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-04T13:05:41Z</dc:date>
    <item>
      <title>Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463839#M218630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;           iam declaring company code as import parameter in function module. later on iam calling that fuction module in report. but i declared company code as select-options. it is giving error.  if iam declaring company code as a parameter then it is working.&lt;/P&gt;&lt;P&gt;pls, let me know how to declare it as select-options.&lt;/P&gt;&lt;P&gt;                         chandu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463839#M218630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463840#M218631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select bukrs from t001 into i_t001 where bukrs in s_bukrs (ur select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check sy-dbcnt gt 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at i_t001.&lt;/P&gt;&lt;P&gt;call function 'UR FUNCTION'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt; bukrs = i_t001-bukrs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463840#M218631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463841#M218632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Defining as a select-option, you are giving the user the opportunity to enter mulitple company codes and ranges or even excluding.  Do you want to fire this function module for all company codes which are valid for the select-option?  If so, then you need to get all of the company codes in the SO, and loop thru that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: it001 type table of t001 with header line.
select-options: s_bukrs for it001-bukrs.

select * into table it001 from t001
         where bukrs in s_bukrs.

loop at it001.
* Call your function module with 
* the company code in this table.
*  IT001-bukrs.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463841#M218632</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-04T13:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463842#M218633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_t001 occurs 0,&lt;/P&gt;&lt;P&gt;       bukrs type bukrs,&lt;/P&gt;&lt;P&gt;      end of it_t001.&lt;/P&gt;&lt;P&gt;select bukrs&lt;/P&gt;&lt;P&gt;  from t001&lt;/P&gt;&lt;P&gt;  into it_t001&lt;/P&gt;&lt;P&gt;  where bukrs in s_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_t001.&lt;/P&gt;&lt;P&gt;call function '&amp;lt;func mod name&amp;gt;'&lt;/P&gt;&lt;P&gt; exporting &amp;lt;comp code&amp;gt; = it_t001-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:04:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463842#M218633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463843#M218634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. in the FM,&lt;/P&gt;&lt;P&gt;   pass the parameter in &lt;/P&gt;&lt;P&gt;   TABLES (not IMPORT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. and make it like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BUKRS LIKE RNG_BUKRS&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(In TABLES Tab of se37)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;NOTE:&lt;/P&gt;&lt;P&gt;RNG_BUKRS is nothing but a RANGE for BUKRS,&lt;/P&gt;&lt;P&gt;which is nothing but copy of&lt;/P&gt;&lt;P&gt;select-option for bukrs field.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. then while calling the FM,&lt;/P&gt;&lt;P&gt;   pass the select-option (eg. MYBUKRS)&lt;/P&gt;&lt;P&gt;  using TABLES (and not EXPORTING)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. In this way, in your FM,&lt;/P&gt;&lt;P&gt;   u shall be able to fire query  &lt;/P&gt;&lt;P&gt; IN BUKRS&lt;/P&gt;&lt;P&gt;  (similar to select-option)&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;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463843#M218634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463844#M218635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. Select company code entries into ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. change FM's signature as&lt;/P&gt;&lt;P&gt;   import to tables for company code.&lt;/P&gt;&lt;P&gt;3. Pass the table to FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Change the logic in FM to handle for multiple company codes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463844#M218635</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-07-04T13:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463845#M218636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using IMPORT use TABLES in the FM created by you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORT is used when only one value has to be passed.&lt;/P&gt;&lt;P&gt;Since you are using select-option, there will be n number of entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to use a LOOP in your FM and change the code accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sameena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:21:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1463845#M218636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:21:08Z</dc:date>
    </item>
  </channel>
</rss>

