2008 Jul 28 1:27 PM
Hello Experts!!!
I need to implement a Simple Tree. Iu2019ve already get an idea from the sample program
u2018SAPSIMPLE_TREE_CONTROL_DEMOu2019 how to implement. Now when I tried to create GUI through screen painter I donu2019t see any tree control or tree container which I can use. Can somebody please tell me how can I have TREE CONTAINER
Thanks a lot
2008 Jul 28 1:40 PM
Hi,
You can create a Custom Container through the Dynpro. That is all you need to embed the Tree Control. As such there is nothing called Tree Container.
Below is a sample code for the Custom Container.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
ENDIF.
* create tree control
CREATE OBJECT tree2
EXPORTING
parent = l_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
l_custom_container is the variable that will contain the name of the custom container that you defined in the Dynpro.
Thanks,
Samantak.
Hello Experts!!!
I need to implement a Simple Tree. Iu2019ve already get an idea from the sample program
u2018SAPSIMPLE_TREE_CONTROL_DEMOu2019 how to implement. Now when I tried to create GUI through screen painter I donu2019t see any tree control or tree container which I can use. Can somebody please tell me how can I have TREE CONTAINER
Thanks a lot
2008 Jul 28 1:40 PM
Hi,
You can create a Custom Container through the Dynpro. That is all you need to embed the Tree Control. As such there is nothing called Tree Container.
Below is a sample code for the Custom Container.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
ENDIF.
* create tree control
CREATE OBJECT tree2
EXPORTING
parent = l_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
l_custom_container is the variable that will contain the name of the custom container that you defined in the Dynpro.
Thanks,
Samantak.
2008 Jul 28 2:39 PM
2008 Jul 28 6:17 PM
Thanks a lot Samantak. I've see that peice of code in SAPSIMPLE_TREE_CONTROL_DEMO.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |