‎2011 Nov 08 8:44 AM
Hi All,
I am using SAP Simple Tree Model ,( Class CL_SIMPLE_TREE_MODEL ) to create a simple tree hierarchy .The hierarchy is populated based on some input from the user in the previous screen .So what happens is if a user select a node and goes back and changes the selection criteria tree hierarchy should also be refreshed but it is not happening .I have already called the
customer_container->free method and recreating the object again .
‎2011 Nov 08 8:55 AM
Hi,
Can you put the code snippet, it will help to analyze the problem better.
Regards
Senthil
‎2011 Nov 08 9:09 AM
Hi All,
There are 2 GUI screens :
Screen 1 ) User selects an hierarchy based on which the hierarchy is populated on Screen 2.
Screen 2) On the basis of the hierarchy selected on the first screen the tree is populated on the second screen .
create object gv_application.
DATA: lv_event TYPE cntl_simple_event,
lv_events TYPE cntl_simple_events.
create a container for the tree control
CREATE OBJECT gv_custom_container_resp
EXPORTING " the container is linked to the custom control with the
" name 'TREE_CONTAINER' on the dynpro
container_name = 'TREE_CONTAINER'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
message a001.
ENDIF.
create a simple tree model instance
CREATE OBJECT gv_tree
EXPORTING
node_selection_mode = cl_simple_tree_model=>node_sel_mode_single
EXCEPTIONS
illegal_node_selection_mode = 1.
IF sy-subrc <> 0.
message a001.
ENDIF.
create the view (control) of the tree model
CALL METHOD gv_tree->create_tree_control
EXPORTING
parent = gv_custom_container_resp
EXCEPTIONS
lifetime_error = 1
cntl_system_error = 2
create_error = 3
failed = 4
tree_control_already_created = 5.
IF sy-subrc <> 0.
message a001.
ENDIF.
define the events which will be passed to the backend
" node double click
lv_event-eventid = cl_simple_tree_model=>eventid_node_double_click.
lv_event-appl_event = 'X'. " process PAI if event occurs
APPEND lv_event TO lv_events.
CALL METHOD gv_tree->set_registered_events
EXPORTING
events = lv_events
EXCEPTIONS
illegal_event_combination = 1
unknown_event = 2.
IF sy-subrc <> 0.
message a001.
ENDIF.
assign event handlers in the application class to each desired event
SET HANDLER gv_application->handle_node_double_click FOR gv_tree.
add nodes to the tree model
PERFORM add_nodes.
‎2011 Nov 08 9:32 AM
Hi ,
clear gv_tree as well . it should work .
Edited:
hi ,
im not sure at what point of time your are clearing fields.
but you have to clear those variable at exit command,please check SAP sample programs...
PAI:
WHEN 'BACK' 'CANCEL' or 'EXIT'.
clear :gv_custom_container_resp
call method gv_custom_container_resp->free
exceptions
cntl_system_error = 1
cntl_error = 2.
if sy-subrc <> 0.
message a000.
endif.
clear gv_tree.
leave screen.
regards
Prabhu
Edited by: Prabhu Peram on Nov 9, 2011 10:02 AM
‎2011 Nov 08 9:35 AM
I have already done that.I read on help.sap.com on SAP tree model that SAP tree model control buffers the data .Can anyone help me if we can explicitly clear this buffer because to me it looks like a buffer issue .