<?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: Class builder - attributes access in methods in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121483#M1618491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the values of ITAB are getting cleared at the time I call the second method through program&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Sep 2011 04:14:46 GMT</pubDate>
    <dc:creator>Madhurivs23</dc:creator>
    <dc:date>2011-09-09T04:14:46Z</dc:date>
    <item>
      <title>Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121481#M1618489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a class ZZ_CL_ABC and its methods :&lt;/P&gt;&lt;P&gt;ZZ_M1&lt;/P&gt;&lt;P&gt;ZZ_M2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in method ZZ_M1, one table gets filled up ITAB and I want to access this ITAB in the ZZ_M2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These methods are getting called from one report &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA I_ZZ_CL_ABC     TYPE REF TO ZZ_CL_ABC .
  CREATE OBJECT I_ZZ_CL_ABC .


call method I_ZZ_CL_ABC-&amp;gt;zz_M1
       exporting 
               imat = imat.

call method I_ZZ_CL_ABC-&amp;gt;zz_M2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to access the ITAB which gets filled up in method ZZ_M1 and I want to access that in ZZ_M2, when ZZ_M2 gets called through the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;Madhuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Sep 9, 2011 6:11 AM - changed  tags to lower case&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 03:17:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121481#M1618489</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2011-09-09T03:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121482#M1618490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So what's the problem? Define ITAB as an attribute of the class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 04:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121482#M1618490</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-09-09T04:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121483#M1618491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the values of ITAB are getting cleared at the time I call the second method through program&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 04:14:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121483#M1618491</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2011-09-09T04:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121484#M1618492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to restate your issue. At the moment you simply haven't given sufficient information. Unless zz_m1 clears the table, or neglects to set it, it won't be cleared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried debug?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Sep 9, 2011 6:35 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 04:35:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121484#M1618492</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-09-09T04:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121485#M1618493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a class through class builder zcl_material.&lt;/P&gt;&lt;P&gt;in it I have written 2 methods:&lt;/P&gt;&lt;P&gt;get_material&lt;/P&gt;&lt;P&gt;get_quantity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in method get_material, the materials are getting stored in table it_material.&lt;/P&gt;&lt;P&gt;in method get_quantity, the quantity for materials in it_quantiry, for materials present in the it_material table is calculated &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am using this class in one report and calling its methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get_material : select * from mara into it_material.&lt;/P&gt;&lt;P&gt;get_quantity  : select * from mard in it_quantity for all entries in it_material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The it_material table, I dont want to pass to the report. So what i did is, I declared this table in the attributes tab of the class builder with level instance and visibility as private.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after calling method get_material, the data is present in the it_material.&lt;/P&gt;&lt;P&gt;but when I am calling the method get_quantity, in the select query, the it_material is blank???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how should I define any variable/ table so that it will be present till the class object is there????&lt;/P&gt;&lt;P&gt;is it possible through class builder-&amp;gt;attribute?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 04:44:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121485#M1618493</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2011-09-09T04:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121486#M1618494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Defining the attribute as instance/private is correct. Attributes &lt;STRONG&gt;do not&lt;/STRONG&gt; get cleared between method calls. You must go through in debug and find out where the table is being cleared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the instance of your object the same each time, for example? Have you declared in the method a local variable with the same name as the attribute?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 04:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121486#M1618494</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-09-09T04:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121487#M1618495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;after calling method get_material, the data is present in the it_material.&lt;/P&gt;&lt;P&gt;but when I am calling the method get_quantity, in the select query, the it_material is blank???&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post the code how you are calling the methods &lt;EM&gt;get_material( )&lt;/EM&gt; &amp;amp; &lt;EM&gt;get_quantity( )&lt;/EM&gt; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 04:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121487#M1618495</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-09-09T04:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Class builder - attributes access in methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121488#M1618496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It got solved. I was maintaing that table in 2 places . in the exporting parameter for method get_material and in the attribute also. So it was clearing out. Now I removed it_material from exporting parameter, and its storing values till the object persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot for follow up of question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks Suhas for reply, the doubt got solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2011 05:05:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-builder-attributes-access-in-methods/m-p/8121488#M1618496</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2011-09-09T05:05:33Z</dc:date>
    </item>
  </channel>
</rss>

