<?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: Passing Tables dynamically to Form in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732038#M634394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please post a part of your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Your data declarations&lt;/P&gt;&lt;P&gt;2) Perform call &lt;/P&gt;&lt;P&gt;3) Form routine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Sep 2007 19:08:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-07T19:08:46Z</dc:date>
    <item>
      <title>Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732032#M634388</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 small peculiar requirement, I have to pass an Internal table dynamically to&lt;/P&gt;&lt;P&gt;a form. Actually, this form should work for four different internal table of different types. But, the logic is same for these four tables. Depending on some condition, I&lt;/P&gt;&lt;P&gt;will pass different internal table to that form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example, I have written the code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if  cond1..&lt;/P&gt;&lt;P&gt;   perform  form_name   using  it_table1.&lt;/P&gt;&lt;P&gt;elseif cond2.&lt;/P&gt;&lt;P&gt;   perform  form_name   using  it_table2.&lt;/P&gt;&lt;P&gt;elseif cond3.&lt;/P&gt;&lt;P&gt;   perform  form_name   using  it_table3.&lt;/P&gt;&lt;P&gt;elseif cond4.&lt;/P&gt;&lt;P&gt;   perform  form_name   using  it_table4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form  form_name using it_table type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at it_table.&lt;/P&gt;&lt;P&gt; -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code is giving the error "it_table is not declared as table or Generic type'.&lt;/P&gt;&lt;P&gt;How to handle this scenario?&lt;/P&gt;&lt;P&gt;Could you please anybody help on this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 18:12:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732032#M634388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T18:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732033#M634389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form form_name using it_table type any &amp;lt;b&amp;gt;TABLE&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_table.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Srihari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 18:33:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732033#M634389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T18:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732034#M634390</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;may be this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
define form_name.
loop at &amp;amp;1.
----
----
endloop.


endefinition.

if condition eq 'XXXXXXXX'
form_name it_table1.
form_name it_table2.
form_name it_table3.
elseif cond4.
form_name it_table4.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Only disadvantage by using macro. within the loop you could not debug&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 18:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732034#M634390</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-09-07T18:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732035#M634391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srihari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agaun it is giving error like ' formal parameters  and actual parameters are incompatable'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 18:42:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732035#M634391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T18:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732036#M634392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you defined a header line for your internal table ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes, try  to avoid it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you cant :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call the perform like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform &amp;lt;form_name&amp;gt; using it_table[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Srihari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 18:50:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732036#M634392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T18:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732037#M634393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srihari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still i am getting same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 19:02:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732037#M634393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T19:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732038#M634394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please post a part of your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Your data declarations&lt;/P&gt;&lt;P&gt;2) Perform call &lt;/P&gt;&lt;P&gt;3) Form routine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 19:08:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732038#M634394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T19:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732039#M634395</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 try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
If &amp;lt;cond1&amp;gt;.
  perform form_name tables it_table1.
elseif &amp;lt;cond2&amp;gt;.
  perform form_name tables it_table2.
elseif &amp;lt;cond3&amp;gt;.
  perform form_name tables it_table3.
elseif &amp;lt;cond4&amp;gt;.
  perform form_name tables it_table4.
endif.


form form_name tables p_table.

  loop at p_table.
    ...
  endloop.

endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 19:11:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732039#M634395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T19:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732040#M634396</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;This is one of the way. It uses field symbols.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM appl_upload USING gv_header 'gt_header[]'.&lt;/P&gt;&lt;P&gt;PERFORM appl_upload USING gv_header1 'gt_header1[]'.&lt;/P&gt;&lt;P&gt;PERFORM appl_upload USING gv_header2 'gt_header1[]'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here gt_header, gt_header1 and gt_header2 can have different structures. As you can see you are just passing the name of the table as a constant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM appln_upload USING gv_header type ...&lt;/P&gt;&lt;P&gt;                                          tabname type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD SYMBOL: &amp;lt;tab&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN (tabname) to &amp;lt;tab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;tab&amp;gt;..."can do u r processing.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in the form as u can see, u pass the tabname to the fieldsymbol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way you can use the same perform though the structurs used in it are different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 19:29:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732040#M634396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T19:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Tables dynamically to Form</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732041#M634397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is your problem solved? Or u need any further info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 20:18:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-tables-dynamically-to-form/m-p/2732041#M634397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T20:18:08Z</dc:date>
    </item>
  </channel>
</rss>

