<?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: Pass parameters of  user defined type to function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7959001#M1602597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A type defined in your program is only visible within your program. It is unknown to your function module. Function module parameters must either have a generic definition (Blank = ANY, STANDARD TABLE, C, CLIKE etc.) a basic type (T, I etc.) or be defined in the data dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One possible workaround - depending on what you're trying to achieve - is to define the type in the function module and the calling program, then pass the reference from the program to the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling program &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES my_table_type ...

DATA: my_table TYPE my_table_type,
     r_data TYPE REF TO DATA.
...
* populate my_table

GET REFERENCE OF my_table INTO r_data.
CALL FUNCTION MODULE 'Z_MYFM' EXPORTING ir_data = r_data. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;FM &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES my_table_type ...

FIELD-SYMBOLS: &amp;lt;my_table&amp;gt; TYPE my_table_type.
ASSIGN ir_data-&amp;gt;* TO &amp;lt;my_table&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 May 2011 12:09:15 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2011-05-30T12:09:15Z</dc:date>
    <item>
      <title>Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958995#M1602591</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;Is it possible to pass a table parameter of user defined type, from the calling program, to a user defined function module? If yes then how to do it? If no then is there a work around for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sriram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 10:33:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958995#M1602591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T10:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958996#M1602592</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;You may define an importing/exporting/changing paramer from type STANDARD TABLE. Of course, to access the table's data in the MF's body, you'll certaily have to make use of data refenreces or instructions like ASSIGN COMPONENT to dynamically acces the table's fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 11:07:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958996#M1602592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T11:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958997#M1602593</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;Thanks for your reply but I didn';t get you. In the calling program I have defined  type &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES  BEGIN OF ty_bkpf.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE bkpf.&lt;/P&gt;&lt;P&gt;       TYPES  flag  TYPE c.          &lt;/P&gt;&lt;P&gt;TYPES  END OF ty_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I'm creating internal table as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA   it_bkpf   TYPE STANDARD TABLE OF ty_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm creating a FM where I want to pass it_bkpf. In tables parameters of the FM how to pass it_bkpf? if I define it_bkpf LIKE bkpf then i cannot straight away pass it_bkpf as parameter from calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sriram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 11:21:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958997#M1602593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T11:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958998#M1602594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sriram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a structure in SE11, having all fields of table BKPF and additional field 'flag' TYPE c. Use this structure to define the internal table it_bkpf in TABLES of FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Radhika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 11:37:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958998#M1602594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T11:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958999#M1602595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Radhika! Is this the only way to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sriram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 11:50:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7958999#M1602595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-30T11:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7959000#M1602596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sriram_14880,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can always declare the function module import or tables parameters as TYPE ANY or TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then you can bot access the fields of the line structure directly but only by assignment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you are better of by creating structures and/or data elements and related table types in Data Dictionary because then you can use the fields not only in programs but anywhere, screens, functions etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 12:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7959000#M1602596</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-05-30T12:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pass parameters of  user defined type to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7959001#M1602597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A type defined in your program is only visible within your program. It is unknown to your function module. Function module parameters must either have a generic definition (Blank = ANY, STANDARD TABLE, C, CLIKE etc.) a basic type (T, I etc.) or be defined in the data dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One possible workaround - depending on what you're trying to achieve - is to define the type in the function module and the calling program, then pass the reference from the program to the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calling program &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES my_table_type ...

DATA: my_table TYPE my_table_type,
     r_data TYPE REF TO DATA.
...
* populate my_table

GET REFERENCE OF my_table INTO r_data.
CALL FUNCTION MODULE 'Z_MYFM' EXPORTING ir_data = r_data. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;FM &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES my_table_type ...

FIELD-SYMBOLS: &amp;lt;my_table&amp;gt; TYPE my_table_type.
ASSIGN ir_data-&amp;gt;* TO &amp;lt;my_table&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2011 12:09:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-parameters-of-user-defined-type-to-function-module/m-p/7959001#M1602597</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-05-30T12:09:15Z</dc:date>
    </item>
  </channel>
</rss>

