<?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 Passing tables to function modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828312#M353223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,  I am trying to port some old ABAP code to the latest release that no longer supports passing TABLES to function module, but tells you to use CHANGING instead.  I can't seem to get to the whole thing to work.  I have a program that creates an internal table with a header line,  passes it to the function module, and the function module is supposed to fill the table.  I tried changing the parameter in the function module from TABLES to CHANGING,  and use TYPE to reference a database type (which happens to be a view).   But the code in the function module that referenecs the table being passed (to fill it) complains that it is not an internal table.   I tried using TYPE ANY TABLE in the parameter definition, and  then it complains that it is not a "standard" table when it goes to fill it.   What I'm trying to do should be simple, but I can't seem to get the right combination of things to work.  I cant seem to find a step-by-step on converting from the use of TABLES to CHANGING .    Any advice ??   Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2007 19:47:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-04T19:47:26Z</dc:date>
    <item>
      <title>Passing tables to function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828312#M353223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,  I am trying to port some old ABAP code to the latest release that no longer supports passing TABLES to function module, but tells you to use CHANGING instead.  I can't seem to get to the whole thing to work.  I have a program that creates an internal table with a header line,  passes it to the function module, and the function module is supposed to fill the table.  I tried changing the parameter in the function module from TABLES to CHANGING,  and use TYPE to reference a database type (which happens to be a view).   But the code in the function module that referenecs the table being passed (to fill it) complains that it is not an internal table.   I tried using TYPE ANY TABLE in the parameter definition, and  then it complains that it is not a "standard" table when it goes to fill it.   What I'm trying to do should be simple, but I can't seem to get the right combination of things to work.  I cant seem to find a step-by-step on converting from the use of TABLES to CHANGING .    Any advice ??   Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2007 19:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828312#M353223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-04T19:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Passing tables to function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828313#M353224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wendy, when passing tables thru the function module signature using the CHANGING parameters,  you must use table types.  If one does not exist for your  purpose you must create the table type via SE11 and then reference this table type  when defining the CHANGING parameter.  It also might be a good idea for you to change the internal table that is being passed,  get rid of the "with header line" and use a explicit work area instead.&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>Thu, 04 Jan 2007 19:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828313#M353224</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-04T19:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Passing tables to function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828314#M353225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much , but I think I may have compounded problem.  I changed the signature to CHANGING and referenced an existing SE11 defined table by using TYPE.  The old signature used the TABLES tab and referenced the same table via LIKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first thing I do in the code is try to pass that table as a parameter to a subroutine using the TABLES parameter (which I thought was obsolete but still supported).   It looks just like this, sorry it will look messy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_ACCEPT_REQUEST_INFO_BY_APP.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(APPLICATION_ID) TYPE  ZSINB-ZPGMID&lt;/P&gt;&lt;P&gt;*"     VALUE(JOB_NAME) TYPE  ZSRQC-ZJOBNAME&lt;/P&gt;&lt;P&gt;*"     VALUE(JOB_NUM) TYPE  ZSRQC-ZJOBNUM&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(NUMBER_OF_REQUESTS) TYPE  SY-DBCNT&lt;/P&gt;&lt;P&gt;*"  CHANGING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(REQUEST_INFO_TAB) TYPE  ZSVRI&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      SELECT_REQUESTS_FAILED&lt;/P&gt;&lt;P&gt;*"      UPDATE_STATUS_FAILED&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;  PERFORM GET_REQUEST_TAB   TABLES   REQUEST_INFO_TAB&lt;/P&gt;&lt;P&gt;                            USING    APPLICATION_ID&lt;/P&gt;&lt;P&gt;                            CHANGING NUMBER_OF_REQUESTS.&lt;/P&gt;&lt;P&gt;  IF LOCAL_RETURN_CODE &amp;lt;&amp;gt; SUCCESS.&lt;/P&gt;&lt;P&gt;    RAISE SELECT_REQUESTS_FAILED.&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 failure I am getting now on the sytnax is "REQUEST_INFO_TAB" is not an internal table - the "OCCURS n"	specification is missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the function does not recognize the table being passed as an internal table. Do I need to copy it to an intermediate work area before using it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2007 20:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828314#M353225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-04T20:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Passing tables to function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828315#M353226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wendy, as you have it now, you are not passing a table, but a structure which is typed like ZSVRI.   When using this type in the TABLES parameter, it assumes that it is always a table, but when using in CHANGING parameters it could be either, which is why you need to create a table type for your structure ZSVRI in Se11,  you can use this structure when defining your table table.  Create the table type ZSVRI_TT,  then reference ZSVRI as the line structure, save and activate,  Now go to your function module and change the reference for REQUEST_INFO_TAB to the ZSVRI_TT.   Now you are passing a table.&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>Thu, 04 Jan 2007 21:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828315#M353226</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-04T21:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Passing tables to function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828316#M353227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I get it now.  The question now ( from DBA) is whether is the "correct" approach or a quick fix. I may look into the use generic data type too.   Thanks again for  the advice - you got me thinking on the right track.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2007 22:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828316#M353227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-04T22:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Passing tables to function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828317#M353228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my knowledge the use of table types is the correct way to pass tables in function modules and when passing tables in methods of classes.&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>Thu, 04 Jan 2007 22:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-to-function-modules/m-p/1828317#M353228</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-01-04T22:54:24Z</dc:date>
    </item>
  </channel>
</rss>

