<?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: custom Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408714#M1547773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Samprithsap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to define a table type for changing parameter emp_det, or you just declare a structure emp_det because here ztable is just refered as a structure.&lt;/P&gt;&lt;P&gt;so, you have to go to se11 and define a table type whose line type is ztable, then use this table type to define emp_det.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in addition, I don't think it's necessary to define changing parameter. If it is, you just need define emp_det as table parameter  where you can use ztable directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Peter Peng on Oct 19, 2010 4:13 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Oct 2010 02:12:47 GMT</pubDate>
    <dc:creator>peter_peng</dc:creator>
    <dc:date>2010-10-19T02:12:47Z</dc:date>
    <item>
      <title>custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408712#M1547771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  ,&lt;/P&gt;&lt;P&gt;I created Custom  function module importing  parameter as  X&lt;/P&gt;&lt;P&gt;and changing  parameter as    emp_det  type   ZTABLE (Transpearent table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I  used  select  stat  which  will get data from Ztable   stored into   internal table   itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at the  end  i am  assing  internal table emp_det&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EMP_DET =  itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This emp_det  gives final result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whilie checking  iam getting  error as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab cannot be converted  to the type of emp_det&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 00:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408712#M1547771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T00:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408713#M1547772</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;Please, put the your code (start of FM , call of FM, definition of variables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leandro Mengue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 00:25:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408713#M1547772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T00:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408714#M1547773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Samprithsap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to define a table type for changing parameter emp_det, or you just declare a structure emp_det because here ztable is just refered as a structure.&lt;/P&gt;&lt;P&gt;so, you have to go to se11 and define a table type whose line type is ztable, then use this table type to define emp_det.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in addition, I don't think it's necessary to define changing parameter. If it is, you just need define emp_det as table parameter  where you can use ztable directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Peter Peng on Oct 19, 2010 4:13 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 02:12:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408714#M1547773</guid>
      <dc:creator>peter_peng</dc:creator>
      <dc:date>2010-10-19T02:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408715#M1547774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_TEST_RKM.&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(EMPLOYEE) LIKE  ZHRS_EMP&lt;/P&gt;&lt;P&gt;*"  STRUCTURE  ZHRS_EMPLOYEE_SEARCH OPTIONAL&lt;/P&gt;&lt;P&gt;*"  CHANGING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(EMPLOYEE_DETAILS) TYPE  ZHR_TABLE&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_str,&lt;/P&gt;&lt;P&gt;           MANDT  type  MANDT,&lt;/P&gt;&lt;P&gt;           PERNR  type PERSNO,&lt;/P&gt;&lt;P&gt;           VORNA  type PAD_VORNA,&lt;/P&gt;&lt;P&gt;           NACHN  type PAD_NACHN,&lt;/P&gt;&lt;P&gt;      end of ty_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_employee_detail TYPE STANDARD TABLE OF  ty_str,&lt;/P&gt;&lt;P&gt;      wa_employee_info    TYPE ty_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       select * from ZHR_TABLE into table it_employee_detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EMPLOYEE_DETAILS = it_employee_detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 02:29:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408715#M1547774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T02:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408716#M1547775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just pass this in tables parameter it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 02:41:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408716#M1547775</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2010-10-19T02:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408717#M1547776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i changed  changing  parameter to table  parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;still same error &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION Z_TEST_RKM.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;""Local Interface:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      EMPDETAIL STRUCTURE zhr_table&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_str,&lt;/P&gt;&lt;P&gt;MANDT type MANDT,&lt;/P&gt;&lt;P&gt;PERNR type PERSNO,&lt;/P&gt;&lt;P&gt;VORNA type PAD_VORNA,&lt;/P&gt;&lt;P&gt;NACHN type PAD_NACHN,&lt;/P&gt;&lt;P&gt;end of ty_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_employee_detail TYPE STANDARD TABLE OF ty_str,&lt;/P&gt;&lt;P&gt;wa_employee_info TYPE ty_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ZHR_TABLE into table it_employee_detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EMPDETAIL = it_employee_detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 04:18:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408717#M1547776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T04:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408718#M1547777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Does your structure ty_Str contains all the fields of table zhr_table. the structure of ty_str and it_emp_detail is  not matching i guess.&lt;/P&gt;&lt;P&gt;You can define your internal table of the same structure of zhr_table and try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sridevi S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 04:39:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408718#M1547777</guid>
      <dc:creator>former_member671009</dc:creator>
      <dc:date>2010-10-19T04:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408719#M1547778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want all data from ZHR_TABLE into EMPDETAIL parameter of FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No need to define any structure and another internal table and then assigning&lt;/P&gt;&lt;P&gt;this internal table to FM parameter you can just write below query in your FM logic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ZHR_TABLE into table EMPDETAIL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pawan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 06:08:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408719#M1547778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T06:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408720#M1547779</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;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: i_zhr_table LIKE  zhr_table OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'Z_TEST_RKM'
   TABLES EMPDETAIL = i_zhr_table.


