<?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: How to access table in on_user_command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492339#M16675</link>
    <description>&lt;P&gt;I am not sure if understand your question compeltely but if you want to use an Attribute in Class A which is a private Attribute of class B you have to make them friends.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;CLASS - LOCAL FRIENDS &lt;BR /&gt;&lt;BR /&gt; &lt;/P&gt;
  &lt;P&gt;Syntax &lt;/P&gt;
  &lt;P&gt;CLASS class DEFINITION &lt;BR /&gt; LOCAL FRIENDS class1 class2 ... &lt;BR /&gt; intf1 intf2 ...&lt;/P&gt;</description>
    <pubDate>Fri, 01 Sep 2017 21:31:46 GMT</pubDate>
    <dc:creator>hohoman</dc:creator>
    <dc:date>2017-09-01T21:31:46Z</dc:date>
    <item>
      <title>How to access table in on_user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492337#M16673</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I've developed a program using cl_salv_table and are using the event at_user_command to update data based on selected lines.&lt;/P&gt;
  &lt;P&gt;I've built this on the MVC pattern, which means I have a report &amp;lt;rep&amp;gt; using class lcl_data, class lcl_salv and lcl_salv_events.&lt;/P&gt;
  &lt;P&gt;The data table itab are filled inside lcl_data and passed back to &amp;lt;rep&amp;gt;, then passed inn as a changing parameter to lcl_salv. The issue is; how do I access it inside the user_command method? &lt;/P&gt;
  &lt;P&gt;I could of course made it completely global, visible to all, but that would void the MVC principle.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 13:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492337#M16673</guid>
      <dc:creator>perage</dc:creator>
      <dc:date>2017-09-01T13:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to access table in on_user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492338#M16674</link>
      <description>&lt;P&gt;Nice question. My approach is that the controller handles the user response (IMHO this is the 'correct' MVC behaviour). &lt;/P&gt;
  &lt;P&gt;From your description, it seems to me your report is the controller? Make it an own class.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;class lcl_controller definition.
  public section. 
    methods start. 
    methods on_double_click for event double_click of cl_salv_events_table. 
  private section. 
    data: model type ref to lcl_data, 
          view  type ref to lcl_salv.
endclass. 

class lcl_controller implementation.
  method start. 
    model = lcl_model=&amp;gt;new( )-&amp;gt;load_from_db( ). 
    view = lcl_view=&amp;gt;new( model-&amp;gt;get_data_ref( ) ).
    view-&amp;gt;display( ). 
  endmethod.

  method on_double_click. 
    model-&amp;gt;update_time( row = row time = sy-uzeit ). 
    view-&amp;gt;refresh( ).
  endmethod.

endclass.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Note for larger datasets it's a good idea to work with data references to avoid excessive copying of large tables.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 15:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492338#M16674</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2017-09-01T15:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to access table in on_user_command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492339#M16675</link>
      <description>&lt;P&gt;I am not sure if understand your question compeltely but if you want to use an Attribute in Class A which is a private Attribute of class B you have to make them friends.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;CLASS - LOCAL FRIENDS &lt;BR /&gt;&lt;BR /&gt; &lt;/P&gt;
  &lt;P&gt;Syntax &lt;/P&gt;
  &lt;P&gt;CLASS class DEFINITION &lt;BR /&gt; LOCAL FRIENDS class1 class2 ... &lt;BR /&gt; intf1 intf2 ...&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2017 21:31:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-table-in-on-user-command/m-p/492339#M16675</guid>
      <dc:creator>hohoman</dc:creator>
      <dc:date>2017-09-01T21:31:46Z</dc:date>
    </item>
  </channel>
</rss>

