<?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 To write a Generic Programming to accept any internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-write-a-generic-programming-to-accept-any-internal-table/m-p/2288616#M499050</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;By Generic Programming&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I know how to write a form WRITE_TABLE which accepts any internal table and also to write the contents of the internal table to the ABAP list, line&lt;/P&gt;&lt;P&gt;by line and field by field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 May 2007 09:24:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-14T09:24:01Z</dc:date>
    <item>
      <title>To write a Generic Programming to accept any internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-write-a-generic-programming-to-accept-any-internal-table/m-p/2288616#M499050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;By Generic Programming&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I know how to write a form WRITE_TABLE which accepts any internal table and also to write the contents of the internal table to the ABAP list, line&lt;/P&gt;&lt;P&gt;by line and field by field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 09:24:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-write-a-generic-programming-to-accept-any-internal-table/m-p/2288616#M499050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T09:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: To write a Generic Programming to accept any internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-write-a-generic-programming-to-accept-any-internal-table/m-p/2288617#M499051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_fcat TYPE slis_t_fieldcat_alv, &lt;/P&gt;&lt;P&gt;is_fcat LIKE LINE OF it_fcat. &lt;/P&gt;&lt;P&gt;DATA: it_fieldcat TYPE lvc_t_fcat, &lt;/P&gt;&lt;P&gt;is_fieldcat LIKE LINE OF it_fieldcat. &lt;/P&gt;&lt;P&gt;DATA: new_table TYPE REF TO data. &lt;/P&gt;&lt;P&gt;DATA: new_line TYPE REF TO data. &lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;l_table&amp;gt; TYPE ANY TABLE, &lt;/P&gt;&lt;P&gt;&amp;lt;l_line&amp;gt; TYPE ANY, &lt;/P&gt;&lt;P&gt;&amp;lt;l_field&amp;gt; TYPE ANY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build fieldcat &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;i_structure_name = 'SYST' &lt;/P&gt;&lt;P&gt;CHANGING &lt;/P&gt;&lt;P&gt;ct_fieldcat = it_fcat[]. &lt;/P&gt;&lt;P&gt;LOOP AT it_fcat INTO is_fcat WHERE NOT reptext_ddic IS initial. &lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING is_fcat TO is_fieldcat. &lt;/P&gt;&lt;P&gt;is_fieldcat-fieldname = is_fcat-fieldname. &lt;/P&gt;&lt;P&gt;is_fieldcat-ref_field = is_fcat-fieldname. &lt;/P&gt;&lt;P&gt;is_fieldcat-ref_table = is_fcat-ref_tabname. &lt;/P&gt;&lt;P&gt;APPEND is_fieldcat TO it_fieldcat. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Table &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;it_fieldcatalog = it_fieldcat &lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;ep_table = new_table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Line with the same structure of the table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN new_table-&amp;gt;* TO &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;CREATE DATA new_line LIKE LINE OF &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;ASSIGN new_line-&amp;gt;* TO &amp;lt;l_line&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Test it... &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DO 30 TIMES. &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'SUBRC' OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;&amp;lt;l_field&amp;gt; = sy-index. &lt;/P&gt;&lt;P&gt;INSERT &amp;lt;l_line&amp;gt; INTO TABLE &amp;lt;l_table&amp;gt;. &lt;/P&gt;&lt;P&gt;ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;l_table&amp;gt; ASSIGNING &amp;lt;l_line&amp;gt;. &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 'SUBRC' OF STRUCTURE &amp;lt;l_line&amp;gt; TO &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;WRITE &amp;lt;l_field&amp;gt;. &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 09:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-write-a-generic-programming-to-accept-any-internal-table/m-p/2288617#M499051</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-14T09:31:42Z</dc:date>
    </item>
  </channel>
</rss>

