Hierarchical tree Report
Hello Experts,
I am creating a Heirarchical tree Report using class CL_GUI_ALV_TREE.
For getting the Heirarchical data of my requirement , I am using BAPI CL_GUI_ALV_TREE in which table E_WBS_HIERARCHIE_TABLE contain all of data.
I am stcuk , how to write the logic to use this data to build a tree, ( Data format in the table is : WBS_Elemant , Project Defination, Up , Down , Left , right).
Please suggest me the logic or any function module ( Or method) which uses this data to buld a tree. I am using ADD_NODE methos to add a node in the tree.
Thanks & Regards
Mohit
Hi,
What needs to be done is import the data into a local table and then use that one to display your alv tree.
Try searching on sdn or google for similar code.
Manish
Similar Messages
-
Is it possible to create hierarchical tree report (not group tree) CR2008?
Hi,
Is it possible to create hierarchical tree kind report using CR 2008(no group tree in the report)? The report somewhat look like below and a node can have multiple Child and so and so. Is there any magical way either as a chart or any object which supports the below structure.
Parent1
Child1 Child2 Child3 Child4 Child5
Child1A Child1B Child1C
Child1Aa Child1Ab
its hierarchical tree structure and it should be in detail section of the report so that print in paper is possible.
Please help first of all, can we able to create a report in above structure(each item needs to be surronuded with box and the each last child will contain a table valued data.
(if I post this thread, it may look like plain text, please consider the above data as a hierarchical tree structure with child having N number of children)
ThanksMoved from .NET Development - Crystal Reports forum to Crystal Reports Design forum.
Ludek -
Best way to show a hierarchical tree report in APEX 4.2
I have a hierarchical query spanning four levels over two tables. The query works great and also includes hierarchical sum columns (i.e. the parent shows the sum of all children) using functions.
I'm wondering what the best way to display this data to users is?
At the moment I'm thinking I would have a collection holding my report with an extra 'show' column. Then I would include HTML to set the correct show/hide values and refresh the report when a node is clicked. I feel this would probably work but it can't be the best way.
I stripped down my query to the columns needed (no sum columns) and the APEX tree regions work nicely for this. Is there any alternative jquery plugin or anything that people have experience with that will give me the native 4.2 tree structure whilst also allowing me to display extra columns with links?
If I need to provide any more info just let me know!The best you can do is to concatenate multiple columns into single with some separator. I have not tested give a try it might resolve your issue.
with data as (
select 'M' as link_type,
null as parent,
'All Categories' as id,
'All Categories' as name,
null as sub_id
from demo_product_info
union
select distinct('C') as link_type,
'All Categories' as parent,
category as id,
category as name,
null as sub_id
from demo_product_info
union
select 'P' as link_type,
category parent,
to_char(product_id) id,
product_name as name,
product_id as sub_id
from demo_product_info
union
select 'O' as link_type,
to_char(product_id) as parent,
null as id,
(select c.cust_first_name || ' ' || c.cust_last_name
from demo_customers c, demo_orders o
where c.customer_id = o.customer_id
and o.order_id = oi.order_id ) || ', ordered'
||to_char(oi.quantity) as name,
order_id as sub_id
from demo_order_items oi
select case when connect_by_isleaf = 1 then 0
when level = 1 then 1
else -1
end as status,
level,
name ||'--->' || parent as title, ---- This way you can concatenate multiple columns
case when link_type = 'M' then '#IMAGE_PREFIX#Fndtre11.gif'
when name = 'Mens' then '#IMAGE_PREFIX#wparea.gif'
when name = 'Womens' then '#IMAGE_PREFIX#wtpaint.gif'
when name = 'Accessories' then '#IMAGE_PREFIX#wpaste.gif'
when link_type = 'P' then '#IMAGE_PREFIX#cartHL.gif'
when link_type = 'O' then '#IMAGE_PREFIX#Fndtre13.gif'
else null
end as icon,
id as value,
'View' as tooltip,
null as link
from data
start with parent is null
connect by prior id = parent
order siblings by name
Br,
Zaif -
hi gurus,
can any one tell me how to generate the hierarchical (tree ) report for a purticular project.
I should genarate a hierarchical report for all WBS (From top level to lower level WBS ).
With Regards,
Raj.Hi raj,
check BCALV_TREE_02 for ALV TREE DISPLAY ( for more clarification debug it )
* my final table structure
BEGIN OF gty_fin ,
posid TYPE ps_posid,
pspnr TYPE ps_intnr,
post1 TYPE ps_post1,
ebeln TYPE ebeln,
ebelp TYPE ebelp ,
name1 TYPE name1,
belnr TYPE mblnr ,
cplan TYPE wtgxxx ,
netpr TYPE ekpo-netpr ,
dmbtr TYPE dmbtr ,
obligo TYPE dmbtr,
vefugt TYPE dmbtr,
verfugbar TYPE dmbtr,
END OF gty_fin ,
* Coding starts here in ur PBO
*do modification accordingly
MODULE status_0100 OUTPUT.
PERFORM init_tree.
ENDMODULE. " STATUS_0100 OUTPUT
FORM init_tree .
* create container for alv-tree
DATA: l_tree_container_name(30) TYPE c.
l_tree_container_name = 'CCONTAINER1'.
CREATE OBJECT g_custom_container
EXPORTING
container_name = l_tree_container_name
* create tree control
CREATE OBJECT g_alv_tree
EXPORTING
parent = g_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = ' '
no_html_header = 'X'.
DATA l_hierarchy_header TYPE treev_hhdr.
PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
* Hide columns and sum up values initially using the fieldcatalog
PERFORM build_fieldcatalog.
CALL METHOD g_alv_tree->set_table_for_first_display
EXPORTING
is_hierarchy_header = l_hierarchy_header
CHANGING
it_fieldcatalog = git_fieldcatalog
it_outtab = git_edit. "table must be empty !
PERFORM create_hierarchy.
PERFORM register_events.
CALL METHOD g_alv_tree->update_calculations.
* Send data to frontend.
CALL METHOD g_alv_tree->frontend_update.
ENDFORM. "init_tree
" INIT_TREE
*& Form BUILD_HIERARCHY_HEADER
FORM build_hierarchy_header CHANGING
p_hierarchy_header TYPE treev_hhdr.
p_hierarchy_header-heading = 'Project Definition'(002).
p_hierarchy_header-tooltip = 'Project Definition'(002).
p_hierarchy_header-width = 35.
p_hierarchy_header-width_pix = ''.
ENDFORM. " BUILD_HIERARCHY_HEADER
*& Form exit_program
* free object and leave program
FORM exit_program.
CALL METHOD g_custom_container->free.
LEAVE PROGRAM.
ENDFORM. "exit_program
*& Form build_fieldcatalog
FORM build_fieldcatalog.
DATA: lwa_fieldcatalog TYPE lvc_s_fcat.
* The following function module generates a fieldcatalog according
* to a given structure.
REFRESH git_fieldcatalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZDRK' " i created a structure same as final itab.
CHANGING
ct_fieldcat = git_fieldcatalog.
LOOP AT git_fieldcatalog INTO lwa_fieldcatalog.
CASE lwa_fieldcatalog-fieldname.
* hide columns which are already displayed in our tree
WHEN 'POSID' OR 'PSPNR' OR 'EBELN' OR 'EBELP' OR 'POST1'.
lwa_fieldcatalog-no_out = 'X'.
** Do some initial calculations:
** ALV Tree uses the field 'do_sum' to declare that a function
** for the corresponding column shall be calculated.
** Use 'h_ftype' to set the function type (MAX, MIN, SUM, AVG).
WHEN 'DMBTR' OR 'OBLIGO' OR 'VEFUGT' OR 'VERFUGBAR'. " 'CPLAN' OR
lwa_fieldcatalog-do_sum = 'X'.
lwa_fieldcatalog-h_ftype = 'SUM'.
WHEN 'BELNR'.
lwa_fieldcatalog-hotspot = 'X'.
lwa_fieldcatalog-tooltip = 'Invoice Document Number'(003).
ENDCASE.
MODIFY git_fieldcatalog FROM lwa_fieldcatalog.
ENDLOOP.
ENDFORM. " build_fieldcatalog
*& Form create_hierarchy
FORM create_hierarchy.
DATA: ls_fin TYPE gty_fin,
lt_fin TYPE TABLE OF gty_fin,
lv_posid1_last TYPE ps_posid,
lv_ebeln TYPE ebeln,
lv_post1 TYPE ps_post1,
lv_ebeln_last TYPE ebeln,
lv_ebelp TYPE ebelp.
DATA: lv_ebeln_key TYPE lvc_nkey,
lv_ebelp_key TYPE lvc_nkey,
lv_last_key TYPE lvc_nkey,
lv_top_key TYPE lvc_nkey,
lv_node_text TYPE lvc_value,
lv_text_psp TYPE char10 .
lv_text_psp = 'Project'(004).
* all my data is in final itab git_fin
lt_fin[] = git_fin .
lv_node_text = gv_proj.
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = ''
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = lv_node_text
IMPORTING
e_new_node_key = lv_top_key.
LOOP AT lt_fin INTO ls_fin.
lv_posid1 = ls_fin-posid.
lv_post1 = ls_fin-post1.
lv_ebeln = ls_fin-ebeln.
lv_ebelp = ls_fin-ebelp.
IF lv_posid1 <> lv_posid1_last. " on change of posid
lv_posid1_last = lv_posid1.
* PO- ebeln nodes
PERFORM add_ebeln USING lv_posid1
lv_post1
lv_top_key
CHANGING lv_ebeln_key.
ENDIF.
IF lv_ebeln <> lv_ebeln_last. " On change of lv_ebeln
lv_ebeln_last = lv_ebeln .
PERFORM add_ebelp USING ls_fin
lv_ebeln_key
lv_ebeln
CHANGING lv_ebelp_key .
ENDIF.
* Leaf:
PERFORM add_complete_line USING ls_fin
lv_ebelp_key
lv_ebelp
CHANGING lv_last_key .
ENDLOOP.
* expand first node initially
CALL METHOD g_alv_tree->expand_node
EXPORTING
i_node_key = lv_top_key.
ENDFORM. " create_hierarchy
*& Form ADD_EBELN
FORM add_ebeln USING p_lv_posid1 TYPE ps_posid
p_lv_post1 TYPE ps_post1
p_lv_top_key TYPE lvc_nkey
CHANGING p_lv_ebeln_key TYPE lvc_nkey.
DATA : ls_fin TYPE gty_fin,
lv_node_text TYPE lvc_value ,
lv_text_psp TYPE char11.
lv_text_psp = 'WBS Element'(005).
lv_node_text = p_lv_posid1.
CONCATENATE p_lv_post1 lv_node_text
INTO lv_node_text
SEPARATED BY space.
* add node
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_lv_top_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = lv_node_text " 'WBS Element'
is_outtab_line = ls_fin
IMPORTING
e_new_node_key = p_lv_ebeln_key.
ENDFORM. " ADD_EBELN
*& Form ADD_EBELP
FORM add_ebelp USING p_ls_fin TYPE gty_fin
p_lv_ebeln_key TYPE lvc_nkey
p_lv_ebeln TYPE ebeln
CHANGING p_lv_ebelp_key TYPE lvc_nkey.
DATA : ls_fin TYPE gty_fin ,
lv_node_text TYPE lvc_value,
lv_text_order TYPE char10 .
lv_text_order = 'ORDER '(006).
lv_node_text = p_lv_ebeln .
CONCATENATE lv_text_order lv_node_text
INTO lv_node_text
SEPARATED BY space.
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_lv_ebeln_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = lv_node_text " 'EBELN
is_outtab_line = ls_fin
IMPORTING
e_new_node_key = p_lv_ebelp_key.
ENDFORM. " ADD_EBELP
*& Form ADD_COMPLETE_LINE
* text
* -->P_LS_FIN text
* -->P_LV_EBELP_KEY text
* <--P_LV_LAST_KEY text
FORM add_complete_line USING p_ls_fin TYPE gty_fin
p_lv_ebelp_key TYPE lvc_nkey
p_lv_ebelp TYPE ebelp
CHANGING p_lv_last_key TYPE lvc_nkey.
DATA : lv_text_pos TYPE char10,
lv_node_text TYPE lvc_value,
lv_node_layn TYPE lvc_s_layn.
lv_text_pos = 'Position '(007).
lv_node_text = p_lv_ebelp .
IF p_lv_ebelp IS INITIAL .
lv_node_text = 'PLAN'(008) .
lv_node_layn-hidden = 'X'.
ELSE.
CONCATENATE lv_text_pos lv_node_text
INTO lv_node_text
SEPARATED BY space.
ENDIF.
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_lv_ebelp_key
i_relationship = cl_gui_column_tree=>relat_last_child
is_outtab_line = p_ls_fin
is_node_layout = lv_node_layn
i_node_text = lv_node_text " Position of item
IMPORTING
e_new_node_key = p_lv_last_key.
CLEAR : lv_node_layn .
ENDFORM. " ADD_COMPLETE_LINE
Regards,
Aby
hope this might be useful. -
Call forms and reports from a hierarchical tree node.
Hello,
I am new in pl/sql programming and I have some dificulties. I have created a hierarchical tree, in order to use it as a menu in an application that I am trying to develope. The problem is that I do not know how can I make the last nodes to be either a form or a report and when somebody double clicks on these nodes the form or the report will run. What is more, should I use the when-tree-node-selected trigger or the when-tree-node-activated?
Thank you in advance,
VagHi ,
In Oracle Forms , a hierarchical tree is developed through the use of a sql statement and column which defines the order of leaves...
Visit the on-line help of Forms10g to find out the details , and the triggers as well...
Something else...post this question to Oracle Forms to get more detailed answer...
Regards,
Simon -
Call forms and reports through a hierarchical tree node.
Hello,
I am new in pl/sql programming and I have some dificulties. I have created a hierarchical tree, in order to use it as a menu in an application that I am trying to develope. The problem is that I do not know how can I make the last nodes to be either a form or a report and when somebody double clicks on these nodes the form or the report will run. What is more, should I use the when-tree-node-selected trigger or the when-tree-node-activated? I use forms 6i.
Thank you in advance,
Vag
Message was edited by:
user537672Thank you very much for your reply. I tried what you said and managed to create a when-tree-node-activated trigger that works fine. The only problem is that I do not know how to find the last 3 characters of every node in order to make the form understand if it is a form or a report. I mean that the name of each node maybe of different length so I do not know how exactly to use the substr().
Thank you
Vag -
Connect by prior working in sql but not in forms 10g hierarchical tree
Hello Friends,
I have the following connect by prior example which is working in sql command prompt but not in Forms 10g hierarchical tree item type. Can you please let me know why ?
configuration: Forms 10g patchset 10.1.2.0.2 and oracle 11g database on windows 7
SQL> SELECT 1 InitialState,
2 level Depth,
3 labeller NodeLabel,
4 NULL NodeIcon,
5 to_char(reportno) NodeValue
6 FROM reports where formname = 'billinin.fmx' or reportno > 9999
7 start with reportno > 9999
8 CONNECT BY PRIOR reportno = labelno
9 /
INITIALSTATE DEPTH NODELABEL N NODEVALUE
1 1 FIRST 10000
1 2 report1 UD Label 1
1 2 report2 UD Label 2
1 2 report3 UD Label 3
1 1 SECOND 10001
1 1 THIRD 10002
If I write this command in forms hierarchical tree, then it is working, why not the above code ?
SQL> SELECT 1 InitialState,
2 level Depth,
3 labeller NodeLabel,
4 NULL NodeIcon,
5 to_char(reportno) NodeValue
6 FROM reports
7 start with reportno > 9999
8 CONNECT BY PRIOR reportno = labelnoThanks Room,
This command worked ! I will put the sample working code here. It will help you to filter the records in a tree in sql command prompt as well as in forms hierarchical tree 10g.
SELECT 1 InitialState,
level Depth,
labeller NodeLabel,
NULL NodeIcon,
to_char(reportno) NodeValue
FROM reports
start with reportno > 9999
CONNECT BY PRIOR reportno = labelno
AND FORMNAME = :reports.testitem -
Problem when selecting child node in Hierarchical Tree
I have a hierarchical tree on a form populated thru a table query(form1). When I click on a child node, it opens form2 which contains a tab canvas. After closing forms, I return to the form1(containing Tree). At this point If I want to click on the same child node, I should be able to open form2 again. This doesn't happen.
I have the following code in my When-Tree-node_selected trigger:
Declare
htree item;
vnode_label varchar2(50);
node_clicked FTREE.NODE;
vnode_value number;
vnode_depth number;
v_type number;
v_value varchar2(100);
v_form_name varchar2(100);
v_alert_return number;
begin
-- Find the tree itself.
htree := FIND_ITEM('tree_block.tree');
node_clicked := :SYSTEM.TRIGGER_NODE;
vnode_value := FTREE.NODE_label;
-- Find the value of the node clicked on.
vnode_label := FTREE.GET_TREE_NODE_PROPERTY (htree,:SYSTEM.TRIGGER_NODE,FTREE.NODE_label);
vnode_depth := to_number(ftree.get_tree_node_property(htree,:SYSTEM.TRIGGER_NODE,ftree.Node_depth));
--Open form for node selected on tree and/or specific tab page
if vnode_depth <> 1 then
if :system.trigger_node_selected = 'TRUE' then CASE vnode_label
WHEN 'Personal' then
v_form_name :='HR_PERSONAL_INFO_UPDATE';
WHEN 'Citizenship' then
v_form_name :='HR_PERSONAL_INFO_UPDATE';
WHEN 'Emergency Contact' then
v_form_name :='HR_PERSONAL_INFO_UPDATE';
if id_null(Find_form(v_form_name)) then
open_form(:global.application_path || v_form_name,ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA);
else
go_form(v_form_name);
end if;
END IF;
elsif vnode_depth = 1 then
if :system.trigger_node_SELECTED = 'TRUE' then CASE vnode_label
WHEN 'EMPLOYEE INFO' then
v_form_name :='HR_PERSONAL_INFO_UPDATE';
vnode_label := 'Personal';
WHEN 'REPORTS' then
v_form_name :='HR_REPORTS';
vnode_label := '';
if id_null(Find_form(v_form_name)) then
v_form_name := :global.application_path || v_form_name;
open_form(v_form_name,ACTIVATE,NO_SESSION,SHARE_LIBRARY_DATA);--,p_list);
else
go_form(v_form_name);
end if;
end if;
end;
Can anyone please help me? I don't want the user to double click. They should only click once.
Thanks,
MercedesRight clicking does not change the current selection. The tree has no way to report what node was right clicked. Only work around is to left click the node you wish then right click it.
--pat -
Hierarchical Tree: When-Tree-Node-Activated is not working
I'm working Forms 10G rel.2.1 and also using application server 10G 2.
my problem is in Hierarchical Tree [When-Tree-Node-Activated] is not working in Enter this is working in Enter+Tab
I want to this trigger is working in only Enter.
I'm waiting quick responsenode_value is only item which have transfer the form or report name
Trigger Name : WHEN-TREE-NODE-ACTIVATED
Declare
htree Item ;
Begin
--clear_values;
-- htree := Find_Item('tree.htree');
-- Find the value of the node clicked on.
:node_value := ftree.Get_Tree_Node_Property(htree, :SYSTEM.trigger_NODE, Ftree.NODE_VALUE);
----Above node value transfer the procedure and call the form with node_value(Form Name)
Execute_CMD_PROC;
Exception
When Others Then Null;
End ;
when i enter then no value but when i enter+tab then show the form -
Hierarchical Tree cannot populate
Hi all senior and expert,
Im new in oracle forms 10g and now im trying to develop system using hierarchical tree,but when im run for testing my tree cannot populate..Please help me...
My program Units:
PROCEDURE run_tree IS
BEGIN
DECLARE
htree ITEM;
v_ignore NUMBER;
rg_emps RECORDGROUP;
a varchar2(300):=' ';
startmenu varchar2(100):=' ';
node FTREE.NODE;
state varchar2(100):=' ';
cursor aa is
select distinct menu_name from menu_master_user
where nvl(FORM_NAME,' ') = ' '
and user_key = :global.user_key
and nvl(menu_name,' ') <> ' '
and seq <> 0;
BEGIN
-- Find the tree itself.
htree := Find_Item('tree4');
-- Check for the existence of the record group.
rg_emps := Find_Group('menu');
IF NOT Id_Null(rg_emps) THEN
DELETE_GROUP(rg_emps);
END IF;
BEGIN
select distinct menu_name into startmenu from menu_master_user
where user_key = :global.user_key
and seq=0;
EXCEPTION
WHEN NO_DATA_FOUND THEN
MESSAGE ('This user has no accessible item setup in the user access module,Please report to CICT for accessible...');
MESSAGE ('This user has no accessible item setup in the user access module,Please report to CICT for accessible...');
raise form_trigger_failure;
end ;
rg_emps := Create_Group_From_Query('menu',
'select 1,level,menu_name,:global.drive||icon_file,form_name
from menu_master_user where user_key='''||:global.user_key||
''' connect by prior menu_name=root_menu and user_key='''||:global.user_key||
''' and acc=''Y''
start with menu_name='''||startmenu||''' and user_key='''||:global.user_key||
''' order by seq');
a:='select 1,level,menu_name,:global.drive||icon_file,form_name
from menu_master_user where user_key='''||:global.user_key||
''' connect by prior menu_name=root_menu and user_key='''||:global.user_key||
''' and acc=''Y'' start with menu_name='''||startmenu||''' and user_key='''||:global.user_key||
''' order by seq';
-- Populate the record group with data.
v_ignore := Populate_Group(rg_emps);
-- Transfer the data from the record group to the hierarchical
-- tree and cause it to display.
Ftree.Set_Tree_Property(htree, Ftree.RECORD_GROUP, rg_emps);
-- Find the tree itself.
htree := Find_Item('tree4');
-- Find the root node of the tree.
--node := Ftree.Find_Tree_Node(htree,'Setup');
-- Loop through all nodes and expand each one if it is collapsed.
for aaa in aa loop
node := Ftree.Find_Tree_Node(htree,aaa.menu_name);
IF NOT Ftree.ID_NULL(node) then
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.EXPANDED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.COLLAPSED_NODE);
END IF;
end if;
END LOOP;
END;
END;
Any solutions or my code is wrong?
Edited by: 995252 on Mar 21, 2013 12:17 AMWelcome to the Oracle Forums. Please take a few minutes to review the following:
<ul>
<li>Oracle Forums FAQ
<li>Before posting on this forum please read
<li>10 Commandments for the OTN Forums Member
<li>How to ask questions the smart way
</ul>
Following these simple guidelines will ensure you have a positive experience in any forum; not just this one! ;-)
Lets start with some of the basics. What is your Forms version, Client OS version; if web deployed, your browser and Java versions and any error messages you might be receiving.
Craig... -
I have a table storing items that I want to use in a hierarchical tree. There are form, report, and title. I want to filter out the forms and reports so they dont display in the tree. When I set a Where clause type = 'title' nothing shows up in the tree but info does show in the query. When I set the where clause to type NOT IN ('form', 'report'). Everything shows up like I hadnt done the clause (in tree). Another thing is that in SQL Developer the query returns with the forms/reports filtered.
Any ideas?Hi,
bet practice for building filtered trees is to use record groups and fetch the data with a PLSQL cursor
regarding the query, chances are that you misspelled the condition, try
lower(type) NOT IN ('form', 'report')
Frank -
Problem with Pre-Popup-Menu in Hierarchical Tree
Hi,
In Forms 10g I have made an application with an Hierarchical Tree. All works well, except the use of the Pre-Popup-Menu trigger.
In that trigger when I read the values of Node_Label and Node_Value I get the values of the previous selected node, not the values of the node on which I issue the right mouse click. So, it seems that by clicking the node I need is not selected.
Does anyone have any clues to solve this problem?
Thanks in advance.Right clicking does not change the current selection. The tree has no way to report what node was right clicked. Only work around is to left click the node you wish then right click it.
--pat -
Creating TREE REPORT with CHECKBOX against each row
Hi Friends,
I need to create a <b>TREE REPORT with CHECK BOX</b> against each row. when the user selects a row and clicks on a custom button then those should get populated into an internal table. <b>This is HIGH priority</b> one and I have tried my best but couldnt find any solution. Please advise me some sol.
thanks in advance for your valuable time and help.
Regards
srithan
Message edited by me for easyness
ReddyHi
Following code is to add checkboxes in ALV tree:
FORM add_root_request USING pls_data_ TYPE csg_gs_outtab_p_key__l_is_sub_node_ TYPE c
CHANGING pl_carrid_key._node = nodes->add_node( related_node = p_key
relationship = cl_gui_column_tree=>relat_last_child ).
... §0.2 if information should be displayed at
the hierarchy column set the carrid as text for this node
text = p_ls_data-object.
node->set_text( text ).
... §0.3 set the data for the nes node
node->set_data_row( p_ls_data ).
item = node->get_hierarchy_item( ).
item = node->get_item( 'FCHECKBOX' ). "FCHECKBOX is my radio button field in internal table which I am using to populate the ALV
item->set_type( if_salv_c_item_type=>checkbox ).
pl_carrid_key = node->get_key( )._
CATCH cx_salv_msg.
ENDFORM_._Following code is for handling checbox_change event
PERFORM application_action_events.
FORM application_action_events .
data: lr_events type ref to cl_salv_events_tree.
*data gr_events type ref to lcl_handle_events.
lr_events = gr_tree->get_event( ).
create object gr_events.
set handler gr_events->check for lr_events.
set handler gr_events->on_link_click for lr_events.
set handler gr_events->on_before_user_command for lr_events.
set handler gr_events->on_after_user_command for lr_events.
set handler gr_events->on_keypress for lr_events.
endform. " application_action_events----
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
check FOR EVENT checkbox_change OF cl_salv_events_tree IMPORTING node_key columnname checked. "Here node_key is the row number
ENDCLASS. "lcl_handle_events DEFINITION
CLASS lcl_handle_events IMPLEMENTATION
§4.2 implement the events for handling the events of cl_salv_table
CLASS lcl_handle_events IMPLEMENTATION_._
METHOD check_._
WRITE 'hello'_._
DATA lwa_modify_check_ TYPE REF TO csg_gs_outtab.
node_key = node_key - 1_._
READ TABLE csg_gt_list INDEX node_key REFERENCE INTO lwa_modify_check._
if columnname = 'FCHECKBOX'_._
IF checked = 'X'_._
If the value in internal table is set to X, then it is deselct
lwa_modify_check->fcheckbox =_ ' '_._
ELSE_._
lwa_modify_check->fcheckbox =_ 'X'_._
ENDIF_._
ENDIF_._
if columnname = 'CHECKBOX_READ'_._
IF checked = 'X'_._
If the value in internal table is set to X, then it is deselct
lwa_modify_check->checkbox_read =_ ' '_._
ELSE_._
lwa_modify_check->checkbox_read =_ 'X'_._
ENDIF_._
ENDIF_._
*MODIFY TABLE csg_gt_list from l_wa_modify_check.
flag_test = flag_test + 1_._
ENDMETHOD_._ "check
ENDCLASS_._ "lcl_handle_events IMPLEMENTATION
Please give me reward points -
Hi,
I'am working on the Hierarchical Tree structure which should have three levels, I need to have a check box in the place of the icon & if i select a node that node & the child nodes should get selected.
After this when i say move selected ( i'am trying to use picklist class also) the entire checked tree has to move to the display area to the right & should display as tree structure & after this if i save then the checked records which are moved to another text area should get saved!!
How to achieve this? I have the tree structure ready but the check box part is the worrying factor! & then moving the checked records to the right using picklist class is the second problem & finally saving records to database.
Any help in this regard will be deeply appreciated:)
If check box is not possible then i will have to look at other methods, will the tree structure allow checkboxes????
Thanks
MaheshNo the tree will not allow checkboxes
-
How to go to a particular node in a hierarchical tree?
I want to do this simple thing with a Forms hierarchical tree.
Since tree has lots of levels and branches I want to give a search box.
User types the label and press a button. The form then has to query the tree node and expand ONLY the path where the node is (if found) and highlight it. If a node with a label is NOT found I give an error message to the user.
I got hold of a code segment to explode a tree and modified it, but it does not work. The entire tree is expanded and you don't know where you are.
Any help will be greatly appreciated?
PROCEDURE Expand_All_Nodes_in_Tree IS
node ftree.node;
htree ITEM;
state varchar2(30);
BEGIN
-- Search the tree identifiant --
htree := Find_Item('menu.tree');
-- Search the root --
node := Ftree.Find_Tree_Node(htree, '');
-- Expand all nodes --
WHILE NOT Ftree.ID_NULL(node) LOOP
state := Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_STATE);
IF state = Ftree.COLLAPSED_NODE THEN
Ftree.Set_Tree_Node_Property(htree, node, Ftree.NODE_STATE, Ftree.EXPANDED_NODE);
END IF;
node := Ftree.Find_Tree_Node(htree, '', ftree.find_NEXT,Ftree.NODE_LABEL,'', node);
IF Ftree.Get_Tree_Node_Property(htree, node, Ftree.NODE_LABEL) = :ctrl.node_lable_to_search THEN
EXIT;
END IF;
END LOOP;
END;Hi Channa,
Try this code with you tree i am using the same situation and this code is working perfect with me.
PROCEDURE find_node_in_tree(search_string varchar2, find_type varchar2) IS
htree ITEM;
search_start_node ftree.node;
find_node ftree.node;
BEGIN
htree := Find_Item('blk_tree.main_tree');
search_start_node := nvl(ftree.get_tree_selection(htree,1),ftree.root_node);
find_node := ftree.find_tree_node(htree,upper(search_string)||'%',ftree.find_next,ftree.node_label,ftree.root_node,search_start_node-1);
if find_node = 0 then
find_node := 1;
end if;
Ftree.Set_Tree_selection(htree, find_node, Ftree.SELECT_ON);
exception
when others then
NULL;
END;
-Ammad
Maybe you are looking for
-
error 13.11 Source file not found verify that the file exsist
-
WRT54G and WRT54GS Linksys EasyLink Advisor (LELA) users
If you are experiencing any issues with Linksys EasyLink Advisor (LELA) and the latest firmware on the Linksys.com, you may have to roll back your firmware version. Linksys EasyLink Advisor (LELA) may not function properly with the firmware revision
-
I have two new Solaris 10 6/06 systems here that are not checking in with the Update Connection. Looking in /var/log/swupas/swupas.log I see this - Swup Agent run: Monday, 25 September 2006 11:31:29 BST ** DEBUG ON ** Attempt to get exclusive lock: 1
-
Hi Everyone. I just bought MacPro and enjoying it very much. I was using the hot corners but now I cannot activate the corners. I am unable to find the Exposé in System Preferences. When i tried to search it, it says that this file does not exist. It
-
Longlabel of Folder in SQL Developer Filenavigator gives only filename
Hello, I am working on an extension for SQL Developer (3.1) with JDeveloper 11g rel 1. I have defined actions in the extension.xml, which I want to use in the Filenavigator. When selecting a directory node and selecting the action from the pop-up men