'Expand All' icon in a tree structure?
Hi experts,
If we create a tree UI element in ABAP WD, we automatically get a 'Collapse All' icon.Is it possible to have a 'Expand All' icon as well?
thanks in advance,
Pras
Hello Pras,
You will not get any Collapse All icon when you create a tree UI Element .
You can expand or collapse the tree by clicking on the Parent Elements in the tree.
If you want to explicitly handle the Expand All and Collapse All functionality you need to put a button in the toolbar with name Expand ALL and handle it explicitly by setting attribute EXPANDED to abap_true for each and every element in the tree for Expand All action and vice versa for Collapse All.
Hope this is of some help.
Regards,
Ismail.
Similar Messages
-
JTree - How to Expand all Nodes in the Tree
I have a tree that has one primary node, two sub-nodes, and multiple sub-sub-nodes under those. I want to expand (show) all these nodes in the tree when the tree first loads. I tried expandRow() but that only seems to expand one row at a time by entering a single integer for the row. Is there any way to expand all rows/nodes when loading the tree?
see
http://forum.java.sun.com/thread.jsp?forum=57&thread=148793 -
Expand all on tree when dataprovider is an object.
When I first start the application I would like to have the
tree and all nodes fully expanded. My RemoteService returns an
object that looks like the snippet below.
I have seen a lot of code on how to expand all nodes of a
tree, but I do not have a tree.selectedItem yet as I have just
created the app. I would like to add an expand all to the
creationComplete on the tree but I an not sure what to pass the
tree.expandItem. I have tried to pass tree.firstVisibleItem. I have
tried to iterate over the children of the root object of my
dataprovider. I can do it with xml but can't seem to figure it out
using an object. Any ideas?I tested with your data structure and the following worked
for me. I called expandAll(myTree,true) on creationComplete and all
nodes were open on load. -
Tree table-initially expand all nodes raises error when closing a node 11g
Hello,
Frank Nimphius posted a blog entry about how to initially display all the nodes in a tree or table here:
[http://thepeninsulasedge.com/frank_nimphius/2007/12/19/adf-faces-rc-initially-expanding-all-nodes-in-a-tree-or-tree-table/|http://thepeninsulasedge.com/frank_nimphius/2007/12/19/adf-faces-rc-initially-expanding-all-nodes-in-a-tree-or-tree-table/]
This works very well. However, when the user tries to close a node, a NullPointerException is thrown.
Below is the stacktrace.
Does anyone know how to work around that issue?
java.lang.NullPointerException
at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl$Search.find(RowKeySetTreeImpl.java:608)
at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl._setContained(RowKeySetTreeImpl.java:496)
at org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.add(RowKeySetTreeImpl.java:97)
at oracle.adfinternal.view.faces.renderkit.rich.TableRendererUtils.decodeDisclosedRowKeys(TableRendererUtils.java:774)
at oracle.adfinternal.view.faces.renderkit.rich.table.BaseTableRenderer.decodeIncompatiblePropertyKey(BaseTableRenderer.java:198)
at oracle.adf.view.rich.render.RichRenderer.decode(RichRenderer.java:203)
at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:1089)
at org.apache.myfaces.trinidad.component.UIXComponentBase.decode(UIXComponentBase.java:714)
at org.apache.myfaces.trinidad.component.UIXTreeTable.decode(UIXTreeTable.java:133)
at org.apache.myfaces.trinidad.component.UIXCollection.processDecodes(UIXCollection.java:193)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$ApplyRequestValuesCallback.invokeContextCallback(LifecycleImpl.java:1113)
at org.apache.myfaces.trinidad.component.UIXCollection.invokeOnComponent(UIXCollection.java:1030)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:153)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:153)
at oracle.adf.view.rich.component.fragment.UIXPageTemplate.invokeOnComponent(UIXPageTemplate.java:208)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:664)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:303)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at edu.wisc.csa.web.ApplicationSessionExpiryFilter.doFilter(ApplicationSessionExpiryFilter.java:66)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at edu.wisc.csa.web.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:36)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:85)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:257)
at oracle.security.jps.wls.JpsWlsSubjectResolver.runJaasMode(JpsWlsSubjectResolver.java:250)
at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:100)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)OK I have tried Frank's suggestion about the 2 entries in the managed bean and it works but I cannot collapse my child node !
I have a Master-Detail-Detail setup.
In the Grandparent I have this :
RowKeySet rks = new RowKeySet(true);
table1.setDisclosureState(rks);
this.grandParentTable = table1;
and in my Parent table I have this :
RowKeySet rks = new RowKeySet(true);
table2.setDisclosureState(rks);
this.parentTable = table2;
ie the same.
In my child I have nothing just the default accessors.
The collapse works OK for the Grandparent but when I click Hide for the Parent it does not do anything - no error message either.
cheers -
Collapse All and Expand All functionality in Tree
Hi All,
I am using TreeByNestingTableColumn element to display the tree hierarchy .
Does anyone knows how to implement Collapse All and Expand All functionality for this tree (if someone have sample code for these functionality then it will be great for me) ?
Thanks in advance.
Ravi.Hello Ravindra Sahu,
Code for EXPAND ALL button:
*step 1:Access node
lo_nd_tree_hierarchy = wd_context->get_child_node( name = wd_this->wdctx_tree_hierarchy ).
*step2: Extract all the table entries from node which is binded to table
lo_nd_tree_hierarchy->get_static_attributes_table(
IMPORTING
table = lt_tree_hierarchy ).
*step3:set element attribute Expanded to abap_true
loop at lt_tree_hierarchy ASSIGNING <ls_tree_hierarchy>.
<ls_tree_hierarchy>-expanded = abap_true.
endloop.
*step4: Finally the updated data needs to be binded.
lo_nd_tree_hierarchy->bind_table( lt_tree_hierarchy ).
Code for COLLAPSE ALL button:
*step 1:Access node
lo_nd_tree_hierarchy = wd_context->get_child_node( name = wd_this->wdctx_tree_hierarchy ).
*step2: Extract all the table entries from node which is binded to table
lo_nd_tree_hierarchy->get_static_attributes_table(
IMPORTING
table = lt_tree_hierarchy ).
*step3:set element attribute Expanded to abap_true
loop at lt_tree_hierarchy ASSIGNING <ls_tree_hierarchy>.
<ls_tree_hierarchy>-expanded = abap_false.
endloop.
*step4: Finally the updated data needs to be binded.
lo_nd_tree_hierarchy->bind_table( lt_tree_hierarchy ).
Please don't forget giving REWARD points...:-)
Edited by: Bharath Komarapalem on Jul 11, 2008 9:17 AM -
Unable to expand child links in ALV Tree
Hi,
I have written the following code for ALV Tree using function modules.
REPORT ZSID_ALV_TREE.
type pool declarations for tree
TYPE-POOLS : fibs,stree.
tables: ekko.
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
it_ekpo TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
it_emptytab TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
wa_ekpo TYPE t_ekko.
DATA:w_repid type sy-cprog.
*Data declaration for additional node information
DATA : t_node TYPE snodetext.
*Internal table and wa decl for nodes
DATA : it_node LIKE TABLE OF t_node INITIAL SIZE 0,
wa_node LIKE t_node.
*Start of selection event
START-OF-SELECTION.
*Select the data for tree
PERFORM fetch_data.
*Build the hierarchy for tree
PERFORM build_hierarchy.
*Build Tree for display
PERFORM build_tree.
*& Form fetch_data
text
--> p1 text
<-- p2 text
FORM fetch_data .
SELECT ebeln
up to 10 rows
FROM ekko
INTO corresponding fields of TABLE it_ekko .
loop at it_ekko into wa_ekko.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
FROM ekpo
appending TABLE it_ekpo
where ebeln eq wa_ekko-ebeln.
endloop.
endform.
*& Form build_hierarchy
text
--> p1 text
<-- p2 text
FORM build_hierarchy .
*Building the nodes and hierarchy for tree
CLEAR : it_node[], wa_node.
wa_node-type = 'T'.
wa_node-name = 'Product Hierarchy Level'.
wa_node-tlevel = '01'.
wa_node-nlength = '35'.
wa_node-color = '4'.
wa_node-text = 'Test'.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
loop at it_ekpo into wa_ekpo.
wa_node-type = 'P'.
wa_node-name = 'Purchasing Doc'.
wa_node-tlevel = '02'.
wa_node-nlength = '25'.
wa_node-color = '4'.
wa_node-text = wa_ekpo-ebeln.
wa_node-tlength ='20'.
wa_node-tcolor = 3.
APPEND wa_node TO it_node.
CLEAR wa_node.
*Filling the values of internal table into tree
wa_node-type = 'P'.
wa_node-name = 'Material No'.
wa_node-tlevel = '03'.
wa_node-nlength = '20'.
wa_node-color = '1'.
wa_node-text = wa_ekpo-matnr.
wa_node-tlength ='20'.
wa_node-tcolor = 4.
APPEND wa_node TO it_node.
CLEAR wa_node.
ENDLOOP.
ENDFORM. " build_hierarchy
*& Form build_tree
text
--> p1 text
<-- p2 text
FORM build_tree .
*Fm for constructing the tree
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = it_node.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
w_repid = SY-CPROG.
*FM for displaying the tree
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
CALLBACK_PROGRAM = w_repid
CALLBACK_USER_COMMAND = 'USER1_COMMAND'
CALLBACK_TEXT_DISPLAY =
CALLBACK_MOREINFO_DISPLAY =
CALLBACK_COLOR_DISPLAY =
CALLBACK_TOP_OF_PAGE =
CALLBACK_GUI_STATUS =
CALLBACK_CONTEXT_MENU =
STATUS = 'IMPLICIT'
CHECK_DUPLICATE_NAME = '0'
COLOR_OF_NODE = '4'
COLOR_OF_MARK = '3'
COLOR_OF_LINK = '1'
COLOR_OF_MATCH = '5'
LOWER_CASE_SENSITIVE = 'X'
MODIFICATION_LOG = 'X'
NODE_LENGTH = 40
TEXT_LENGTH = 75
TEXT_LENGTH1 = 0
TEXT_LENGTH2 = 0
RETURN_MARKED_SUBTREE = 'X'
SCREEN_START_COLUMN = 0
SCREEN_START_LINE = 0
SCREEN_END_COLUMN = 0
SCREEN_END_LINE = 0
SUPPRESS_NODE_OUTPUT = 'X'
LAYOUT_MODE = ' '
USE_CONTROL = 'L'.
IMPORTING
F15 =
ENDFORM. " build_tree
FORM USER1_COMMAND TABLES node STRUCTURE seucomm
USING command
CHANGING value(exit)
VALUE(LIST_REFRESH).
write 'Hi'.
endform.
But I have a problem
1. I can expand the child links in tree structure when I comment the exporting parameter CALLBACK_USER_COMMAND in the function Module 'RS_TREE_LIST_DISPLAY'.
2 But when i uncomment the exporting parameter I am unable to expand the child links in output.
Please let me know if i have missed something in the code.
Useful answers will be rewarded
Regards,
SiddharthHi Sidhhart,
Check out this prog.
REPORT Z_KULDEEP_ALV_HIERARCHY
message-id zord
line-size 270.
Tables:
Vbap,
Vbak.
*& PROGRAM VARIABLES
type-pools slis.
*& INTERNAL TABLES & STRUCTURES
data:
begin of t_header occurs 0,
EXPCOL type c,
vbeln type vbak-vbeln,
audat type vbak-audat,
vkorg type vbak-vkorg,
vtweg type vbak-vtweg,
spart type vbak-spart,
end of t_header,
begin of t_item occurs 0,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
arktx type vbap-arktx,
pstyv type vbap-pstyv,
end of t_item,
t_fieldcat type standard table of slis_fieldcat_alv with header line,
t_event type standard table of slis_alv_event with header line,
x_keyinfo type slis_keyinfo_alv,
x_layout type slis_layout_alv,
x_variant like disvariant.
*& GLOBAL VARIABLES
data:
g_repid type sy-repid,
g_formname type slis_formname value 'TOP_OF_PAGE'.
*& SELECTION SCREEN *
selection-screen begin of block a with frame title text-000.
Select-options : s_date for vbak-audat obligatory.
p_date type vbak-audat.
selection-screen end of block a.
*& INITIALIZATION *
initialization.
clear : g_repid,t_header,t_item.
refresh : t_header,t_item.
g_repid = sy-repid.
*& AT SELECTION-SCREEN *
at selection-screen.
if s_date-high > sy-datum.
message e001.
endif.
start-of-selection.
select vbeln audat vkorg vtweg spart from vbak
into corresponding fields of table t_header
where audat in s_date.
select vbeln posnr matnr arktx pstyv from vbap
into table t_item
for all entries in t_header
where vbeln = t_header-vbeln.
end-of-selection.
perform sub_display_alv.
*& Form sub_display_alv
text
--> p1 text
<-- p2 text
form sub_display_alv.
*column 1
perform sub_populate_fieldcatalog using:
'VBELN' " field name
'T_HEADER' " table name
'ORDER' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 2
perform sub_populate_fieldcatalog using:
'AUDAT' " field name
'T_HEADER' " table name
'ORDERDATE' " column heading
'10' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 3
perform sub_populate_fieldcatalog using:
'VKORG' " field name
'T_HEADER' " table name
'SALES ORG' " column heading
'6' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 4
perform sub_populate_fieldcatalog using:
'VTWEG' " field name
'T_HEADER' " table name
'DIVISION' " column heading
'2' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 5
perform sub_populate_fieldcatalog using:
'SPART' " field name
'T_HEADER' " table name
'CHANNEL' " column heading
'4' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 6
perform sub_populate_fieldcatalog using:
'vbeln' " field name
'T_item' " table name
'Order' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 7
perform sub_populate_fieldcatalog using:
'POSNR' " field name
'T_ITEM' " table name
'SALES DOC.ITEM' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 8
perform sub_populate_fieldcatalog using:
'MATNR' " field name
'T_ITEM' " table name
'MATERIAL' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 9
perform sub_populate_fieldcatalog using:
'ARKTX' " field name
'T_ITEM' " table name
'SALES ORDER ITEM' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
*column 10
perform sub_populate_fieldcatalog using:
'PSTYV' " field name
'T_ITEM' " table name
'ITEM CATEGORY' " column heading
'8' " column width
' ' " fix column?
' ' " key
' ' " no display
' ' " sum this column
'X' " do not sum
' ' " input allowed?
' ' " currenct type field name
' ' " data type
'X'. " hotspot.
perform sub_assign_events.
Create a Layout for the ALV
perform sub_layout.
Define the key fields that links the header & item tables
perform sub_define_key.
dispaly list
perform sub_call_list_display.
endform. " sub_display_alv
*& Form sub_populate_fieldcatalog
text
-->P_G_FIELDCAT text
-->P_0198 text
-->P_0199 text
-->P_0200 text
-->P_0201 text
-->P_0202 text
-->P_0203 text
-->P_0204 text
-->P_0205 text
-->P_0206 text
-->P_0207 text
-->P_0208 text
-->P_0209 text
-->P_0210 text
-->P_0211 text
-->P_0212 text
-->P_0213 text
form sub_populate_fieldcatalog using
l_fieldname
l_tabname
l_column_heading
l_outputlen
l_fix_column
l_key
l_no_out
l_do_sum
l_no_sum
l_input
l_cfieldname
l_datatype
l_hotspot.
t_fieldcat-fieldname = l_fieldname.
t_fieldcat-tabname = l_tabname.
t_fieldcat-reptext_ddic = l_column_heading.
t_fieldcat-outputlen = l_outputlen.
t_fieldcat-fix_column = l_fix_column.
t_fieldcat-key = l_key.
t_fieldcat-no_out = l_no_out.
t_fieldcat-do_sum = l_do_sum.
t_fieldcat-no_sum = l_no_sum.
t_fieldcat-cfieldname = l_cfieldname.
t_fieldcat-datatype = l_datatype.
t_fieldcat-hotspot = l_hotspot.
append t_fieldcat.clear t_fieldcat.
endform. " sub_populate_fieldcatalog
*& Form sub_assign_events
text
--> p1 text
<-- p2 text
form sub_assign_events.
refresh t_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 1
importing
et_events = t_event[]
exceptions
list_type_wrong = 1
others = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Read the record for the top-of-page event
read table t_event with key slis_ev_top_of_page.
if sy-subrc = 0.
t_event-form = g_formname.
append t_event.
endif.
endform. " sub_assign_events
*& Form SUB_LAYOUT
text
--> p1 text
<-- p2 text
form sub_layout.
clear x_layout.
x_layout-f2code = 'QUOTE'.
x_layout-zebra = 'X'.
x_layout-expand_fieldname = 'EXPCOL'. " Field for expand/collapse
*Stat
x_layout-colwidth_optimize = 'X'.
x_layout-no_totalline = 'X'. " 0001+
endform. " SUB_LAYOUT
*& Form SUB_DEFINE_KEY
text
--> p1 text
<-- p2 text
form sub_define_key.
clear x_keyinfo.
x_keyinfo-header01 = 'VBELN'.
x_keyinfo-item01 = 'VBELN'.
endform. " SUB_DEFINE_KEY
form top_of_page.
write :/10 sy-datum, 20 sy-pagno, 30 sy-uname.
endform.
form sub_user_command using f_ucomm like sy-ucomm
f_selfield type slis_selfield.
if f_ucomm = 'QUOTE'.
if f_selfield-fieldname = 'VBELN'.
Set Parameter id 'AUN' field f_selfield-value.
call transaction 'VA03'.
endif.
endif.
endform.
*& Form sub_call_list_display
text
--> p1 text
<-- p2 text
form sub_call_list_display.
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_user_command = 'SUB_USER_COMMAND '
is_layout = x_layout
it_fieldcat = t_fieldcat[]
i_save = 'A'
it_events = t_event[]
i_tabname_header = 'T_HEADER'
i_tabname_item = 'T_ITEM'
is_keyinfo = x_keyinfo
tables
t_outtab_header = t_header[]
t_outtab_item = t_item[]
exceptions
program_error = 1
others = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " sub_call_list_display -
How to get the folder name of selected subitem in tree structure?
Hi All,
I created a tree structure like below.
->Folder1-- 1
2
3
->Folder2-----1
2
3
i.e i have two folders & each folder having the values like above.Now i want to perform some action by clicking on the any of the values.Suppose if i click value 2,i want to do some action.the actions need to perform is varies from floder to to folder.
So How can i get the folder name of clicked Value?
Regards,
RaviHi Kumar ,
the below code should help you.
Register the below action for the leaf node for which u need the subfolder's name above it.
Worked fine in my system ...hope it does in ur scenario too
method ONACTIONGET_PATH .
data : lr_element TYPE REF TO if_wd_context_element,
lr_node TYPE REF TO if_wd_context_node,
ls_path type string,
ls_path_node TYPE string,
lt_string type TABLE OF string,
l_lines type i,
l_lines_1 TYPE i.
lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
**-> getting the path of the node/leaf
*which u had clicked and from that getting the node above it
ls_path = lr_element->get_path( ).
SPLIT ls_path at '.' into table lt_string.
-> remove the first 2 entries as they will contain the view name
DELETE lt_string FROM 1 to 2.
l_lines = LINES( lt_String ).
l_lines_1 = l_lines - 1.
-> remove the last 2 entries as they will contain the element in the path
DELETE lt_string from l_lines_1 to l_lines.
LOOP AT lt_string into ls_path.
CONCATENATE LINES OF LT_STRING into ls_path_node SEPARATED BY '.'.
ENDLOOP.
**-> getting access to the node above the leaf element
LR_NODE = WD_CONTEXT->PATH_GET_NODE( path = ls_path_node ).
lr_element = lr_node->get_element( ).
**-> Getting the name of the folder...
*here path is the attribute in my context which stores the name of the folder
lr_element->get_attribute( EXPORTING name = 'PATH' IMPORTING value = ls_path ).
endmethod. -
Creating a Tree structure in WDP(ABAP)
Hi All,
Is it possible to create a Tree structure in dynpro(abap)?hi urbashi..........
check out this link.......
it gives details of all tutorials.
tutorials for tree structure is also available.
[link|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d]
---regards,
alex b justin -
How to change the node's icon in a tree when the node collapse or expand?
how to change the node's icon in a tree when the node collapse or expand?
Hi,
You may need to use custom skin for that.
-Arun -
How to make the APEX tree in the "Expand All" shape by default?
Could anybody please enlighten me on how to make the APEX tree in the "Expand All" shape by default please? I created an APEX tree and by default it's in the "Collapse All" shape. I am using APEX 4.1.0.00.21
Hi,
you can check the view source of html and check the onclick code written on that plus sign(Expand All), just copy that onclick javascript code and put it on page javascript event.
Thanks,
Jaydip Bosamiya
+91-76000 23053
http://jbosamiya.blogspot.com -
Dynamic tree structure (expand/collapse)
i want to do one tree struc example (expand /collapse)
using xml;
like
WOrld
|
|
----INDIA
|
-------Andhrapradesh
|
|
-----------------Hyderabad
| | | Visakhapatnam
Karnataka
|
|
Tamilnadu
America
|
Australia
in the frame at left side tree structure will be there ;when i click world hyperlink and at the right side one forum will come like this;
country name ---------
description ---------
when i enter america and enter submit;the country should come in the left frame;i will refresh left frame when click submit;ofcourse i know that;like wise when i click state hyperlink
state name ---------
description ---------
statename should come under state tree node;
i will also maintain this info in database also;i am using oracle9i;how can i do this the tree structure;how to approach;if anybody give me any links revelant to this?atleast give me some idea what to do?please dont give me the DOM tutorial or SAX Tutorial cos i already gone through but i didnt get any idea.
bye
chaitanyaInitailly set xerces.jar (parser, freeware download from apache site) to calss path
Suppose
<WORLD>
<INDIA>
<ANDHRA>abc</ANDHRA>
<VISHAKHA>fsdfd</VISHAKHA>
<UP>dss</UP>
</INDIA>
<USA>
<FLORIADA>bsbs</FLORIADA>
<NEWYORK>dsds</NEWYORK>
</USA>
</WORLD>
try{
dbf = DocumentBuilderFactory.newInstance();
db = dbf.newDocumentBuilder();
mapDocument = db.newDocument();
Element worldElement = mapDocument.createElement("WORLD");
Element indiaElement = mapDocument.createElement("INDIA");
Element andhraElement = mapDocument.createElement("ANDHRA");
andhraElement.appendChild(mapDocument.createTextNode("sdsd");
Element vishakhaElement = mapDocument.createElement("VISHKHA");
vishkhaElement.appendChild(mapDocument.createTextNode("sdfdf");
Element upElement = mapDocument.createElement("UP");
upElement.appendChild(mapDocument.createTextNode("fsfs");
indiaElement.appendChild(andhraElement)
.appendChild(vishkhaElement)
.appendChild(upYElement)
//lly do for usaELement
//finally add indiaElemebnt and usaElement to worldElement
worldElement.appendChild(indiaElement)
.appendChild(usaElement)
mapDocument.appendChild(worldElement);
}catch(FactoryConfigurationError fce){
fce.printStackTrace();
}catch(ParserConfigurationException pce){
pce.printStackTrace();
I think this u need -
How to remove Expand All in view menu of tree table
Hi,
I want to remove Expand All in view menu of tree table. How to do that?
Regards,
Raghu.I am having the exact same problem.
However, I believe that displaying large amount of data via a tree table is fine as the user is able to quickly drill in to the data of interest.
It is just that the 'Expand All' option (as implemented) does not make sense in my case.
Given that I cannot hide it, is there an easy way to change it's behavior so that it does nothing (or provide an 'No implemented' alert).
I don't have the time/experience to implement custom menu items.
Thanks -
Tree error, after Expand All, then collapsing any node, ORA-6502/6512
Has anyone seen this problem with the Tree?
Normal Tree mode works great, can expand and collapse nodes with no problem.
I can Expand All, Collapse All, and Reset Tree without problems.
However, if I select Expand All, and then try to collapse any node, I get this error.
Unexpected error ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1
My database is 9.2.0.4, and there are 1,138 records in my tree table, with id NUMBER(8), pid NUMBER(8), and name VARCHAR2(100).
my tree query is:
select "ID" id,
"PID" pid,
"NAME" name,
'f?p=150:2:&SESSION.::NO::P2_PARAM_ID:'||"ID" link,
null a1,
null a2
from "#OWNER#"."PARAM_TREE"
order by 3
My root tree query is:select "ID" id, "PID" pid, "NAME" name, null link, null a1, null a2 from "#OWNER#"."PARAM_TREE" where id=0
I checked the link to collapse, it was the same in normal mode or Expand All:http://umbriel.xxx.com:7777/pls/EDIWS_GUI_DEV/f?p=150:1:9757663040679228582:CONTRACT,69
Any ideas, I searched in the forum, saw something on 9.2.0.6 that sounded similar, but it was specific to 9.2.0.6, not 9.2.0.4..
Thanks, JoeHi all,
I have created a tree with over 20000 entries but I dont know how many nodes there are. I am using APEX 3.0.1.
Whenever EXPAND ALL ist pressed I am getting this error:
Unexpected error ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
I am also using DIV together with javascript in the tree region so that the selected node is always on top of the page.
like you mentioned. Does this seem like a bug too you?
Regards,
Denise -
UIX Tree: "Expand All" Functionality
Hello,
I have a question about the Tree in UIX. We are using the Tree component in a UIX Page (JDeveloper 10.1.2). With the tree we also make use of the ClientStateTreeDataProxy class.
It is possible to expand and collapse the tree, but I want to have 1 button to be able to expand all nodes on the first level of the tree or if this isn't possible to expand all the nodes.
I have try to simulate this using struts actions, but I'm unable to simulate the state request-parameter. I also try to look if something is possible with the ClientStateTreeDataProxy class. Which possibilities are there to manipulate the tree component?
Thanks, DennisThanx Jeanne,
You brought me on a idea with the UIX Developer's Guide and EXPANDABLE_EXPANDED value.
I couldn't figure out how the expand property was filled, because it wasn't done in the ADF BC ViewObject. We have a Utility class that creates a DataObject from the ViewObject Data and here the expand property was set.
Now it was easy to build a ExpandAll option. It is possible to access the HttpServletRequest object were the DataObject is created. By setting a attribute in the request I could react on that and give the expand property indeed the value EXPANDABLE_EXPANDED.
Dennis -
Bdc_OkCode Tree Expand All
Hi EveryBody,
I urge trees on a screen using a BDC.
But Three is coming off.
How can we open all in BDC ?
Best Regards,
Rasim BASCH.Thank you Felipe,
But, No, transection is not standard.
I created a transection own.
I have a screen, working in the tree structure.
When you click to another alv I'm calling it.
But coming off the tree.
I want all of you to come open.
Regards...
Maybe you are looking for
-
Link up b/w MKPF,MSEG and RBKP,RSEG
Hi, I am working on a report in which i have to make up a link b/w above mentioned tanles. till now i am able to make link between MSEG and MKPF but the problem is that when i go for the RBKP and Rseg it gives a bit problem as RBKP is a Header Table
-
I think that is enough details to start with.
-
Texas Instrument​s position in Bangalore, India, JOB OPENING
TEXAS INSTRUMENTS, Bangalore is looking for a LabVIEW (3+ years) and TestStand (1+ years) programmer. Our section has developed a LabVIEW/TestStand based automated characterization environment to test complex 2.5 and 3.0G cell phone and other wireles
-
Preference for Roles selection in EP Content
Hi All, When one will open the portal page, the default role selected is the first one. I need to set the default role other than the first one. Can anyone tell me the setting to be done for the same? Points will be rewarded. thanks & regards, Ran
-
All my programs from Adobe CS5 stop working, I'm not able to open, try to reinstal and does not work. all mac updates done. Imac with Maverick. Please help me signing for Adobe CC is not in question....