<?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: Dynamic structure creation failure for only some structures. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468666#M1252547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should anyone else have the same problem it appears that it is not possible to dynamically create work area's and tables with field names that begin with 0 using a component list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I simply append a '_' character to the begining of the field name in the components list the work area and table can be created dynamically without problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not exactly what I required but a work around non-the-less.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Jun 2009 10:31:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-28T10:31:53Z</dc:date>
    <item>
      <title>Dynamic structure creation failure for only some structures.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468665#M1252546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some code to dynamically create a structure and table based on some sap how to... documentation. It works perfectly for a number of structures but fails on the structure I wish to create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'l_c_cube_write' in the code is the variable that defines which structure. This code is in BW, if I have an InfoCube YINFOCUBE then the code should create a structure and table based on structure /BIC/VYINFOCUBE2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code works fine when based on structure /BIC/VYINFOCUBEI but fails when based on structure /BIC/VYINFOCUBE2. These structures are generated for each InfoCube created in BW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the two structure definitions in SE11 there are a few differences but it is not clear to me if these differences are causing the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know why the error occurs and whether there is a way to avoid it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows.&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;  l_c_cubestruct   type string,&lt;/P&gt;&lt;P&gt;  l_r_cubestrudesc type ref to cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;  l_r_cubedatadesc type ref to cl_abap_tabledescr,&lt;/P&gt;&lt;P&gt;  l_v_cubedatastru type ref to data,&lt;/P&gt;&lt;P&gt;  l_v_cubedatatabl type ref to data,&lt;/P&gt;&lt;P&gt;  l_v_cubecomp     type cl_abap_structdescr=&amp;gt;component_table,&lt;/P&gt;&lt;P&gt;  l_c_comp         type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols:&lt;/P&gt;&lt;P&gt;  &amp;lt;l_fs_anytabl&amp;gt;  type standard table,&lt;/P&gt;&lt;P&gt;  &amp;lt;l_fs_anystru&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;no need to dynamically create data object as the program is created dynamically&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; concatenate '/BIC/V' l_c_cube_write 'I' into l_c_cubestruct. "&lt;STRONG&gt;this works&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  concatenate '/BIC/V' l_c_cube_write '2' into l_c_cubestruct. "&lt;STRONG&gt;this does not&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  l_r_cubestrudesc  ?= cl_abap_structdescr=&amp;gt;describe_by_name( l_c_cubestruct ).&lt;/P&gt;&lt;P&gt;  l_v_cubecomp       = l_r_cubestrudesc-&amp;gt;get_components( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_r_cubestrudesc   = cl_abap_structdescr=&amp;gt;create( l_v_cubecomp ).&lt;/P&gt;&lt;P&gt;  l_r_cubedatadesc   = cl_abap_tabledescr=&amp;gt;create( l_r_cubestrudesc ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  create data l_v_cubedatastru type handle l_r_cubestrudesc.&lt;/P&gt;&lt;P&gt;  create data l_v_cubedatatabl type handle l_r_cubedatadesc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;create a data object for the datapackage and the dataackage structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  assign l_v_cubedatastru-&amp;gt;* to &amp;lt;l_fs_anystru&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign l_v_cubedatatabl-&amp;gt;* to &amp;lt;l_fs_anytabl&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Differences between structures:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure that fails also includes components 0INFOPROV and 1ROWCOUNT.&lt;/P&gt;&lt;P&gt;The structure that fails has components in the format 0MATERIAL, 0CALMONTH, etc. The structure that does not fail has components in the format MATERIAL, CALMONTH, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 08:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468665#M1252546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-20T08:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure creation failure for only some structures.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468666#M1252547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should anyone else have the same problem it appears that it is not possible to dynamically create work area's and tables with field names that begin with 0 using a component list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I simply append a '_' character to the begining of the field name in the components list the work area and table can be created dynamically without problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not exactly what I required but a work around non-the-less.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2009 10:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468666#M1252547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-28T10:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure creation failure for only some structures.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468667#M1252548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I encountered the above problem recently. It is a pain because it means you can't use MOVE-CORRESPONDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's also not possible to define a structure statically with components beginning with numbers - though it is ok in the data dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF my_struc,
         0COMPONENT TYPE...
       END OF MY_struc.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems to me to be rather inconsistent!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 15:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-failure-for-only-some-structures/m-p/5468667#M1252548</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-07-11T15:46:36Z</dc:date>
    </item>
  </channel>
</rss>