FUNCTION Z_TEST_RKM.
*"--------------------------------------------------------------------
""Local Interface:
*" TABLES
*" EMPDETAIL STRUCTURE zhr_table
*"--------------------------------------------------------------------

  select * from ZHR_TABLE into table EMPDETAIL.

ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leandro Mengue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 14:25:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408720#M1547779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T14:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408721#M1547780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; FUNCTION Z_TEST_RKM.&lt;/P&gt;&lt;P&gt;&amp;gt; *"----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&amp;gt; &lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;&amp;gt; *"  IMPORTING&lt;/P&gt;&lt;P&gt;&amp;gt; *"     VALUE(EMPLOYEE) LIKE  ZHRS_EMP&lt;/P&gt;&lt;P&gt;&amp;gt; *"  STRUCTURE  ZHRS_EMPLOYEE_SEARCH OPTIONAL&lt;/P&gt;&lt;P&gt;&amp;gt; *"  CHANGING&lt;/P&gt;&lt;P&gt;&amp;gt; *"     REFERENCE(EMPLOYEE_DETAILS) TYPE  ZHR_TABLE&lt;/P&gt;&lt;P&gt;&amp;gt; *"----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&amp;gt;...&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; EMPLOYEE_DETAILS = it_employee_detail.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; ENDFUNCTION.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem occurs because you've defined EMPLOYEE_DETAILS to be a structure that is like ZHR_TABLE. Not a table. There are two ways of dealing with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use the TABLES parameter as Leandro suggested above - although this is obsolete in later versions, it must be used for RFCs.&lt;/P&gt;&lt;P&gt;2. Define a table type in the data dictionary, e.g. ZHR_TABLE_T_TY, which has a line type of ZHR_TABLE. Then you can use&lt;/P&gt;&lt;P&gt;&amp;gt; *"  CHANGING&lt;/P&gt;&lt;P&gt;&amp;gt; *"     REFERENCE(EMPLOYEE_DETAILS) TYPE  ZHR_TABLE_T_TY&lt;/P&gt;&lt;P&gt;3. Use&lt;/P&gt;&lt;P&gt;&amp;gt; *"  CHANGING&lt;/P&gt;&lt;P&gt;&amp;gt; *"     REFERENCE(EMPLOYEE_DETAILS) TYPE  ANY TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend 1 if your function module is RFC enabled, and 2 if it isn't. 3 will work, but it's &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;bad&lt;/STRONG&gt;&lt;/SPAN&gt; programming!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 14:50:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408721#M1547780</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2010-10-19T14:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408722#M1547781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   If you already changed to table type then, must be the different structure,&lt;/P&gt;&lt;P&gt;Please check tht both the tables are identical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anmol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 15:06:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408722#M1547781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T15:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: custom Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408723#M1547782</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;use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;EMPDETAIL[] = it_employee_detail[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to make sure the table body is used regardless of header line presence.&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>Tue, 19 Oct 2010 15:22:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-function-module/m-p/7408723#M1547782</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2010-10-19T15:22:08Z</dc:date>
    </item>
  </channel>
</rss>

