<?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: Using container from another global class in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971788#M1603848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These are global classes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jun 2011 03:47:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-08T03:47:51Z</dc:date>
    <item>
      <title>Using container from another global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971785#M1603845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two global classes being used by me in a program - Class A and Class B.&lt;/P&gt;&lt;P&gt;  Class A contains the container to display ALV.&lt;/P&gt;&lt;P&gt;  Class B contains the logic to display ALV.&lt;/P&gt;&lt;P&gt;  class B is used as attribute class in Class A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  How is that I can use the container from Class A from class B?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 06:11:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971785#M1603845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-03T06:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using container from another global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971786#M1603846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
class A ...
   public section.
      methods: get_container returining value(ref_cont) type ref to ...,
                      constructor.
   private section.
      data ref_container type ref to....
endclass.

class A impl...
   method get_container.
        ref_cont = me-&amp;gt;ref_container.
   endmethod.

   method constructor.
      create object ref_container ....
   endmethod.
endclass.

class B ...
   public section.
       methods: constructor,
                      display alv.
   private section.
       data ref_alv type ref to....
       data ref_A type ref to A.
endclass.

class B impl...
   method constructor.
       data lr_container type ref to ...
       
       if ref_A is not bound. 
            create object ref_A.
      endif.

      "get container from class A
       lr_container = ref_A-&amp;gt;get_container( ).
                                   
       create object ref_alv 
            exporting
                ....
                 container = lr_container
                ...
   endmethod.

   method display_alv.
        call method ref_alv-&amp;gt;set_table_for_first_display...
    endmethod.
endclass.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If storing container's reference under local &lt;EM&gt;LR_CONTAINER&lt;/EM&gt; in class B constructor causes not displaying ALV, you will have to store this under class B attribute. Alternative would be directly indicating the container reference as parent to ALV by calling functional method like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
create object ref_alv
      exporting
            ..
           container = ref_A-&amp;gt;get_container( )     
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;this will however work in recent releases of SAP NW AS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 08:30:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971786#M1603846</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-06-03T08:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using container from another global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971787#M1603847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;let me be more clear, Class A has container with spilter where the screen is split into 2 parts. The frist part having a drop down button and second part should display the alv grid based on the input from drop down button. Which means I should fill the alv and send that to class A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ibmsateeshkumar on Jun 6, 2011 10:33 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 08:29:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971787#M1603847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-06T08:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using container from another global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971788#M1603848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These are global classes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 03:47:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971788#M1603848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-08T03:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using container from another global class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971789#M1603849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not sure background of your design, but in your case container class A better be used as utilities class so it should be used in B but not visa versa. Then you can use A's container in B as general&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2011 22:00:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-container-from-another-global-class/m-p/7971789#M1603849</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-08T22:00:11Z</dc:date>
    </item>
  </channel>
</rss>

