<?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: ALV TREE   refreshing problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220867#M768128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fariba&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could imagine that you call the next screen from within your event handler method which probably causes the undesirable behaviour. &lt;/P&gt;&lt;P&gt;I prefer to call the next screen within the &lt;STRONG&gt;normal PAI logic&lt;/STRONG&gt; of the dynpro. However, since control events usually do not trigger PAI add the following lines to your event handler method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD handle_item_double_click.

...
  CASE sender.  " add the optional IMPORTING parameter to the definition of the event handler method
    WHEN go_tree.
       CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
         EXPORTING
             ok_code = 'DISPLAY_DOC'.  " triggers PAI with ok-code = 'DISPLAY_DOC'.

    WHEN others.
     ...
  ENDCASE.

ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can call in your PAI module USER_COMMAND_0100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  ...
  CASE gd_okcode.
    WHEN 'BACK'    OR
               'EXIT'      OR
               'CANC'.
      IF ( syst-dynnr = '0200' ).
        set screen '0100'. leave screen.
      ELSE.  " ( syst-dynnr = '0100' )
        set screen 0. leave screen.
      ENDIF.

     WHEN 'DISPLAY_DOC'.
       CALL SCREEN '0200'.

     WHEN OTHERS.
     ENDCASE.

   CLEAR: gd_okcode.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively it may be sufficient to register event ITEM_DOUBLE_CLICK as &lt;STRONG&gt;application event&lt;/STRONG&gt; (see routine CREATE_AND_INIT_TREE in sample report &lt;STRONG&gt;SAPSIMPLE_TREE_CONTROL_DEMO&lt;/STRONG&gt;, SE83):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...
* define the events which will be passed to the backend
  " node double click
  event-eventid = CL_GUI_SIMPLE_TREE=&amp;gt;EVENTID_NODE_DOUBLE_CLICK.
  event-appl_event = 'X'. " process PAI if event occurs
  APPEND event to events.
...
&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;Regards,&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jan 2008 09:01:21 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2008-01-15T09:01:21Z</dc:date>
    <item>
      <title>ALV TREE   refreshing problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220864#M768125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program I have to screen, the first one displays some lines of documents which I give the option to choose one or more documents to be displayed on the second screen within tree split on the right to 3 sub screens (alv screens) for data of the tree (nodes). On the right screens the data could be updated and I need to refresh all the 3 screens and also the tree &amp;amp; its nodes.&lt;/P&gt;&lt;P&gt;I have the same problem in few situations:&lt;/P&gt;&lt;P&gt;1- after refresh the tree (delete_all_nodes &amp;amp; create nodes again &amp;amp; call method frontend_update), when I double click on any node, it goes into the form with method "item_double_click" twice or as many times as I refresh the tree.&lt;/P&gt;&lt;P&gt;2- when I go back to the first screen and then go in the second screen, when I double click the node it goes into method "item_double_click" twice or as many as I go back and go in between the screens.&lt;/P&gt;&lt;P&gt;What should I use (methods) to prevent this situation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Fariba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 08:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220864#M768125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-15T08:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: ALV TREE   refreshing problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220865#M768126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you cumulute call of your dynpro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DYNP1 --&amp;gt; Action --&amp;gt; Call again DYNP1 --&amp;gt; action --&amp;gt; Call again DYNP1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and when you leave or anything else, you will need to close 3 times DYNP1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have a look where you call and how, the screen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 08:36:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220865#M768126</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2008-01-15T08:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: ALV TREE   refreshing problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220866#M768127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I dont undrestand how to close the screens...&lt;/P&gt;&lt;P&gt;to remind you it happens even if I don't leave the screen and just try to refresh the tree by deleting nodes and rebuild them.&lt;/P&gt;&lt;P&gt;double click on nodes ,  multiply  the method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 08:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220866#M768127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-15T08:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: ALV TREE   refreshing problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220867#M768128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fariba&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could imagine that you call the next screen from within your event handler method which probably causes the undesirable behaviour. &lt;/P&gt;&lt;P&gt;I prefer to call the next screen within the &lt;STRONG&gt;normal PAI logic&lt;/STRONG&gt; of the dynpro. However, since control events usually do not trigger PAI add the following lines to your event handler method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD handle_item_double_click.

...
  CASE sender.  " add the optional IMPORTING parameter to the definition of the event handler method
    WHEN go_tree.
       CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code
         EXPORTING
             ok_code = 'DISPLAY_DOC'.  " triggers PAI with ok-code = 'DISPLAY_DOC'.

    WHEN others.
     ...
  ENDCASE.

ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can call in your PAI module USER_COMMAND_0100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  ...
  CASE gd_okcode.
    WHEN 'BACK'    OR
               'EXIT'      OR
               'CANC'.
      IF ( syst-dynnr = '0200' ).
        set screen '0100'. leave screen.
      ELSE.  " ( syst-dynnr = '0100' )
        set screen 0. leave screen.
      ENDIF.

     WHEN 'DISPLAY_DOC'.
       CALL SCREEN '0200'.

     WHEN OTHERS.
     ENDCASE.

   CLEAR: gd_okcode.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively it may be sufficient to register event ITEM_DOUBLE_CLICK as &lt;STRONG&gt;application event&lt;/STRONG&gt; (see routine CREATE_AND_INIT_TREE in sample report &lt;STRONG&gt;SAPSIMPLE_TREE_CONTROL_DEMO&lt;/STRONG&gt;, SE83):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...
* define the events which will be passed to the backend
  " node double click
  event-eventid = CL_GUI_SIMPLE_TREE=&amp;gt;EVENTID_NODE_DOUBLE_CLICK.
  event-appl_event = 'X'. " process PAI if event occurs
  APPEND event to events.
...
&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;Regards,&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2008 09:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-tree-refreshing-problem/m-p/3220867#M768128</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-01-15T09:01:21Z</dc:date>
    </item>
  </channel>
</rss>

