Event Handling in Tree structure
Hi all,
I have created an alv tree structure using the FM's 'RS_TREE_CONSTRUCT' and 'RS_TREE_LIST_DISPLAY'. Can anyone tell me how to handle double-click event with these FM's. My requirement is that i should display the tree structure of the Materials from Raw material till Finished materials and i have done that. After that, when i select one of these materials (Either double-click or provide some icon for each item and select that icon), i should be able to call an existing report with the data of the line selected.
Any help will be greatly appreciable.
thanks and regards,
Raja Sekhar.
Hi Raja..
This post was from long back..
And today i have same requirement.. So could you tell me that what you have done for this...
Thanks in Advace
Similar Messages
-
Event Handling for tree structure using "CL_GUI_ALV_TREE_SIMPLE"
Hi,
I have created a tree structure using class CL_GUI_ALV_TREE_SIMPLE.
Now I wanted to insert a check and give message when the user opens the last node in my structure.
I checked the events available in the class , but there in none which gets trigered when we try to open a node.
Please guide me with this scenario.
Thanks & Regards,
Omkar M.Hello Omkar
The solution is somewhat odd but apparently works. As sample report please check BCALV_TREE_SIMPLE_DEMO.
Copy this report and make the following changes:
class lcl_tree_event_receiver definition.
public section.
methods:
on_expand_no_children " new event handler method
for event expand_no_children of cl_gui_column_tree
importing NODE_KEY, " class = CL_GUI_COLUMN_TREE !!!
on_add_hierarchy_node
for event on_add_hierarchy_node of cl_gui_alv_tree_simple
importing grouplevel
index_outtab.
endclass.
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD on_expand_no_children.
BREAK-POINT.
ENDMETHOD. "on_expand_no_children
FORM register_events.
* define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
* define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
APPEND l_event TO lt_events.
CALL METHOD tree1->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
* set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->on_add_hierarchy_node
FOR tree1. " CL_GUI_ALV_TREE_SIMPLE
SET HANDLER l_event_receiver->on_expand_no_children
FOR ALL INSTANCES. " CL_GUI_COLUMN_TREE !!!
ENDFORM. " register_events
As soon as you open a node in the ALV tree the report will stop at the break-point.
Now you need to check if there are still children nodes to be displayed.
If not then trigger your special coding.
Regards
Uwe -
Action Event Handler on Tree nodes
I have an actionListener event handler registered on a tree node as follows:
<af:tree value="#{bindings.SomeViewObj1.treeModel}" var="node" rowSelection="none" id="t1"
binding="#{EditFormBean.tree1}" displayRow="selected" summary="Tree"
partialTriggers=":::cb1 :::cb2">
<f:facet name="nodeStamp">
<af:panelGroupLayout id="pgl3">
<af:outputText value="#{node}" id="ot1"/>
<af:commandImageLink text="E" id="cil3" partialSubmit="true"
*actionListener="#{EditFormBean.onEdit}"* binding="#{EditFormBean.cmdImageLink}">
<af:setPropertyListener from="#{node.hiertType.structureDefName}" type="action"
to="#{viewScope.formView}"/>
<f:attribute name="node" value="#{node}"/>
</af:commandImageLink>
<af:commandImageLink text="A" id="cil1"/>
<af:commandImageLink text="D" id="cil2"/>
</af:panelGroupLayout>
</f:facet>
</af:tree>
I have at each node stamp facet a panelGroup Layout that contains the node value and a command Image link. The tree has two hierarchical levels. When I press the command Image link on the first tree noe level, the actioListener method in teh managed bean (EditFormBean.onEdit) gets called. When I press the same commandImage link on the second tree level, the same action listener does not get called. I need to get past this problem before I code the actionListener which needs to set the current row in the iterator based on the key selected on the tree node. I simply have a print statement in the action listener method which shows something when the first level command image link is clicked but does not print anything when the second level command image link is clicked.
I am using JDeveloper 11.1.2.1.0
There is also adf faces code around this snippet that uses an af:switcher facea component to display the appropriate form based on the nodee level in which the comman d image link is clicled but it is irrelevant to the problem I am getting.
Any help on that would be appreciatedHi,
hard to say . Didn't see this before. Can yoiu remove "binding="#{EditFormBean.cmdImageLink}"" from the command link. The tree stamps its children so that it doesn't make sense to keep a handle to the component instance
Frank -
Hi All,
I amd currently developing an ALV tree program to capture the hierarchy of functional location. I managed to display the hierarchy in ALV Tree using cl_gui_column_tree.
Now, i am working on double clicking the functional location and it will bring me to tcode IL03. But, it seems like i cannot capture of the field value clicked. Below are my source code. Can anyone pls help me on this? Thank you very much
*& Form register_events
text
--> p1 text
<-- p2 text
FORM register_events .
Define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
CALL METHOD gd_tree->get_registered_events
IMPORTING
events = lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
l_event-appl_event = 'X'.
APPEND l_event TO lt_events.
CALL METHOD gd_tree->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'.
ENDIF.
Set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->handle_item_double_click FOR gd_tree.
ENDFORM. " register_events
CLASS lcl_tree_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_item_double_click
FOR EVENT item_double_click OF cl_gui_alv_tree
IMPORTING node_key
fieldname.
ENDCLASS. "lcl_tree_event_receiver DEFINITION
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD handle_item_double_click.
DATA: lt_selected_nodes TYPE lvc_nkey,
lt_fieldname TYPE lvc_fname.
Determine which line is selected
CALL METHOD gd_tree->get_selected_item
IMPORTING
e_selected_node = lt_selected_nodes
e_fieldname = lt_fieldname.
CALL METHOD cl_gui_cfw=>flush.
SET PARAMETER ID 'IFL' FIELD lt_fieldname.
SET PARAMETER ID 'ISR' FIELD 'MOB01'.
CALL TRANSACTION 'IL03' AND SKIP FIRST SCREEN.
ENDMETHOD. "handle_item_double_click
ENDCLASS. "lcl_tree_event_receiver IMPLEMENTATIONHello Goh
Based on your coding you are using CL_GUI_ALV_TREE instead of CL_GUI_COLUMN_TREE.
Calling method get_selected_item within your event handler method is unnecessary because these data are already provided by the event interface.
[code]METHOD handle_item_double_click.
DATA: lt_selected_nodes TYPE lvc_nkey,
lt_fieldname TYPE lvc_fname.
*$Comment: unnecessary because these data are already provided
by the event interface (IMPORTING nodekey fieldname).
Determine which line is selected
**CALL METHOD gd_tree->get_selected_item
**IMPORTING
**e_selected_node = lt_selected_nodes
**e_fieldname = lt_fieldname.
ENDMETHOD. "handle_item_double_click[/code]
The following sample is based in report BCALV_TREE_04 but can be simply applied to your application:
[code] METHOD handle_item_double_click.
define local data
DATA:
ls_outtab TYPE sflight.
FIELD-SYMBOLS:
<ld_fld> TYPE ANY.
Call this method to get the values of the selected tree line
CALL METHOD g_alv_tree->get_outtab_line
EXPORTING
i_node_key = node_key
IMPORTING
e_outtab_line = ls_outtab
E_NODE_TEXT =
et_item_layout =
ES_NODE_LAYOUT =
EXCEPTIONS
node_not_found = 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.
ASSIGN COMPONENT fieldname OF STRUCTURE ls_outtab TO <ld_fld>.
IF ( <ld_fld> IS ASSIGNED ).
... Call transaction with selected (item) value.
ENDIF.
ENDMETHOD. "handle_item_double_click[/code]
The ASSIGN statement will work if no item of the hierarchy part is selected.
Regards
Uwe -
How to handle check box events in alv tree.
hi,
i am working in CL_GUI_COLUMN_TREE class.Also using Check box. Now i want to handle events for check box . I am new to ABAP Objects.
Pls expaline in detail or send code
thanks in advance,
senthil kumar.rHello Senthil
Have a look at the sample report
SAPCOLUMN_TREE_CONTROL_DEMO
. The crucial points are:
<b>(1) Register the required events at the control</b>
* define the events which will be passed to the backend
" checkbox change
event-eventid = CL_GUI_COLUMN_TREE=>EVENTID_checkbox_change.
event-appl_event = 'X'.
append event to events.
CALL METHOD G_TREE->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = EVENTS
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
<b>(2) Set the event handler</b>
assign event handlers in the application class to each desired event
SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR g_tree.
<b>(3) Define and implement event handler method</b>
METHOD HANDLE_CHECKBOX_CHANGE.
" this method handles the checkbox_change event of the tree
" control instance
" show the key of the node and the name of the item
" of the clicked checkbox in a dynpro field
G_EVENT = 'CHECKBOX_CHANGE'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ITEM_NAME.
CLEAR G_HEADER_NAME.
ENDMETHOD.
Regards
Uwe -
Event handler for disclosureopenicon in tree in flex 4
hi all,
Is it possible to write event handler to disclosureopenicon for tree control in flex?
if its possible means, h w can i write?Hi Ananth,
You can do this by firing a Navigation event for Opening and closing of these tree nodes.
Cheers,
Jeevan -
Tutorial on Event handling structure in labview
Hello,
can some one suggest a tutorial on event handling? I want to understand about the adavanced feature of the event handling structure like the dynamic even handling. Further is there any tutorial and examples using the user defined even handling function?
Regards
GopalHi,
Thank you for those links. I would also like to know about the event menu in labview.Which has functions like create user event, register user events etc., further in event structure there is an option called show dynamic event terminal. what is its purpose and when and where should it be used?
Regards
Gopal -
Question on program structure about event handling in nested JPanels in GUI
Hi All,
I'm currently writing a GUI app with a wizard included in the app. I have one class that acts as a template for each of the panels in the wizard. That class contains a JPanel called contentsPanel that I intend to put the specific contents into. I also want the panel contents to be modular so I have a couple of classes for different things, e.g. name and address panel, etc. these panels will contain checkboxes and the like that I want to event listeneres to watch out for. Whats the best way of implementing event handling for panel within panel structure? E.g for the the checkbox example,would it be a good idea to have an accessor method that returns the check book object from the innerclass/panel and use an addListener() method on the returned object in the top level class/panel. Or is it better to have the event listeners for those objects in the same class? I would appreciate some insight into this?
Regards!MyMainClass.main(new String[] { "the", "arguments" });
// or, if you defined your main to use varags (i.e. as "public static void main(String... args)") then you can just use
MyMainClass.main("the", "arguments");But you should really extract your functionality out of the main method into meaningful classes and methods and just use those from both your console code and your GUI code. -
F4 Help for Training Event -Tree structure like in PSV2
Hi,
There is any function module to give the F4 help in custome development for Training Event like Tree structure in PSV2.Check AL S's response here for how to do this. CVI 6.0 does not have a native Tree control. This was introduced with CVI 7.0.
Bilal Durrani
NI -
Tree's DragSource changes at DragDrop event handler?
I try to drag a node A into node B. When the DragDrop event
handler is called, the dragSource is changed to the drop source?
I have declared the following:
<mx:Tree ......... dragDrop="OnDragDrop(event)"....../>
In the function:
private function OnDragDrop( event:DragEvent ):void
var ds:DragSource = event.dragSource;
items = new XML( ds.dataForFormat("treeItems")[0] );
I was expecting the "items" has a copy of the dragged item
(node A). However, it has all the drop node's info (node B). How do
I get teh drag and drop nodes in this event?
P.S. I am trying to drag and drop at the same tree control.
Could that be why? Is it suppose to be like this? Or, its a bug?
-AlanRegarding your button look and feel issue, the easiest thing to do would be to copy the button template you are using for the template-based buttons and modify that to add in your onClick handlers.
The builtin button template for the theme I am using (Theme 12) looks like this
<table class="t10Button" cellspacing="0" cellpadding="0" border="0" summary="">
<tr>
<td class="t10L"><img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /></td>
<td class="t10C">#LABEL#</td>
<td class="t10R"><img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /></td>
</tr>
</table>In other words, each button is rendered in its own HTML table.
Copy this button template, call it mybutton and have it look like
<table class="t10Button" cellspacing="0" cellpadding="0" border="0" summary="">
<tr>
<td class="t10L"><img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /></td>
<td class="t10C">#LABEL#</td>
<td class="t10R"><img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /></td>
</tr>
</table>Notice that I put a no-op in the href tag for the button and added a onClick handler that will do the real work. In your case, you would use the URL Redirect on the Button attributes page to call your SavePage() function. Since the onClick is called before the href, it should (hopefully) do what you are looking for.
I put up these changes at
http://htmldb.oracle.com/pls/otn/f?p=24317:26
Do let us know.
Thanks -
How to handle Tree structure in bdc
Hi Experts,
How to handle Tree structure in bdc, can any one have any idea regarding this.
In the top most of the tree i have : Occupational Health under that Identification is there .
Occupational Health
Identification
Regards,
Sudhakar Reddy.AHi Experts,
Thanks Parvatha reddy for your reply.
Can any one provide BAPI for this T.Code EHSQCATOH or can any one tell me how to handle Tree structure .
Regards,
Sudhakar Reddy .A -
JDEV 10.1.2 UIX Tree Event Handler
Hi,
I have built my tree bound to two ADF entities/views.
It works fine in a small standalone application, but as soon as I try to integrate it with my main app it fails to call either the "null" or the "expand" event handler (null for page rendering and expand for... well expanding the node (see below))
I've run it in debug and the event code just isn't getting fired
There must be something in my main app that is intercepting the event handler before it gets to my uix handlers.
New to all this so any help greatly appreciated!
In summary, what would intercept default event handling in a uix page.
Thanks
Mark
<handlers>
<event name="expand">
<method class="view.TreeUtils" method="doTreeEvent"/>
</event>
<event name="null">
<method class="view.TreeUtils" method="doTreeEvent"/>
</event>
</handlers>Hi,
it appears that if I change the forward to have 'redirect="true"' within the struts config file then this works fine now.
Mark -
Hi,
I had a Tlayout.In that the left view is a Tree. When I clicked a particular element in the Tree on the left View I want the details of it to be displayed in the right View. What is the code for handling the click event of a tree and load a view corresponding to the clicked element and display it in right view.
Thanks in Advance
Safeer.IError Summary
While processing the current request, an exception occured which could not be handled by the application or the framework.
If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
Root Cause
The initial exception that caused the request to fail, was:
java.lang.NullPointerException
at hbs.saf.TreeTut1View.wdDoModifyView(TreeTut1View.java:234)
at hbs.saf.wdp.InternalTreeTut1View.wdDoModifyView(InternalTreeTut1View.java:220)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:308)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)
... 27 more
See full exception chain for details.
System Environment
Client
Web Dynpro Client Type HTML Client
User agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Version null
DOM version null
Client Type msie6
Client Type Profile ie6
ActiveX enabled
Cookies enabled
Frames enabled
Java Applets enabled
JavaScript enabled
Tables enabled
VB Script enabled
Server
Web Dynpro Runtime Vendor: SAP, build ID: 7.0007.20060331081328.0000 (release=645_VAL_REL, buildtime=2006-03-31:06:24:04[UTC], changelist=396896, host=pwdfm101), build date: Wed Mar 28 16:13:15 GMT+05:30 2007
J2EE Engine No information available
Java VM Java HotSpot(TM) Server VM, version:1.4.2_12-b03, vendor: Sun Microsystems Inc.
Operating system Windows 2003, version: 5.2, architecture: x86
Session & Other
Session Locale en_US
Time of Failure Tue Jul 31 11:10:50 GMT+05:30 2007 (Java Time: 1185860450203)
Web Dynpro Code Generation Infos
local/TreeTut1
SapDictionaryGenerationCore 7.0009.20060802115015.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:24:21[UTC], changelist=413123, host=PWDFM101.wdf.sap.corp)
SapDictionaryGenerationTemplates (unknown)
SapGenerationFrameworkCore 7.0009.20060719095755.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:12:57[UTC], changelist=411255, host=PWDFM101.wdf.sap.corp)
SapIdeWebDynproCheckLayer 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:00[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)
SapMetamodelCommon 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:46[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)
SapMetamodelCore 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:38[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)
SapMetamodelDictionary 7.0009.20060719095619.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:21:59[UTC], changelist=411251, host=PWDFM101.wdf.sap.corp)
SapMetamodelWebDynpro 7.0009.20060428190938.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:26:52[UTC], changelist=400815, host=PWDFM101.wdf.sap.corp)
SapWebDynproGenerationCTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)
SapWebDynproGenerationCore 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:11[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)
SapWebDynproGenerationTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)
sap.com/tcwddispwda
No information available null
sap.com/tcwdcorecomp
No information available null
Detailed Error Information
Detailed Exception Chain
java.lang.NullPointerException
at hbs.saf.TreeTut1View.wdDoModifyView(TreeTut1View.java:234)
at hbs.saf.wdp.InternalTreeTut1View.wdDoModifyView(InternalTreeTut1View.java:220)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:308)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:330)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:297)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:706)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:660)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:228)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:56)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) -
How to get Text for nodes in Tree Structure
Hi Friends,
How to get Text for nodes in Tree Structure
REPORT YFIIN_REP_TREE_STRUCTURE no standard page heading.
I N I T I A L I Z A T I O N
INITIALIZATION.
AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
ID 'YFIINICD' FIELD SY-TCODE.
IF SY-SUBRC NE 0.
MESSAGE I000(yFI02) with SY-TCODE .
LEAVE PROGRAM.
ENDIF.
class screen_init definition create private.
Public section
public section.
class-methods init_screen.
methods constructor.
Private section
private section.
data: container1 type ref to cl_gui_custom_container,
container2 type ref to cl_gui_custom_container,
tree type ref to cl_gui_simple_tree.
methods: fill_tree.
endclass.
Class for Handling Events
class screen_handler definition.
Public section
public section.
methods: constructor importing container
type ref to cl_gui_custom_container,
handle_node_double_click
for event node_double_click
of cl_gui_simple_tree
importing node_key .
Private section
private section.
endclass.
*& Classes implementation
class screen_init implementation.
*& Method INIT_SCREEN
method init_screen.
data screen type ref to screen_init.
create object screen.
endmethod.
*& Method CONSTRUCTOR
method constructor.
data: events type cntl_simple_events,
event like line of events,
event_handler type ref to screen_handler.
create object: container1 exporting container_name = 'CUSTOM_1',
tree exporting parent = container1
node_selection_mode =
cl_gui_simple_tree=>node_sel_mode_multiple.
create object: container2 exporting container_name = 'CUSTOM_2',
event_handler exporting container = container2.
event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
event-appl_event = ' '. "system event, does not trigger PAI
append event to events.
call method tree->set_registered_events
exporting events = events.
set handler event_handler->handle_node_double_click for tree.
call method: me->fill_tree.
endmethod.
*& Method FILL_TREE
method fill_tree.
data: node_table type table of abdemonode,
node type abdemonode.
types: begin of tree_node,
folder(50) type c,
tcode(60) type c,
tcode1(60) type c,
tcode2(60) type c,
text(60) type c,
text1(60) type c,
text2(60) type c,
end of tree_node.
data: wa_tree_node type tree_node,
t_tree_node type table of tree_node.
wa_tree_node-folder = text-001.
wa_tree_node-tcode = text-002.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-003.
wa_tree_node-text1 = 'GR/IR aging'.
wa_tree_node-tcode2 = text-004.
wa_tree_node-text2 = 'Bank Balance'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-005.
wa_tree_node-tcode = text-006.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-007.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-008.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
wa_tree_node-folder = text-009.
wa_tree_node-tcode = text-010.
wa_tree_node-text = 'Creditors ageing'.
wa_tree_node-tcode1 = text-011.
wa_tree_node-text1 = 'Creditors ageing'.
wa_tree_node-tcode2 = text-012.
wa_tree_node-text2 = 'Creditors ageing'.
append wa_tree_node to t_tree_node.
clear wa_tree_node .
node-hidden = ' '. " All nodes are visible,
node-disabled = ' '. " selectable,
node-isfolder = 'X'. " a folder,
node-expander = ' '. " have no '+' sign forexpansion.
loop at t_tree_node into wa_tree_node.
at new folder.
node-isfolder = 'X'. " a folder,
node-node_key = wa_tree_node-folder.
clear node-relatkey.
clear node-relatship.
node-text = wa_tree_node-folder.
node-n_image = ' '.
node-exp_image = ' '.
append node to node_table.
endat.
at new tcode .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode.
node-text = wa_tree_node-text .
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
endat.
append node to node_table.
at new tcode1 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode1.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text1.
endat.
append node to node_table.
at new tcode2 .
node-isfolder = ' '. " a folder,
node-n_image = '@CS@'. "AV is the internal code
node-exp_image = '@CS@'. "for an airplane icon
node-node_key = wa_tree_node-tcode2.
node-relatkey = wa_tree_node-folder.
node-relatship = cl_gui_simple_tree=>relat_last_child.
node-text = wa_tree_node-text2.
endat.
append node to node_table.
endloop.
call method tree->add_nodes
exporting table_structure_name = 'ABDEMONODE'
node_table = node_table.
endmethod.
endclass.
*& Class implementation
class screen_handler implementation.
*& Method CONSTRUCTOR
method constructor.
create object: HTML_VIEWER exporting PARENT = CONTAINER,
LIST_VIEWER exporting I_PARENT = CONTAINER.
endmethod.
*& Method HANDLE_NODE_DOUBLE_CLICK
method handle_node_double_click.
case node_key(12).
when 'Creditors'.
submit YFIIN_REP_CREADITORS_AGING via selection-screen and return.
when 'Vendor'.
submit YFIIN_REP_VENDOR_OUTSTANDING via selection-screen and return.
when 'Customer'.
submit YFIIN_REP_CUSTOMER_OUTSTANDING via selection-screen and
return.
when 'GR/IR'.
submit YFIIN_REP_GRIR_AGING via selection-screen and return.
when 'Acc_Doc_List'.
submit YFIIN_REP_ACCOUNTINGDOCLIST via selection-screen and return.
when 'Bank Bal'.
submit YFIIN_REP_BANKBALANCE via selection-screen and return.
when 'Ven_Cus_Dtl'.
submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
when 'G/L_Open_Bal'.
submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
when 'Usr_Authn'.
submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
endcase.
endmethod.
endclass.
Program execution ************************************************
load-of-program.
call screen 9001.
at selection-screen.
Dialog Modules PBO
*& Module STATUS_9001 OUTPUT
text
module status_9001 output.
set pf-status 'SCREEN_9001'.
set titlebar 'TIT_9001'.
call method screen_init=>init_screen.
endmodule. " STATUS_9001 OUTPUT
Dialog Modules PAI
*& Module USER_COMMAND_9001 INPUT
text
module user_command_9001 input.
endmodule. " USER_COMMAND_9001 INPUT
*& Module exit_9001 INPUT
text
module exit_9001 input.
case sy-ucomm.
when 'EXIT'.
set screen 0.
endcase.
endmodule.
exit_9001 INPUTyou can read the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
Regards,
Gopi .
Reward points if helpfull. -
I have found function modules RS_TREE_CONSTRUCT and rs_tree_list_display
but they enable me in having only 1 line at one level of the heirarchy , my requirement is to have multiple lines at one level of the tree.
I have found a function module TREEV_CREATE_LIST_TREE which i can not figure out how to use . Any help from the experts ?hi,
check the below example of a list tree which is expandable and collapsable,
CLASS LCL_EVT_HDLR DEFINITION DEFERRED. " definition is given later
CLASS CL_GUI_CFW DEFINITION LOAD. " global class to be loaded
DATA:G_EVENT(50), " to hold the event
G_NODE_KEY TYPE TV_NODEKEY, "holds the node key
G_ITEM_NAME TYPE TV_ITMNAME,
G_KEY TYPE TV_ITMNAME,
G_CHECK TYPE AS4FLAG.
DATA:G_EVT_HDLR TYPE REF TO LCL_EVT_HDLR, "reference variable to the
"class implemented
G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
G_TREE TYPE REF TO CL_GUI_LIST_TREE,
G_OK_CODE TYPE SY-UCOMM.
TYPES:ITEM_TABLE_TYPE LIKE STANDARD TABLE OF MTREEITM
WITH DEFAULT KEY.
TABLES:MARA.
SELECTION-SCREEN BEGIN OF SCREEN 123.
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECTION-SCREEN END OF SCREEN 123.
SELECTION-SCREEN BEGIN OF SCREEN 200.
SELECT-OPTIONS:S_ERNAM FOR MARA-ERNAM.
SELECTION-SCREEN END OF SCREEN 200.
CLASS lcl_evt_hdlr DEFINITION
CLASS LCL_EVT_HDLR DEFINITION.
PUBLIC SECTION.
METHODS:
*---- methods for action handling for nodes
NODE_DBL_CLK
FOR EVENT NODE_DOUBLE_CLICK
OF CL_GUI_LIST_TREE
IMPORTING NODE_KEY,
HANDLE_NODE_KEY_PRESS
FOR EVENT NODE_KEYPRESS
OF CL_GUI_LIST_TREE
IMPORTING NODE_KEY KEY,
*---- methods for action handling for Items
ITEM_DBL_CLK
FOR EVENT ITEM_DOUBLE_CLICK
OF CL_GUI_LIST_TREE
IMPORTING NODE_KEY ITEM_NAME,
HANDLE_ITEM_KEY_PRESS
FOR EVENT ITEM_KEYPRESS
OF CL_GUI_LIST_TREE
IMPORTING NODE_KEY ITEM_NAME KEY,
*---- other methods for action handling
HANDLE_EXPAND_NO_CHILDREN
FOR EVENT EXPAND_NO_CHILDREN
OF CL_GUI_LIST_TREE
IMPORTING NODE_KEY.
HANDLE_CHECKBOX
FOR EVENT CHECKBOX_CHANGE
OF CL_GUI_LIST_TREE
IMPORTING NODE_KEY ITEM_NAME CHECKED.
ENDCLASS. "lcl_evt_hdlr DEFINITION
CLASS lcl_evt_hdlr IMPLEMENTATION
CLASS LCL_EVT_HDLR IMPLEMENTATION.
METHOD NODE_DBL_CLK.
this method handles the node double click event of the tree control
and shows the key of the double clicked node in a dynpro field
G_EVENT = 'NODE_DOUBLE_CLICK'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ' '.
CASE NODE_KEY.
WHEN 'Root'.
*call transaction 'VA03'.
*CALL FUNCTION 'ZFUNC_SCREEN'
EXPORTING
PRG_NAME = 'ybasic3'.
CALL METHOD G_CUSTOM_CONTAINER->LINK
EXPORTING
REPID = SY-REPID
DYNNR = '0123'.
CALL SELECTION-SCREEN 123.
case sy-ucomm.
when 'BACK'.
LEAVE PROGRAM.
endcase.
WHEN 'Child1'.
CALL METHOD G_CUSTOM_CONTAINER->LINK
EXPORTING
REPID = SY-REPID
DYNNR = '0200'.
CALL SELECTION-SCREEN 200.
LEAVE PROGRAM.
ENDCASE.
ENDMETHOD. "node_dbl_clk
METHOD ITEM_DBL_CLK.
G_EVENT = 'ITEM_DOUBLE_CLICK'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ITEM_NAME.
ENDMETHOD. "ITEM_DBL_CLK
METHOD HANDLE_NODE_KEY_PRESS.
G_EVENT = 'NODE_KEYPRESS'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ' '.
G_KEY = KEY.
ENDMETHOD. "HANDLE_NODE_KEY_PRESS
METHOD HANDLE_ITEM_KEY_PRESS.
G_EVENT = 'ITEM_KEYPRESS'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ITEM_NAME.
G_KEY = KEY.
ENDMETHOD. "HANDLE_ITEM_KEY_PRESS
METHOD HANDLE_EXPAND_NO_CHILDREN.
G_EVENT = 'EXPAND_NO_CHILDREN'.
G_NODE_KEY = NODE_KEY.
ENDMETHOD. "handle_EXPAND_NO_CHILDREN
METHOD HANDLE_CHECKBOX.
G_EVENT = 'CHECKBOX_HANDLING'.
G_NODE_KEY = NODE_KEY.
G_ITEM_NAME = ITEM_NAME.
G_CHECK = CHECKED.
ENDMETHOD. "HANDLE_CHECKBOX
ENDCLASS. "lcl_evt_hdlr IMPLEMENTATION
*------ start-of-selection.
START-OF-SELECTION.
CREATE OBJECT G_EVT_HDLR. "create an object for the class
*lcl_evt_hdlr
SET SCREEN 100.
MODULE pbo_100 OUTPUT
MODULE PBO_100 OUTPUT.
SET PF-STATUS 'BUT'.
IF G_TREE IS INITIAL.
the tree control has not yet been created
create a tree control and insert nodes into it.
PERFORM CREATE_AND_INIT_TREE.
ENDIF.
ENDMODULE. "pbo_100 OUTPUT
MODULE pai_100 INPUT
MODULE PAI_100 INPUT.
DATA:RETURN_CODE TYPE I.
CL_GUI_CFW=>DISPATCH must be called if events are registered
that trigger PAI
this method calls the event handler method of an event
CALL METHOD CL_GUI_CFW=>DISPATCH
IMPORTING
RETURN_CODE = RETURN_CODE.
IF RETURN_CODE <> CL_GUI_CFW=>RC_NOEVENT.
" a control event occured => exit PAI
CLEAR G_OK_CODE.
EXIT.
ENDIF.
*at user-command.
G_OK_CODE = SY-UCOMM.
CASE G_OK_CODE.
WHEN 'BACK'. " Finish program
IF NOT G_CUSTOM_CONTAINER IS INITIAL.
" destroy tree container (detroys contained tree control, too)
CALL METHOD G_CUSTOM_CONTAINER->FREE
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
CLEAR G_CUSTOM_CONTAINER.
CLEAR G_TREE.
ENDIF.
LEAVE PROGRAM.
ENDCASE.
CAUTION: clear ok code!
CLEAR G_OK_CODE.
ENDMODULE. "pai_100 INPUT
*& Form create_and_init_tree
text
--> p1 text
<-- p2 text
FORM CREATE_AND_INIT_TREE .
DATA:NODE_TABLE TYPE TREEV_NTAB,
ITEM_TABLE TYPE ITEM_TABLE_TYPE,
EVENTS TYPE CNTL_SIMPLE_EVENTS,
EVENT TYPE CNTL_SIMPLE_EVENT.
create a container for the tree control.
CREATE OBJECT G_CUSTOM_CONTAINER
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 A000.
ENDIF.
create a list tree control
CREATE OBJECT G_TREE
EXPORTING
PARENT = G_CUSTOM_CONTAINER
NODE_SELECTION_MODE = CL_GUI_LIST_TREE=>NODE_SEL_MODE_SINGLE
ITEM_SELECTION = 'X'
WITH_HEADERS = ' '
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CREATE_ERROR = 2
FAILED = 3
ILLEGAL_NODE_SELECTION_MODE = 4
LIFETIME_ERROR = 5.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
*------- KEY = enter
CALL METHOD G_TREE->ADD_KEY_STROKE
EXPORTING
KEY = CL_TREE_CONTROL_BASE=>KEY_ENTER
EXCEPTIONS
FAILED = 1
ILLEGAL_KEY = 2
CNTL_SYSTEM_ERROR = 3.
IF SY-SUBRC <> 0.
MESSAGE W006 WITH 'ADD_KEY_STROKE'.
ENDIF.
define the events which will be passed to the backend
node double click
EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_NODE_DOUBLE_CLICK.
EVENT-APPL_EVENT = 'X'.
APPEND EVENT TO EVENTS.
EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_ITEM_DOUBLE_CLICK.
EVENT-APPL_EVENT = 'X'.
APPEND EVENT TO EVENTS.
EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_NODE_KEYPRESS.
EVENT-APPL_EVENT = 'X'.
APPEND EVENT TO EVENTS.
EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_ITEM_KEYPRESS.
EVENT-APPL_EVENT = 'X'.
APPEND EVENT TO EVENTS.
EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_EXPAND_NO_CHILDREN.
EVENT-APPL_EVENT = 'X'.
APPEND EVENT TO EVENTS.
EVENT-EVENTID = CL_GUI_LIST_TREE=>EVENTID_CHECKBOX_CHANGE.
EVENT-APPL_EVENT = 'X'.
APPEND EVENT TO EVENTS.
*------ register the events
CALL METHOD G_TREE->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = EVENTS
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
ILLEGAL_EVENT_COMBINATION = 3.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
assign event handlers in the application class to each desired events
SET HANDLER G_EVT_HDLR->NODE_DBL_CLK FOR G_TREE.
SET HANDLER G_EVT_HDLR->ITEM_DBL_CLK FOR G_TREE.
SET HANDLER G_EVT_HDLR->HANDLE_NODE_KEY_PRESS FOR G_TREE.
SET HANDLER G_EVT_HDLR->HANDLE_ITEM_KEY_PRESS FOR G_TREE.
SET HANDLER G_EVT_HDLR->HANDLE_EXPAND_NO_CHILDREN FOR G_TREE.
SET HANDLER G_EVT_HDLR->HANDLE_CHECKBOX FOR G_TREE.
add some nodes to the tree control
PERFORM BUILD_NODE_AND_ITEM_TABLE USING NODE_TABLE ITEM_TABLE.
CALL METHOD G_TREE->ADD_NODES_AND_ITEMS
EXPORTING
NODE_TABLE = NODE_TABLE
ITEM_TABLE = ITEM_TABLE
ITEM_TABLE_STRUCTURE_NAME = 'mtreeitm'
EXCEPTIONS
FAILED = 1
CNTL_SYSTEM_ERROR = 3
ERROR_IN_TABLES = 4
DP_ERROR = 5
TABLE_STRUCTURE_NAME_NOT_FOUND = 6.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
ENDFORM. " create_and_init_tree
*& Form build_node_and_item_table
text
-->P_NODE_TABLE text
-->P_ITEM_TABLE text
FORM BUILD_NODE_AND_ITEM_TABLE USING
NODE_TABLE TYPE TREEV_NTAB
ITEM_TABLE TYPE ITEM_TABLE_TYPE.
DATA:NODE TYPE TREEV_NODE,
ITEM TYPE MTREEITM.
build the node table
node with key 'root'.
CLEAR NODE.
NODE-NODE_KEY = 'Root'. " key of the node
CLEAR NODE-RELATKEY. " root node has no parent node
CLEAR NODE-RELATSHIP.
NODE-HIDDEN = ' '. " the node is visible
NODE-DISABLED = ' '. " selectable
NODE-ISFOLDER = 'X'. " a folder
CLEAR NODE-N_IMAGE. " folder-/ leaf symbol in state "closed"
"use default.
CLEAR NODE-EXP_IMAGE. " folder-/ leaf symbol in state "open"
"use default.
CLEAR NODE-EXPANDER. " the width of the item is adjusted to its "
" content (text)
APPEND NODE TO NODE_TABLE.
node with key 'child1'.
CLEAR NODE.
NODE-NODE_KEY = 'Child1'. "key of the node
NODE-RELATKEY = 'Root'.
NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
NODE-ISFOLDER = 'X'.
APPEND NODE TO NODE_TABLE.
node with key 'Subchild1' for child1.
CLEAR NODE.
NODE-NODE_KEY = 'SubChild1'.
NODE-RELATKEY = 'Child1'.
NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
NODE-ISFOLDER = 'X'.
APPEND NODE TO NODE_TABLE.
node with key 'subchild2' for child1.
CLEAR NODE.
NODE-NODE_KEY = 'SubChild2'.
NODE-RELATKEY = 'Child1'.
NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
APPEND NODE TO NODE_TABLE.
node with key 'subchild3' for child1.
CLEAR NODE.
NODE-NODE_KEY = 'SubChild3'.
NODE-RELATKEY = 'Child1'.
NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
APPEND NODE TO NODE_TABLE.
node with key 'subchild4' for child1.
CLEAR NODE.
NODE-NODE_KEY = 'SubChild4'.
NODE-RELATKEY = 'Child1'.
NODE-DISABLED = ' '.
NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
APPEND NODE TO NODE_TABLE.
node with key 'child2'.
CLEAR NODE.
NODE-NODE_KEY = 'Child2'. "key of the node
NODE-RELATKEY = 'Root'.
NODE-RELATSHIP = CL_GUI_LIST_TREE=>RELAT_LAST_CHILD.
NODE-ISFOLDER = 'X'.
NODE-EXPANDER = 'X'. " The node is marked with a '+', although
" it has no children. When the user clicks on the
" + to open the node, the event expand_nc is
" fired. The programmerr can
" add the children of the
" node within the event handler of the expand_nc
" event (see callback handle_expand_nc).
APPEND NODE TO NODE_TABLE.
items of the nodes
item with key 'root'.
CLEAR ITEM.
ITEM-NODE_KEY = 'Root'.
ITEM-ITEM_NAME = '1'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT. " text item
ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO. "the width of the item
"is adjusted to its content
ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP. "use proportional font
" for the item
ITEM-TEXT = 'object'.
APPEND ITEM TO ITEM_TABLE.
item with key 'child1'.
CLEAR ITEM.
ITEM-NODE_KEY = 'Child1'.
ITEM-ITEM_NAME = '11'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
ITEM-TEXT = 'dynpros'.
APPEND ITEM TO ITEM_TABLE.
item with key 'child2'.
CLEAR ITEM.
ITEM-NODE_KEY = 'Child2'.
ITEM-ITEM_NAME = '12'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
ITEM-TEXT = 'programme'.
APPEND ITEM TO ITEM_TABLE.
items of node with key 'Subchild1'.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild1'.
ITEM-ITEM_NAME = '111'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-LENGTH = 11.
ITEM-TEXT = 'include'.
APPEND ITEM TO ITEM_TABLE.
items of node with key 'SubChild2'.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild2'.
ITEM-ITEM_NAME = '112'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-LENGTH = 4. " the width of the item is 4 chars
ITEM-IGNOREIMAG = 'X'. " see documentation of structure treev_item
ITEM-USEBGCOLOR = 'X'.
ITEM-T_IMAGE = '@01@'.
APPEND ITEM TO ITEM_TABLE.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild2'.
ITEM-ITEM_NAME = '113'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-LENGTH = 4. " the width of the item is 4 chars
ITEM-USEBGCOLOR = 'X'.
ITEM-TEXT = '0100'.
APPEND ITEM TO ITEM_TABLE.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild2'.
ITEM-ITEM_NAME = '114'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-LENGTH = 11.
ITEM-USEBGCOLOR = 'X'.
ITEM-TEXT = ' mueller'.
APPEND ITEM TO ITEM_TABLE.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild2'.
ITEM-ITEM_NAME = '115'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
ITEM-TEXT = ' comment to dynpro 100'.
APPEND ITEM TO ITEM_TABLE.
items of node with key 'SubChild3'.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild3'.
ITEM-ITEM_NAME = '121'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-LENGTH = 20.
ITEM-IGNOREIMAG = 'X'.
ITEM-USEBGCOLOR = 'X'.
ITEM-T_IMAGE = '@02@'.
ITEM-TEXT = ' 0200 harryhirsch'.
ITEM-CHOSEN = 'X'.
APPEND ITEM TO ITEM_TABLE.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild3'.
ITEM-ITEM_NAME = '122'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
ITEM-TEXT = ' comment to dynpro 200'.
APPEND ITEM TO ITEM_TABLE.
CLEAR ITEM.
ITEM-NODE_KEY = 'SubChild4'.
ITEM-ITEM_NAME = '144'.
ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
ITEM-LENGTH = 20.
ITEM-IGNOREIMAG = 'X'.
ITEM-USEBGCOLOR = 'X'.
ITEM-TEXT = ' select'.
ITEM-CHOSEN = 'X'.
ITEM-DISABLED = ' '.
APPEND ITEM TO ITEM_TABLE.
ENDFORM. " build_node_and_item_table
Hope it helps you,
Regards,
Maybe you are looking for
-
Hello all, I am new to Flex. I have some experience with AS3 (still switching over from AS2). Anyway, I am making a Flex project where I have a text link in a datagrid. This link needs to open a word document that is on our company network. Curren
-
IPod not recognized after iTunes 8.0.2 update
I recently updated iTunes to 8.0.2 and now my ipod is not recognized by my mac or iTunes. I went through all the steps (5 r's) including putting it into disk mode and uninstalling/reinstalling itunes, reboot,etc. Nothing works...When I plug in my iPh
-
How do I save my .pdf files as .jpeg files?
How do I save my .pdf files as .jpeg files? Do this require Acrobat Pro? I don't need all of the bells and whistles, just the ability to save as .jpeg. Please advise.
-
My imac screen went half dark, can I fix this myself??
My 24' Imac screen went 1/2 black on top the bottom is fine, can I fix this myself??? HELP
-
Alternative account Number in G/L
Hello experts, We have a company that besides the usual balance structure uses also an alternative one for its country. When I run the Balance sheet query with the normal hierarchy I can see all the nodes correctly. But when I use the one for its cou