<?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: Does a quick fix exist to create a constructor? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693661#M31269</link>
    <description>&lt;P&gt;Thats the clue I needed thanks. I totally ignored factory methods.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Sep 2018 07:47:48 GMT</pubDate>
    <dc:creator>peisenhauer</dc:creator>
    <dc:date>2018-09-25T07:47:48Z</dc:date>
    <item>
      <title>Does a quick fix exist to create a constructor?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693657#M31265</link>
      <description>&lt;P&gt;I really like to work with quick fixes, but I’m missing one feature in creation of methods from quick fix. If I take an existing class “ZCL_NEW_CLASS” and try to instatiate an object from it there is no quick fix to add a constructor from the given context. Is this planned or could it be added to the list of quick fixes to enable in future? &lt;/P&gt;
  &lt;P&gt;Example: &lt;/P&gt;
  &lt;P&gt; DATA(example) = NEW ZCL_NEW_CLASS( is_marc = ls_marc ).&lt;/P&gt;
  &lt;P&gt;CTRL+1 on “ZCL_NEW_CLASS” should give the suggestion “Create constructor” with parameter is_marc with type of the supplied ls_marc, as in the normal object-&amp;gt;new_method( ) Quick fix. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Regards, Phillip&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 09:35:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693657#M31265</guid>
      <dc:creator>peisenhauer</dc:creator>
      <dc:date>2018-09-11T09:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Does a quick fix exist to create a constructor?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693658#M31266</link>
      <description>&lt;P&gt;Quick fixes exist to create constructors, class constructors and factory methods. But you need to do it from the class, just position your cursor on the class definition statement. It will ask you which attributes to create importing parameters for and generate the code for those too. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 11:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693658#M31266</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2018-09-11T11:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Does a quick fix exist to create a constructor?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693659#M31267</link>
      <description>&lt;P&gt;Hey Mike,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;okay so there is no other way at the moment? I'm aware of this feature but I hoped there was a way to avoid jumping into the class just for creating the constructor..&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Phillip&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 06:48:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693659#M31267</guid>
      <dc:creator>peisenhauer</dc:creator>
      <dc:date>2018-09-19T06:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Does a quick fix exist to create a constructor?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693660#M31268</link>
      <description>&lt;P&gt;No, but it's not a huge effort. &amp;lt;F3&amp;gt;, &amp;lt;ctrl-1&amp;gt;, generate constructor/factory method/...&lt;/P&gt;
  &lt;P&gt;But this won't include parameters. But the quick-fix for creating constructors or factory methods will offer to include the class's attributes as parameters - and I think that makes more sense than your calling code proposing the names. &lt;/P&gt;
  &lt;P&gt;IMHO constructors should be local or internal to a class anyway, factory method are a far better alternative. If you want, you can include parameters with a quick fix when creating methods. So if you do a quick fix on 'new' it should propose i as a parameter:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;data(obj) = zcl_class=&amp;gt;new( i = 1 ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 09:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693660#M31268</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2018-09-20T09:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Does a quick fix exist to create a constructor?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693661#M31269</link>
      <description>&lt;P&gt;Thats the clue I needed thanks. I totally ignored factory methods.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 07:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/does-a-quick-fix-exist-to-create-a-constructor/m-p/693661#M31269</guid>
      <dc:creator>peisenhauer</dc:creator>
      <dc:date>2018-09-25T07:47:48Z</dc:date>
    </item>
  </channel>
</rss>

