<?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 Table problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346043#M1398175</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this because READ TABLE supports dynamic tokens &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then you will read only 1 line of the table which contradicts the usage of LOOP ... WHERE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2009 18:30:57 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-11-02T18:30:57Z</dc:date>
    <item>
      <title>Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346037#M1398169</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;I have a FM with  a changing parameter of type TABLE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use loop at on this table with WHERE Clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FUNCTION Z_DATA_RECCOUNT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  CHANGING
*"     REFERENCE(T_SOURCE_PACKAGE) TYPE  TABLE

FIELD-SYMBOLS: &amp;lt;l_s_source_package&amp;gt; type ANY,
               &amp;lt;temp_buffer&amp;gt; type any.

LOOP AT t_source_package ASSIGNING &amp;lt;temp_buffer&amp;gt;
                                    WHERE /bic/tr = '2' AND
                                                /bic/res = '3'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the system is saying that:&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;"In "LOOP ... WHERE ..." the row type of the table must be statically defined statically defined"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346037#M1398169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T18:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346038#M1398170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;declare : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;temp_buffer&amp;gt; like line of t_source_package.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:09:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346038#M1398170</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-11-02T18:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346039#M1398171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nopes, not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is saying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field "T_SOURCE_PACKAGE" specified under LIKE has no type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:11:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346039#M1398171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T18:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346040#M1398172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Merc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because the Field Symbol &amp;lt;temp_buffer&amp;gt; is generic &amp;amp; its type is not determined till runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you are trying to use LOOP ... WHERE &amp;amp; giving the fieldnames &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WHERE /bic/tr = '2' AND /bic/res = '3'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; the compiler cannot determine that these fields are available in &amp;lt;temp_buffer&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence you are getting this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question, if you know the tables fields then why have you decalred the TABLES param as generic ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: LOOP ... WHERE does not support dynamic tokens. So you have to think of some workaround for this &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:11:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346040#M1398172</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-11-02T18:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346041#M1398173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, But if I do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FUNCTION Z_DATA_RECCOUNT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  CHANGING
*"     REFERENCE(T_SOURCE_PACKAGE) TYPE  TABLE
 
DATA: temp_buffer LIKE SORTED TABLE OF  l_s_source_package
                 WITH UNIQUE KEY /BIC/SETRADAT
                                   /BIC/SERESNAM.
 "There are 2000 records in t_source_package table.

READ TABLE t_source_package into temp_buffer 
                          WITH TABLE KEY /BIC/SETRADAT = '2'
                                         /BIC/SERESNAM = '3'.

Error:

The specified type has no structure and therefore no component called "/BIC/SETRADAT". component called "/BIC/SETRADAT".

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats cuz t_source_package is of type table, how shall I get the type of it and assign to it it ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:19:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346041#M1398173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T18:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346042#M1398174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think i resolved it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;



READ TABLE t_source_package into temp_buffer 
                          WITH TABLE KEY ('/BIC/SETRADAT') = &amp;lt;TRADE_DATE&amp;gt;
                                         ('/BIC/SERESNAM') = &amp;lt;RESOURCE_NAME&amp;gt;.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:25:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346042#M1398174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T18:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346043#M1398175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this because READ TABLE supports dynamic tokens &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then you will read only 1 line of the table which contradicts the usage of LOOP ... WHERE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:30:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346043#M1398175</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-11-02T18:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346044#M1398176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;temp_buffer&amp;gt; type line of t_source_package.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:32:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346044#M1398176</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-11-02T18:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346045#M1398177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;type line of t_source_package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:45:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346045#M1398177</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T18:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346046#M1398178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Saha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What shall I do then, I need more records not just one, Please help  !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2009 18:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346046#M1398178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-02T18:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346047#M1398179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Merc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following non performant workaround:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT t_source_package ASSIGNING &amp;lt;temp_buffer&amp;gt;.
    IF &amp;lt;temp_buffer&amp;gt;-/bic/tr = '2' AND &amp;lt;temp_buffer&amp;gt;-/bic/res = '3'.
        " Do your coding
    ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Markus Hofmann on Dec 16, 2009 10:08 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 09:07:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-table-problem/m-p/6346047#M1398179</guid>
      <dc:creator>markus_hofmann2</dc:creator>
      <dc:date>2009-12-16T09:07:36Z</dc:date>
    </item>
  </channel>
</rss>

