<?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 ABAP object dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322199#M1637393</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Nov 2011 09:11:20 GMT</pubDate>
    <dc:creator>AntonPierhagen</dc:creator>
    <dc:date>2011-11-14T09:11:20Z</dc:date>
    <item>
      <title>Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322190#M1637384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to create objects dynamically?&lt;/P&gt;&lt;P&gt;so that the name of the class is set via parameters and also the variables and which class is the superclass?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fieldsymbols: &amp;lt;a&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: data_object type ref to object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create new class type data_object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data_object-name = 'dynamic'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data_object-subclass = 'superclass'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create object &amp;lt;a&amp;gt; like class 'dynamic'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a&amp;gt;-(method of superclass)(   ) etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not ABAP code, but i hope you know what i mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly hear from you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anton Pierhagen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 13:17:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322190#M1637384</guid>
      <dc:creator>AntonPierhagen</dc:creator>
      <dc:date>2011-11-10T13:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322191#M1637385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anton,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's not quite clear what you are trying to achieve here. Do you want to dynamically create a class like is done in SE24 manually?&lt;/P&gt;&lt;P&gt;Or do you want to instantiate an object locally with reference to a global class defined in SE24?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr. Micky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 13:53:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322191#M1637385</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2011-11-10T13:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322192#M1637386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Micky&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first one. Is it possible in ABAP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 13:55:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322192#M1637386</guid>
      <dc:creator>AntonPierhagen</dc:creator>
      <dc:date>2011-11-10T13:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322193#M1637387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use dynamic reference to instantiate your objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lo_ref type ref to object.
create object lo_Ref type ('ZCLASS').
call method lo_ref-&amp;gt;('METH_1').
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But problem in this design would be that your class &amp;amp; method name is hardcoded and it would be only checked at runtime, not at the design time. To overcome, this you can use the [Factory Method Design pattern|http://help-abap.zevolving.com/2011/10/abap-objects-design-patterns-factory-method/].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 14:12:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322193#M1637387</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2011-11-10T14:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322194#M1637388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess it is, and a good start would be to look at function groups starting with SEO*.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this question was asked in the forum before. Maybe searching for a similar question will give you some additional information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr. Micky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 14:18:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322194#M1637388</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2011-11-10T14:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322195#M1637389</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;Thanks for your replies, but is not it what i am looking for i think. The class in the example of Naimesh Patel must be created in the system ? It is not the case that ABAP builds with this code a class ZCLASS? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And with code you can create methods, variables, etc.. voor this new builded class ZCLASS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 16:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322195#M1637389</guid>
      <dc:creator>AntonPierhagen</dc:creator>
      <dc:date>2011-11-10T16:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322196#M1637390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anton,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be following steps might help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a new include program(keep this program blank) and include that to your program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.  Refresh above include program through your program and add lines of code dynamically to above program(by creating new subroutine)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Invoke above subroutine from required place of your program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just got this an idea, but there might be several other ways to fulfill your requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2011 06:04:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322196#M1637390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-12T06:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322197#M1637391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, i don't understand how dynamic classes can be made via this approach. Can you elleborate it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 07:04:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322197#M1637391</guid>
      <dc:creator>AntonPierhagen</dc:creator>
      <dc:date>2011-11-14T07:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322198#M1637392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anton,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using :&lt;/P&gt;&lt;P&gt;Function Module  - SEO_CLASS_CREATE_COMPLETE.&lt;/P&gt;&lt;P&gt;Sample Program  - SBMIG_CREATE_CLASS_AND_TTYPES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 08:56:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322198#M1637392</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-14T08:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create ABAP object dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322199#M1637393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 09:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-abap-object-dynamically/m-p/8322199#M1637393</guid>
      <dc:creator>AntonPierhagen</dc:creator>
      <dc:date>2011-11-14T09:11:20Z</dc:date>
    </item>
  </channel>
</rss>

