<?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 Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204288#M1521747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am trying to create a Dynamic Internal Table where the length of each field is getting DOUBLED in the output.&lt;/P&gt;&lt;P&gt;I mean to say, for example CLIENT output length is 6 instead of 3. All fields are exactly getting doubled the length&lt;/P&gt;&lt;P&gt;which is causing me a trouble for the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i divide the length by 2, it works. I know its not a right way to do. please suggest whats the problem here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA : xdetails TYPE abap_compdescr.&lt;/P&gt;&lt;P&gt;    DATA : idetails TYPE abap_compdescr_tab.&lt;/P&gt;&lt;P&gt;    DATA : idetails_tmp TYPE abap_compdescr_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA : ref_table_des TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;    DATA : ref_table_des_tmp TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ref_table_des ?=  cl_abap_typedescr=&amp;gt;describe_by_name( 'ztab' ).&lt;/P&gt;&lt;P&gt;    refresh idetails[].&lt;/P&gt;&lt;P&gt;    refresh ifc.&lt;/P&gt;&lt;P&gt;    idetails[] = ref_table_des-&amp;gt;components[].&lt;/P&gt;&lt;P&gt;    LOOP AT idetails INTO xdetails.&lt;/P&gt;&lt;P&gt;      CLEAR xfc.&lt;/P&gt;&lt;P&gt;      xfc-fieldname = xdetails-name .&lt;/P&gt;&lt;P&gt;      xfc-datatype = xdetails-type_kind.&lt;/P&gt;&lt;P&gt;      xfc-inttype = xdetails-type_kind.&lt;/P&gt;&lt;P&gt;      xfc-intlen = xdetails-length.----&lt;/P&gt;&lt;HR originaltext="-----------------------------" /&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;      xfc-decimals = xdetails-decimals.&lt;/P&gt;&lt;P&gt;      APPEND xfc TO ifc.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&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 = ifc&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        ep_table        = dy_table.&lt;/P&gt;&lt;P&gt;    ASSIGN dy_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.&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;Sampath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Aug 2010 05:51:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-13T05:51:50Z</dc:date>
    <item>
      <title>Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204288#M1521747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am trying to create a Dynamic Internal Table where the length of each field is getting DOUBLED in the output.&lt;/P&gt;&lt;P&gt;I mean to say, for example CLIENT output length is 6 instead of 3. All fields are exactly getting doubled the length&lt;/P&gt;&lt;P&gt;which is causing me a trouble for the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i divide the length by 2, it works. I know its not a right way to do. please suggest whats the problem here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA : xdetails TYPE abap_compdescr.&lt;/P&gt;&lt;P&gt;    DATA : idetails TYPE abap_compdescr_tab.&lt;/P&gt;&lt;P&gt;    DATA : idetails_tmp TYPE abap_compdescr_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA : ref_table_des TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;    DATA : ref_table_des_tmp TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ref_table_des ?=  cl_abap_typedescr=&amp;gt;describe_by_name( 'ztab' ).&lt;/P&gt;&lt;P&gt;    refresh idetails[].&lt;/P&gt;&lt;P&gt;    refresh ifc.&lt;/P&gt;&lt;P&gt;    idetails[] = ref_table_des-&amp;gt;components[].&lt;/P&gt;&lt;P&gt;    LOOP AT idetails INTO xdetails.&lt;/P&gt;&lt;P&gt;      CLEAR xfc.&lt;/P&gt;&lt;P&gt;      xfc-fieldname = xdetails-name .&lt;/P&gt;&lt;P&gt;      xfc-datatype = xdetails-type_kind.&lt;/P&gt;&lt;P&gt;      xfc-inttype = xdetails-type_kind.&lt;/P&gt;&lt;P&gt;      xfc-intlen = xdetails-length.----&lt;/P&gt;&lt;HR originaltext="-----------------------------" /&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;      xfc-decimals = xdetails-decimals.&lt;/P&gt;&lt;P&gt;      APPEND xfc TO ifc.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&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 = ifc&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        ep_table        = dy_table.&lt;/P&gt;&lt;P&gt;    ASSIGN dy_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.&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;Sampath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 05:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204288#M1521747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T05:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204289#M1521748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;DEL&gt;This is because your are passing the value to incorrect fiels &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; INTLEN =&amp;gt; Internal Length in Bytes.&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;DEL&gt;Try passing the length to the fields OUTPUTLEN and DD_OUTLEN.&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Aug 13, 2010 11:37 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If 'ZTAB' is a DDIC structure, you can skip this lengthy process &amp;amp; try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: dy_table TYPE REF TO data.
FIELD-SYMBOLS: &amp;lt;dyn_table&amp;gt; TYPE STANDARD TABLE.

CREATE DATA dy_table TYPE STANDARD TABLE OF ( 'ZTAB' ).
ASSIGN dy_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.&lt;/CODE&gt;&lt;/PRE&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>Fri, 13 Aug 2010 06:01:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204289#M1521748</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-08-13T06:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204290#M1521749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It didnt work the first way as you said the reason being the length when getting populated by the method into details table&lt;/P&gt;&lt;P&gt;is itself multiplied by 2. That was the reason i was dividing by 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea why from the method itselt it would return doubled values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the alternative simplest way you suggested to create a dynamic table helped me a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sampath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 06:21:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204290#M1521749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T06:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204291#M1521750</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;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Any idea why from the method itselt it would return doubled values?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I remember this discussion regarding the attribute COMPONENTS of the RTTS class CL_ABAP_STRUCTDESCR. And if i remember correctly Sandra Rossi had given a good explanation. Search in SDN for the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attribute is populated by internal statement [SYSTEM-CALL |http://help.sap.com/abapdocu_70/en/ABAPSYSTEM-CALL.htm] This is calling some Kernel method to populate the COMPONENTS table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need to see if there are any OSS nortes addressing this issue.&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>Fri, 13 Aug 2010 06:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/7204291#M1521750</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-08-13T06:32:33Z</dc:date>
    </item>
  </channel>
</rss>

