<?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: funciton module error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871588#M1138854</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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;SPAN __default_attr="Red" __jive_macro_name="color"&gt;  E_T_DATA STRUCTURE MARA OPTIONAL  &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;quote}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to use this Structure ZJCMATSTRUCT1 instead of mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the Red line with this code( I mean the declaration)&lt;/P&gt;&lt;P&gt;E_T_DATA STRUCTURE ZJCMATSTRUCT1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rhea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: rhea on Nov 25, 2008 11:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Nov 2008 10:02:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-25T10:02:50Z</dc:date>
    <item>
      <title>funciton module error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871587#M1138853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAP-ABAP Exerts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                Here are the steps that we have performed to create a funciton module and to extract data from data source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please look into this&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1. Identified the master data table -- MARA&lt;/P&gt;&lt;P&gt;2. Identified the columns -- MATNR (Material Number), &lt;/P&gt;&lt;P&gt;                                      MTART (Material Type), &lt;/P&gt;&lt;P&gt;                                      MATKL  (Material Group), &lt;/P&gt;&lt;P&gt;                                      MEINS   (Base Unit Of Measure)&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;3. Created the Extract Structure via /nse11 --&amp;gt; DataType --&amp;gt; Create (ZJCMATSTRUCT1). Added the above fields in the structure components. Made sure that the structure cannot be extended.&lt;/P&gt;&lt;P&gt;4. Executed the Transaction Code /nse80. Created the Function Group (ZJCRSAX) and based the Function Group on the template RSAX. Activated the Function Group.&lt;/P&gt;&lt;P&gt;5. Created the function module (ZJCFMMATMSTR) with the following code:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FUNCTION ZJCFMMATMSTR.&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(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR&lt;/P&gt;&lt;P&gt;*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL&lt;/P&gt;&lt;P&gt;*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL&lt;/P&gt;&lt;P&gt;*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL&lt;/P&gt;&lt;P&gt;*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL&lt;/P&gt;&lt;P&gt;*" TABLES&lt;/P&gt;&lt;P&gt;*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL&lt;/P&gt;&lt;P&gt;*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL&lt;/P&gt;&lt;P&gt;*" E_T_DATA STRUCTURE MARA OPTIONAL&lt;/P&gt;&lt;P&gt;*" EXCEPTIONS&lt;/P&gt;&lt;P&gt;*" NO_MORE_DATA&lt;/P&gt;&lt;P&gt;*" ERROR_PASSED_TO_MESS_HANDLER&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;TABLES: MARA.&lt;/P&gt;&lt;P&gt;DATA: l_s_select TYPE srsc_s_select.&lt;/P&gt;&lt;P&gt;STATICS: s_s_if TYPE srsc_s_if_simple,&lt;/P&gt;&lt;P&gt;s_counter_datapakid LIKE sy-tabix,&lt;/P&gt;&lt;P&gt;s_cursor TYPE cursor.&lt;/P&gt;&lt;P&gt;RANGES: l_r_matnr FOR MARA-matnr,&lt;/P&gt;&lt;P&gt;             l_r_mtart FOR MARA-mtart,&lt;/P&gt;&lt;P&gt;             l_r_matkl FOR MARA-matkl,&lt;/P&gt;&lt;P&gt;             l_r_meins FOR MARA-meins.&lt;/P&gt;&lt;P&gt;IF i_initflag = sbiwa_c_flag_on.&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------" /&gt;&lt;P&gt;"Initialization: check input parameters &amp;amp; prepare data selection&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------" /&gt;&lt;P&gt;APPEND LINES OF i_t_select TO s_s_if-t_select.&lt;/P&gt;&lt;P&gt;s_s_if-requnr = i_requnr.&lt;/P&gt;&lt;P&gt;s_s_if-dsource = i_dsource.&lt;/P&gt;&lt;P&gt;s_s_if-maxsize = i_maxsize.&lt;/P&gt;&lt;P&gt;APPEND LINES OF i_t_fields TO s_s_if-t_fields.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt;"Second Call by SAPI&lt;/P&gt;&lt;P&gt;"----&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt;IF s_counter_datapakid = 0.&lt;/P&gt;&lt;P&gt;LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'MATNR'.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING l_s_select TO l_r_matnr.&lt;/P&gt;&lt;P&gt;APPEND l_r_matnr.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'MTART'.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING l_s_select TO l_r_mtart.&lt;/P&gt;&lt;P&gt;APPEND l_r_mtart.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'MATKL'.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING l_s_select TO l_r_matkl.&lt;/P&gt;&lt;P&gt;APPEND l_r_matkl.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'MEINS'.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING l_s_select TO l_r_meins.&lt;/P&gt;&lt;P&gt;APPEND l_r_meins.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;OPEN CURSOR WITH HOLD s_cursor FOR&lt;/P&gt;&lt;P&gt;SELECT (s_s_if-t_fields)&lt;/P&gt;&lt;P&gt;FROM MARA&lt;/P&gt;&lt;P&gt;WHERE matnr IN l_r_matnr&lt;/P&gt;&lt;P&gt;AND mtart IN l_r_mtart&lt;/P&gt;&lt;P&gt;AND matkl IN l_r_matkl&lt;/P&gt;&lt;P&gt;AND meins IN l_r_meins.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;FETCH NEXT CURSOR s_cursor&lt;/P&gt;&lt;P&gt;APPENDING CORRESPONDING FIELDS OF TABLE e_t_data&lt;/P&gt;&lt;P&gt;PACKAGE SIZE s_s_if-maxsize.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;CLOSE CURSOR s_cursor.&lt;/P&gt;&lt;P&gt;RAISE no_more_data.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;s_counter_datapakid = s_counter_datapakid + 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;6. Created the Data Source using the Transaction Code /nrso2. (DS Name -- ZJCDSMATMSTR) using the above named Function Module and extract Structure. The data source was saved successfully.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;7. Used the Transaction Code /nrsa3 to extract the data from data source. Upon trying to extract, we are getting the following run time error:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; "E_T_DATA" is the correct type, its length is incorrect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 09:57:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871587#M1138853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T09:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: funciton module error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871588#M1138854</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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;SPAN __default_attr="Red" __jive_macro_name="color"&gt;  E_T_DATA STRUCTURE MARA OPTIONAL  &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;quote}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to use this Structure ZJCMATSTRUCT1 instead of mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the Red line with this code( I mean the declaration)&lt;/P&gt;&lt;P&gt;E_T_DATA STRUCTURE ZJCMATSTRUCT1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rhea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: rhea on Nov 25, 2008 11:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 10:02:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871588#M1138854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T10:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: funciton module error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871589#M1138855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanku rhea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2008 11:09:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/funciton-module-error/m-p/4871589#M1138855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-25T11:09:01Z</dc:date>
    </item>
  </channel>
</rss>

