<?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 creating object: obj1 EXPORTING id = '...' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095321#M734294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a doubt, that meaning has the next code?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT: &lt;/P&gt;&lt;P&gt;   account1 EXPORTING id = `...`.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;overwrite the constructor of object account1, that have the parameter id, passing the value '...' ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cordial greetings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Nov 2007 13:14:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-16T13:14:53Z</dc:date>
    <item>
      <title>creating object: obj1 EXPORTING id = '...'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095321#M734294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a doubt, that meaning has the next code?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT: &lt;/P&gt;&lt;P&gt;   account1 EXPORTING id = `...`.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;overwrite the constructor of object account1, that have the parameter id, passing the value '...' ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cordial greetings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 13:14:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095321#M734294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T13:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: creating object: obj1 EXPORTING id = '...'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095322#M734295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fernandez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The coding simply means:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;- Create an instance account1 and set some default value ( id = '...').&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the CONSTRUCTOR method you can see which instance attribute is filled with the contens of the formal parametr &amp;lt;i&amp;gt;id.&amp;lt;/i&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;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 14:03:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095322#M734295</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-11-16T14:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: creating object: obj1 EXPORTING id = '...'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095323#M734296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lopes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the follow example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  z_mar_demo.

*----------------------------------------------------------------------*
*       CLASS ONE DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS one DEFINITION.

  PUBLIC SECTION.
"   The constructor method must be definited on Public Section
"   Here we're definig a constructor method without parameters.
    METHODS constructor.

  PRIVATE SECTION.

    DATA attribute TYPE char10.

ENDCLASS.                    "ONE DEFINITION


*----------------------------------------------------------------------*
*       CLASS one IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS one IMPLEMENTATION.

  METHOD constructor.
"   Inside Construcot we can initialize attributes, call othres methods, etc...
    MOVE 'value X' TO attribute.

  ENDMETHOD.                    "CONSTRUCTOR

ENDCLASS.                    "one IMPLEMENTATION

*----------------------------------------------------------------------*
*       CLASS two DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS two DEFINITION.

  PUBLIC SECTION.

"   Here we're definig a constructor method with a parameter.
"   Constructor can have only import parameters and its can be defineted
"   as Optional
    METHODS constructor IMPORTING value TYPE char10 OPTIONAL.

  PRIVATE SECTION.

    DATA attribute TYPE char10.

ENDCLASS.                    "two DEFINITION


*----------------------------------------------------------------------*
*       CLASS two IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS two IMPLEMENTATION.

  METHOD constructor.

    IF value IS NOT INITIAL.
      MOVE value TO attribute.
    ELSE.
      MOVE 'value Y' TO attribute.
    ENDIF.
  ENDMETHOD.                    "CONSTRUCTOR

ENDCLASS.                    "two IMPLEMENTATION

DATA o_one TYPE REF TO one.
DATA o_two TYPE REF TO two.
DATA o_two2 TYPE REF TO two.

START-OF-SELECTION.

" As Constructor of class one doesn't has parameters we can create its object as follow
  CREATE OBJECT o_one.

" As parameter was definited as Optional we can pass the parameter during object instantiation.
  CREATE OBJECT o_two
    EXPORTING
      value = 'Value Y'.


" Or we can just pass a null value Like value = ' '. or value = SPACE.  
  CREATE OBJECT o_two
    EXPORTING
      value = ' '.

" As parameter was definited as Optional we can miss the parameter during object instantiation.
  CREATE OBJECT o_two2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcelo Ramos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 15:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095323#M734296</guid>
      <dc:creator>marcelo_ramos1</dc:creator>
      <dc:date>2007-11-16T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: creating object: obj1 EXPORTING id = '...'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095324#M734297</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 CREATE OBJECT statement creates an object in the main memory. The attribute values of this object are either initial values or correspond to the VALUE entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Reference variables can also be assigned to each other. &lt;/P&gt;&lt;P&gt; For the above example this would mean that r_vehicle1 and r_vehicle2 point to the same object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Nov 2007 05:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-object-obj1-exporting-id/m-p/3095324#M734297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-17T05:15:51Z</dc:date>
    </item>
  </channel>
</rss>

