<?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: Question about Object Reference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407627#M196606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, i agree with you, but what happens if second CREATE OBJECT fails? Holds equipo variable the memmory location of the first object created?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jul 2006 15:12:52 GMT</pubDate>
    <dc:creator>LucianoBentiveg</dc:creator>
    <dc:date>2006-07-21T15:12:52Z</dc:date>
    <item>
      <title>Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407625#M196604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this situation:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CREATE OBJECT equipo EXPORTING sernr = p_sernr1
                               matnr = p_matnr1.

CALL METHOD equipo-&amp;gt;ingreso_directo_homologado
                     EXPORTING centro  = aux_centro
                               almacen = ga_pos_entregas-almacen              IMPORTING error   = error
                               texto   = p_texto.

CREATE OBJECT equipo EXPORTING sernr = p_sernr2
                               matnr = p_matnr2.

CALL METHOD equipo-&amp;gt;ingreso_directo_homologado
                     EXPORTING centro  = aux_centro
                               almacen = ga_pos_entregas-almacen              IMPORTING error   = error
                               texto   = p_texto.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could be that second CREATE OBJECT sentence fails, and second CALL METHOD sentence refers to first object created?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points guaranteed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 15:00:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407625#M196604</guid>
      <dc:creator>LucianoBentiveg</dc:creator>
      <dc:date>2006-07-21T15:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407626#M196605</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;I dont think so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;equipo --&amp;gt; this is just a variable which holds the memmory location of the object created during first call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when u will create another object using same variable ; i think new memmory location ( new object ) will be allocated to the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try  and confirm the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 15:06:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407626#M196605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T15:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407627#M196606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, i agree with you, but what happens if second CREATE OBJECT fails? Holds equipo variable the memmory location of the first object created?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 15:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407627#M196606</guid>
      <dc:creator>LucianoBentiveg</dc:creator>
      <dc:date>2006-07-21T15:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407628#M196607</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;I have Test the same ; which i have written above . it working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can cross check. ( copy paste the code &amp;amp; run it )&lt;/P&gt;&lt;P&gt;Check the value &amp;lt;b&amp;gt;o_alvgrid&amp;lt;/b&amp;gt; in debugging mode.&lt;/P&gt;&lt;P&gt;u will fine new refrence for each create object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA  : o_alvgrid       TYPE REF TO cl_gui_alv_grid,
        o_custcontainer TYPE REF TO cl_gui_custom_container,
        o_custcntr_sum  TYPE REF TO cl_gui_custom_container.


CONSTANTS :
       lc_custcontrol  TYPE scrfname VALUE 'CC_ALV',
       lc_custcntr_sum TYPE scrfname VALUE 'CC_ALV_SUM'  .


    CREATE OBJECT o_custcontainer
      EXPORTING
        container_name              = lc_custcontrol
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.


      CREATE OBJECT o_alvgrid
        EXPORTING
          i_parent          = o_custcontainer
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init   = 2
          error_cntl_link   = 3
          error_dp_create   = 4
          OTHERS            = 5.


    CREATE OBJECT o_custcntr_sum
      EXPORTING
        container_name              = lc_custcntr_sum
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.


      CREATE OBJECT o_alvgrid
        EXPORTING
          i_parent          = o_custcontainer
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init   = 2
          error_cntl_link   = 3
          error_dp_create   = 4
          OTHERS            = 5.


write :/ 'ABC'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;As per 2nd  post of urs .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think result will be unpredictable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initial value of refrence variable are always ...illegal refrence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it may clear the variable to initial value &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;it may retain the current memmory location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward Points &amp;amp; Mark Helpful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 15:21:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407628#M196607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T15:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407629#M196608</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;if your second CREATE OBJECT sentence fails, nothing will happen to the reference equipo. In consequence, as you assume, the second CALL METHOD still refers to first object created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should check the imported error to make sure the second CREATE was successful. Only then you may call method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you did not mention what is the class equipo is referenced to (looks like own object), it is hard to say what's happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think in your case it will be OK to check the value of imported error parameter.&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;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 15:30:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407629#M196608</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-07-21T15:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407630#M196609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can sombedy demonstrate with facts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 16:04:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407630#M196609</guid>
      <dc:creator>LucianoBentiveg</dc:creator>
      <dc:date>2006-07-21T16:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Object Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407631#M196610</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;If you are using same name to create many instances , system will automatically creates object references. object methods will work based on object references.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don't think if second 'create object' fails , methods will not refer to the first object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in debug mode check -&amp;gt; goto-&amp;gt;display data object -&amp;gt;object&lt;/P&gt;&lt;P&gt;you can see the instance information&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 16:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/question-about-object-reference/m-p/1407631#M196610</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-07-21T16:16:36Z</dc:date>
    </item>
  </channel>
</rss>

