<?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 Dynamic create table problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175128#M998174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a Dynamic internal table from the table passed on the selection screen Everythign works good but when I do a select Querry, or UPdate or Insert on this table it fails. Some memory Issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code I am using. I am working on 4.6C&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : i_fcat         TYPE STANDARD TABLE OF lvc_s_fcat.
DATA: i_table_data1  TYPE REF TO data.

FIELD-SYMBOLS: &amp;lt;f_table_data1&amp;gt;     TYPE STANDARD TABLE.

PARAMETERS: p_table TYPE tabname OBLIGATORY.

  CLEAR   i_fcat.
  REFRESH i_fcat.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
            i_structure_name = p_table  " Table Name "MARA
       CHANGING
            ct_fieldcat      = i_fcat
       EXCEPTIONS
            OTHERS           = 1.

  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog = i_fcat
    IMPORTING
      ep_table        = i_table_data1.
  IF sy-subrc = 0.
    ASSIGN i_table_data1-&amp;gt;* TO &amp;lt;f_table_data1&amp;gt;.
  ELSE.
    WRITE: 'Error creating internal table'.
  ENDIF.

*Get DATA
SELECT * FROM (p_table) INTO TABLE &amp;lt;f_table_data1&amp;gt;.

The above select Querry fails because the table &amp;lt;f_table_data1&amp;gt; is created with 804 bytes for P-table as MARA..


Data : t_mara like mara occurs 0 with header line.
the above internal table T_mara is created with 806 Bytes.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My question is when we create an Internal dynamically why is created with 804 Bytes instead of 806 bytes. &lt;/P&gt;&lt;P&gt;Because of this memory mismatch all mt select, Update Insert statements are failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jul 2008 15:49:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-14T15:49:35Z</dc:date>
    <item>
      <title>Dynamic create table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175128#M998174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a Dynamic internal table from the table passed on the selection screen Everythign works good but when I do a select Querry, or UPdate or Insert on this table it fails. Some memory Issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the code I am using. I am working on 4.6C&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : i_fcat         TYPE STANDARD TABLE OF lvc_s_fcat.
DATA: i_table_data1  TYPE REF TO data.

FIELD-SYMBOLS: &amp;lt;f_table_data1&amp;gt;     TYPE STANDARD TABLE.

PARAMETERS: p_table TYPE tabname OBLIGATORY.

  CLEAR   i_fcat.
  REFRESH i_fcat.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
            i_structure_name = p_table  " Table Name "MARA
       CHANGING
            ct_fieldcat      = i_fcat
       EXCEPTIONS
            OTHERS           = 1.

  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog = i_fcat
    IMPORTING
      ep_table        = i_table_data1.
  IF sy-subrc = 0.
    ASSIGN i_table_data1-&amp;gt;* TO &amp;lt;f_table_data1&amp;gt;.
  ELSE.
    WRITE: 'Error creating internal table'.
  ENDIF.

*Get DATA
SELECT * FROM (p_table) INTO TABLE &amp;lt;f_table_data1&amp;gt;.

The above select Querry fails because the table &amp;lt;f_table_data1&amp;gt; is created with 804 bytes for P-table as MARA..


Data : t_mara like mara occurs 0 with header line.
the above internal table T_mara is created with 806 Bytes.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My question is when we create an Internal dynamically why is created with 804 Bytes instead of 806 bytes. &lt;/P&gt;&lt;P&gt;Because of this memory mismatch all mt select, Update Insert statements are failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 15:49:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175128#M998174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T15:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic create table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175129#M998175</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;Check these links&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/code/archives.asp?i=10&amp;amp;d=3038&amp;amp;a=s" target="test_blank"&gt;http://sap.ittoolbox.com/code/archives.asp?i=10&amp;amp;d=3038&amp;amp;a=s&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/groups/technical-functional/sap-dev/dynamic-internal-table-creation-1075543" target="test_blank"&gt;http://sap.ittoolbox.com/groups/technical-functional/sap-dev/dynamic-internal-table-creation-1075543&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narin Nandivada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 18:54:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175129#M998175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T18:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic create table problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175130#M998176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just try with &lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE instead of into TABLE.&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;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jul 2008 19:08:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-create-table-problem/m-p/4175130#M998176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-14T19:08:03Z</dc:date>
    </item>
  </channel>
</rss>

