<?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: Create a structure type at runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699211#M1452160</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP RTTS is what you're looking for - check out this [Wiki page|http://wiki.sdn.sap.com/wiki/display/ABAP/Runtime&lt;EM&gt;Type&lt;/EM&gt;Services+%28RTTS%29], which should answer your questions... (here's the link to the [ABAP online docu|http://help.sap.com/abapdocu_70/en/ABENRTTI.htm])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s.: Don't use the hyphen in your field names. This was a bad practice that was used in some old releases. The problem is that fields in a structure are addressed with a hyphen, e.g. like &lt;EM&gt;mara-matnr&lt;/EM&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Mar 2010 20:31:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-15T20:31:41Z</dc:date>
    <item>
      <title>Create a structure type at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699210#M1452159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible to create a local structure type dynamically(at run time).My situation is as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user gives a period of time - for Example from "05.03.2009" to "04.03.2010"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the number of months between the period of time  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a structure with field names as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have calculated the number of months between a period of time and the field name also(Mar-09.Apr-09 extra) using function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question that is running around my head now is how to create the local structure type at run time with the field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN of st_testStruct
	
	matnr type string,
	land type string,
	"The above to fields in the structure will always be there but depending on the period of time.
	the following fields have to created dynamically.

	Mar-09 type string,	" as the time period starts from "05.03.2009"
	apr-09 type string,
	may-09 type string,

	........so on
	.........
	......
	dec-09 type string,
	jan-10 type string,
	feb-10 type string,
	mar-10 type string,

end of st_testStruct.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;depending on the time range the number of field could be more or less in the structure type.Thats why I want to create it dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any sample code for this purpose is useful.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 20:04:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699210#M1452159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T20:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create a structure type at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699211#M1452160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP RTTS is what you're looking for - check out this [Wiki page|http://wiki.sdn.sap.com/wiki/display/ABAP/Runtime&lt;EM&gt;Type&lt;/EM&gt;Services+%28RTTS%29], which should answer your questions... (here's the link to the [ABAP online docu|http://help.sap.com/abapdocu_70/en/ABENRTTI.htm])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s.: Don't use the hyphen in your field names. This was a bad practice that was used in some old releases. The problem is that fields in a structure are addressed with a hyphen, e.g. like &lt;EM&gt;mara-matnr&lt;/EM&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 20:31:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699211#M1452160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T20:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a structure type at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699212#M1452161</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;The below link has the example code for building a dynamic internal table/workarea. In that example code, you can enter number of columns as a selection criteria and the internal table gets build with that many number of columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.divulgesap.com/blog.php?p=MjE=" target="test_blank"&gt;http://www.divulgesap.com/blog.php?p=MjE=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ravikiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 21:34:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699212#M1452161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T21:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a structure type at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699213#M1452162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have a look at thread &lt;SPAN __jive_macro_name="thread" id="416210"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to do some re-formatting but I guess the report samples will be quite useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 22:17:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-structure-type-at-runtime/m-p/6699213#M1452162</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-03-15T22:17:58Z</dc:date>
    </item>
  </channel>
</rss>

