Add_node method
Hi Expert!!
I need you help i am creating column tree with using my local class with reference to cl_gui_column_tree the method add_node is not in this class .As this method is present in cl_column_tree_model class.Please advice which method i can use as similarly add_node in cl_gui_column_tree.
Thanks in advance.
Ankur Garg
Hello Ankur
Sample report SAPCOLUMN_TREE_CONTROL_DEMO shows how to build a tree using class cl_gui_column_tree.
Below you see part of the coding where the tree nodes are created:
* add some nodes to the tree control
* NOTE: the tree control does not store data at the backend. If an
* application wants to access tree data later, it must store the
* tree data itself.
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.
* expand the node with key 'Root'
CALL METHOD G_TREE->EXPAND_NODE
EXPORTING
node_key = c_nodekey-Root
EXCEPTIONS
FAILED = 1
ILLEGAL_LEVEL_COUNT = 2
CNTL_SYSTEM_ERROR = 3
NODE_NOT_FOUND = 4
CANNOT_EXPAND_LEAF = 5.
IF SY-SUBRC <> 0.
MESSAGE A000.
ENDIF.
ENDFORM. " CREATE_AND_INIT_TREE
It seems that this class does not have a method for adding a single node. Thus, use method ADD_NODES_AND_ITEMS with a single entry in the node and item itabs.
Regards
Uwe
Similar Messages
-
how to create a folder with sub nodes on container.
Moderator message: Please search the forum before posting basic questions. Thread locked!
Edited by: Neil Gardiner on Sep 21, 2010 4:08 PMHello,
For this rquirement, you need to use two classes:
CL_GUI_CUSTOM_CONTAINER and CL_GUI_ALV_TREE.
a) First on the screen, create a Custom Control with name say 'Test'
b) Then in the PBO of the screen, create an object of CL_GUI_CUSTOM_CONTAINER with the control name as 'Test'
c) Then create an object of class CL_GUI_ALV_TREE with the parent as the object created in (b)
d) Build the field catalog, layout and use the method set_table_for_first_display
e) after this create the tree structure using ADD_NODES method
For further reference, use amy program starting with BCALV_TREE*
Hope this helps,
Regards,
Himanshu -
ALV Tree - Change average value
Hi all,
I want to change the average value. For the follow example the hierarchy has 2 lines but it is a summarize of 13 lines. So the right average is (100.00 + 16.67) / 13
SAP average
Expectation:
I am using:
data: g_tree type ref to cl_gui_alv_tree_simple.
Is it possible to change it?
Regards,
AndréaHi,
Use CL_GUI_ALV_TREE method for creating the Tree, in that create each node by method ADD_NODE. With this method you can do calculation and update while building the ALV Tree.
Just refer the Demo program 'BCALV_TREE_DEMO'.
First get the final output table data.
Loop that table and create each node by using ADD_NODE method.
Thanks & Regards
Bala Krishna -
Folder symbol when handling node_double_click
Hi,
I am using the class cl_gui_alv_tree to display tree structure.
I am getting folder symbols in the tree structure ,I have to remove these.
how to do???.
Another thing is I have to handle the event node_double_click.
it is triggered if I double click on folder symbol only.
if I remove the folder symbol how to handle this...
please very very very urjent
Srilakshmi.Hello Srilakshmi
When you double-click in an ALV tree you always get the node key as input for the event handler methods. Therefore, I use a simple trick to retrieve the entire row from the node key:
" Assumption: ALV tree is used to display customers stored in table KNB1.
" Note: define additional fields to your outtab itab for the node key (and parent node key)
TYPES: BEGIN OF ty_s_outtab.
INCLUDE TYPE knb1 AS customer.
TYPES: node_key TYPE tm_nodekey. " not sure if this is the correct type -> replace if necessary
TYPES: parent_key TYPE tm_nodekey.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab TYPE STANDARD TABLE OF ty_s_outtab
WITH DEFAULT KEY.
DATA:
gt_outtab TYPE ty_t_outtab. " itab for ALV tree data
" Fill the ALV tree
DATA:
ld_node_Key TYPE tm_nodekey,
ld_parent_key TYPE tm_Nodekey,
lt_knb1 TYPE STANDARD TABLE OF knb1,
ls_knb1 TYPE knb1,
ls_outtab TYPE ty_s_outtab.
LOOP AT lt_knb1 INTO ls_knb1.
CLEAR: ls_outtab.
ls_outtab-customer = ls_knb1.
CALL METHOD go_tree->add_node
EXPORTING
relatkey = ld_parent_key
IMPORTING
node_key = ld_node_key.
ls_outtab-node_key = ld_node_key. " returned from ADD_NODE method
ls_outtab-parent_key = ld_parent_key.
MODIFY gt_outtab FROM ls_outtab
TRANSPORTING node_key parent_key
WHERE ( bukrs = ls_knb1-bukrs
AND kunnr = ls_Knb1-kunnr ).
ENDLOOP.
" Retrieve entire row in event handler method by node key
METHOD handle_node_double_click.
" define local data
DATA:
ls_knb1 TYPE knb1,
ls_outtab TYPE ty_s_outtab.
READ TABLE gt_outtab INTO ls_outtab
WITH KEY node_key = node_key.
IF ( syst-subrc = 0 ).
ls_Knb1 = ls_outtab-customer.
ENDIF.
ENDMETHOD.
Regards,
Uwe -
SUBMIT inside a method & the automation queue
Hi,
I call a method via a tree toolbar button in that calls a standard SAP report using the SUBMIT AND RETURN command. This is done within a screen with several docking containers and split screens attached.
The problem is that when I press the toolbar button, the report (which also has docking container) is presented partially inside my screen.
When I put a BREAK-POINT on the SUBMIT statement it is good and I can see SAP's report with no issues and I do not see my screen. When I take the break point off it is back to the original problem.
This leaves me to think that it is an automation queue problem or something like that.
How can I get over this?
Thanks,
ItayHello Itay
I tried to simulate your situation. Perhaps you get from this sample report (which was copied from BCALV_TREE_DEMO and the adjusted) some ideas how to solve your problem. In my report all controls are displayed properly.
[code]&----
*& Report ZUS_SDN_BCALV_TREE_DEMO_8 *
*& Based on: BCALV_TREE_DEMO *
REPORT zus_sdn_bcalv_tree_demo.
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_grid TYPE REF TO cl_gui_alv_grid.
data:
gt_knb1 type standard table of knb1. " dummy
*$Comment: begin
DATA:
gd_delete_nkey TYPE lvc_nkey.
*$Comment: end
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA tree1 TYPE REF TO cl_gui_alv_tree.
DATA mr_toolbar TYPE REF TO cl_gui_toolbar.
INCLUDE <icon>.
INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.
*INCLUDE zus_sdn_bcalv_tb_event_rcvr.
*include bcalv_toolbar_event_receiver.
INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.
*INCLUDE zus_sdn_bcalv_tree_event_rcvr.
*include bcalv_tree_event_receiver.
DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
DATA: gt_sflight TYPE sflight OCCURS 0, "Output-Table
gt_fieldcatalog TYPE lvc_t_fcat, "Fieldcatalog
ok_code LIKE sy-ucomm. "OK-Code
START-OF-SELECTION.
Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 1
columns = 2
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_left.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
Create ALV grid
CREATE OBJECT go_grid
EXPORTING
i_parent = go_cell_right
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN 100.
END-OF-SELECTION.
*& Module PBO OUTPUT
process before output
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
IF tree1 IS INITIAL.
PERFORM init_tree.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PBO OUTPUT
*& Module PAI INPUT
process after input
MODULE pai INPUT.
translate ok_code to upper case.
CASE ok_code.
WHEN 'EXIT' OR 'BACK' OR 'CANC'.
PERFORM exit_program.
*$Comment: begin
WHEN 'DELETE'.
CALL METHOD tree1->delete_subtree
EXPORTING
i_node_key = gd_delete_nkey " = folder 'AA'
I_UPDATE_PARENTS_EXPANDER = SPACE
I_UPDATE_PARENTS_FOLDER = SPACE
EXCEPTIONS
node_key_not_in_model = 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.
CALL METHOD tree1->update_calculations
EXPORTING
no_frontend_update = ' '. " do frontend update
*$Comment: end
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
CLEAR ok_code.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PAI INPUT
*& Form build_fieldcatalog
build fieldcatalog for structure sflight
FORM build_fieldcatalog.
get fieldcatalog
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = gt_fieldcatalog.
SORT gt_fieldcatalog BY scrtext_l.
change fieldcatalog
DATA: ls_fieldcatalog TYPE lvc_s_fcat.
LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
CASE ls_fieldcatalog-fieldname.
WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
ls_fieldcatalog-no_out = 'X'.
ls_fieldcatalog-key = ''.
WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
ls_fieldcatalog-do_sum = 'X'.
ENDCASE.
MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
ENDLOOP.
ENDFORM. " build_fieldcatalog
*& Form build_hierarchy_header
build hierarchy-header-information
-->P_L_HIERARCHY_HEADER strucxture for hierarchy-header
FORM build_hierarchy_header CHANGING
p_hierarchy_header TYPE treev_hhdr.
p_hierarchy_header-heading = 'Hierarchy Header'. "#EC NOTEXT
p_hierarchy_header-tooltip =
'This is the Hierarchy Header !'. "#EC NOTEXT
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
ENDFORM. " build_hierarchy_header
*& Form exit_program
free object and leave program
FORM exit_program.
CALL METHOD tree1->free.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form build_header
build table for html_header
--> p1 text
<-- p2 text
FORM build_comment USING
pt_list_commentary TYPE slis_t_listheader
p_logo TYPE sdydo_value.
DATA: ls_line TYPE slis_listheader.
LIST HEADING LINE: TYPE H
CLEAR ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'ALV-tree-demo: flight-overview'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
STATUS LINE: TYPE S
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = 'valid until'. "#EC NOTEXT
ls_line-info = 'January 29 1999'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
ls_line-key = 'time'.
ls_line-info = '2.00 pm'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
ACTION LINE: TYPE A
CLEAR ls_line.
ls_line-typ = 'A'.
LS_LINE-KEY: NOT USED FOR THIS TYPE
ls_line-info = 'actual data'. "#EC NOTEXT
APPEND ls_line TO pt_list_commentary.
p_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "build_comment
*& Form create_hierarchy
text
--> p1 text
<-- p2 text
FORM create_hierarchy.
DATA: ls_sflight TYPE sflight,
lt_sflight TYPE sflight OCCURS 0.
get data
SELECT * FROM sflight INTO TABLE lt_sflight
UP TO 200 ROWS . "#EC CI_NOWHERE
SORT lt_sflight BY carrid connid fldate.
add data to tree
DATA: l_carrid_key TYPE lvc_nkey,
l_connid_key TYPE lvc_nkey,
l_last_key TYPE lvc_nkey.
LOOP AT lt_sflight INTO ls_sflight.
ON CHANGE OF ls_sflight-carrid.
PERFORM add_carrid_line USING ls_sflight
CHANGING l_carrid_key.
ENDON.
*$Comment: begin
IF ( ls_sflight-carrid = 'AA' ).
gd_delete_nkey = l_carrid_key.
ENDIF.
*$Comment: end
ON CHANGE OF ls_sflight-connid.
PERFORM add_connid_line USING ls_sflight
l_carrid_key
CHANGING l_connid_key.
ENDON.
PERFORM add_complete_line USING ls_sflight
l_connid_key
CHANGING l_last_key.
ENDLOOP.
calculate totals
CALL METHOD tree1->update_calculations.
this method must be called to send the data to the frontend
CALL METHOD tree1->frontend_update.
ENDFORM. " create_hierarchy
*& Form add_carrid_line
add hierarchy-level 1 to tree
-->P_LS_SFLIGHT sflight
-->P_RELEATKEY relatkey
<-->p_node_key new node-key
FORM add_carrid_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value,
ls_sflight TYPE sflight.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-t_image = '@3P@'.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-style =
cl_gui_column_tree=>style_intensifd_critical.
APPEND ls_item_layout TO lt_item_layout.
add node
l_node_text = ps_sflight-carrid.
DATA: ls_node TYPE lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
is_node_layout = ls_node
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_carrid_line
*& Form add_connid_line
add hierarchy-level 2 to tree
-->P_LS_SFLIGHT sflight
-->P_RELEATKEY relatkey
<-->p_node_key new node-key
FORM add_connid_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value,
ls_sflight TYPE sflight.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-t_image = '@3Y@'.
ls_item_layout-style =
cl_gui_column_tree=>style_intensified.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
APPEND ls_item_layout TO lt_item_layout.
add node
l_node_text = ps_sflight-connid.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_sflight
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_connid_line
*& Form add_cmplete_line
add hierarchy-level 3 to tree
-->P_LS_SFLIGHT sflight
-->P_RELEATKEY relatkey
<-->p_node_key new node-key
FORM add_complete_line USING ps_sflight TYPE sflight
p_relat_key TYPE lvc_nkey
CHANGING p_node_key TYPE lvc_nkey.
DATA: l_node_text TYPE lvc_value.
set item-layout
DATA: lt_item_layout TYPE lvc_t_layi,
ls_item_layout TYPE lvc_s_layi.
ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
ls_item_layout-class = cl_gui_column_tree=>item_class_checkbox.
ls_item_layout-editable = 'X'.
APPEND ls_item_layout TO lt_item_layout.
CLEAR ls_item_layout.
ls_item_layout-fieldname = 'PLANETYPE'.
ls_item_layout-alignment = cl_gui_column_tree=>align_right.
APPEND ls_item_layout TO lt_item_layout.
l_node_text = ps_sflight-fldate.
DATA: ls_node TYPE lvc_s_layn.
ls_node-n_image = space.
ls_node-exp_image = space.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = p_relat_key
i_relationship = cl_gui_column_tree=>relat_last_child
is_outtab_line = ps_sflight
i_node_text = l_node_text
is_node_layout = ls_node
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_node_key.
ENDFORM. " add_complete_line
*& 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.
define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
APPEND l_event TO lt_events.
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_item_context_menu_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_header_click.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
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.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
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_node_ctmenu_request
FOR tree1.
SET HANDLER l_event_receiver->handle_node_ctmenu_selected
FOR tree1.
SET HANDLER l_event_receiver->handle_item_ctmenu_request
FOR tree1.
SET HANDLER l_event_receiver->handle_item_ctmenu_selected
FOR tree1.
ENDFORM. " register_events
*& Form change_toolbar
text
--> p1 text
<-- p2 text
FORM change_toolbar.
get toolbar control
CALL METHOD tree1->get_toolbar_object
IMPORTING
er_toolbar = mr_toolbar.
CHECK NOT mr_toolbar IS INITIAL.
add seperator to toolbar
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = ''
icon = ''
butn_type = cntb_btype_sep
text = ''
quickinfo = 'This is a Seperator'. "#EC NOTEXT
add Standard Button to toolbar (for Delete Subtree)
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'DELETE'
icon = '@18@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'Delete subtree'. "#EC NOTEXT
add Dropdown Button to toolbar (for Insert Line)
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'INSERT_LC'
icon = '@17@'
butn_type = cntb_btype_dropdown
text = ''
quickinfo = 'Insert Line'. "#EC NOTEXT
Add SUBMIT-Button
CALL METHOD mr_toolbar->add_button
EXPORTING
fcode = 'SUBMIT'
icon = '@15@'
butn_type = cntb_btype_button
text = ''
quickinfo = 'SUBMIT report'. "#EC NOTEXT
set event-handler for toolbar-control
CREATE OBJECT toolbar_event_receiver.
SET HANDLER toolbar_event_receiver->on_function_selected
FOR mr_toolbar.
SET HANDLER toolbar_event_receiver->on_toolbar_dropdown
FOR mr_toolbar.
ENDFORM. " change_toolbar
*& Form init_tree
text
--> p1 text
<-- p2 text
FORM init_tree.
create fieldcatalog for structure sflight
PERFORM build_fieldcatalog.
create container for alv-tree
DATA: l_tree_container_name(30) TYPE c,
l_custom_container TYPE REF TO cl_gui_custom_container.
l_tree_container_name = 'TREE1'.
IF sy-batch IS INITIAL.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC
*NOTEXT
ENDIF.
ENDIF.
create tree control
CREATE OBJECT tree1
EXPORTING
parent = go_cell_left
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
create Hierarchy-header
DATA l_hierarchy_header TYPE treev_hhdr.
PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
create info-table for html-header
DATA: lt_list_commentary TYPE slis_t_listheader,
l_logo TYPE sdydo_value.
PERFORM build_comment USING
lt_list_commentary
l_logo.
repid for saving variants
DATA: ls_variant TYPE disvariant.
ls_variant-report = sy-repid.
create emty tree-control
CALL METHOD tree1->set_table_for_first_display
EXPORTING
is_hierarchy_header = l_hierarchy_header
it_list_commentary = lt_list_commentary
i_logo = l_logo
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
CHANGING
it_outtab = gt_sflight "table must be emty !!
it_fieldcatalog = gt_fieldcatalog.
create hierarchy
PERFORM create_hierarchy.
add own functioncodes to the toolbar
PERFORM change_toolbar.
register events
PERFORM register_events.
adjust column_width
call method tree1->COLUMN_OPTIMIZE.
ENDFORM. " init_tree[/code]
<b>INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8.</b>
[code]----
INCLUDE ZUS_SDN_BCALV_TB_EVENT_RCVR8 *
CLASS lcl_toolbar_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: on_function_selected
FOR EVENT function_selected OF cl_gui_toolbar
IMPORTING fcode,
on_toolbar_dropdown
FOR EVENT dropdown_clicked OF cl_gui_toolbar
IMPORTING fcode
posx
posy.
ENDCLASS. "lcl_toolbar_event_receiver DEFINITION
CLASS lcl_toolbar_event_receiver IMPLEMENTATION
CLASS lcl_toolbar_event_receiver IMPLEMENTATION.
METHOD on_function_selected.
DATA: ls_sflight TYPE sflight.
CASE fcode.
WHEN 'SUBMIT'.
SUBMIT zus_sdn_two_alv_grids AND RETURN.
WHEN 'DELETE'.
get selected node
DATA: lt_selected_node TYPE lvc_t_nkey.
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
DATA l_selected_node TYPE lvc_nkey.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
delete subtree
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->delete_subtree
EXPORTING
i_node_key = l_selected_node
i_update_parents_expander = ''
i_update_parents_folder = 'X'.
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_LC'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship = cl_tree_control_base=>relat_last_child
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Last Child'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_FC'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship = cl_tree_control_base=>relat_first_child
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'First Child'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_FS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_first_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'First Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_LS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_last_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Last Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
WHEN 'INSERT_NS'.
get selected node
CALL METHOD tree1->get_selected_nodes
CHANGING
ct_selected_nodes = lt_selected_node.
CALL METHOD cl_gui_cfw=>flush.
READ TABLE lt_selected_node INTO l_selected_node INDEX 1.
get current Line
IF NOT l_selected_node IS INITIAL.
CALL METHOD tree1->get_outtab_line
EXPORTING
i_node_key = l_selected_node
IMPORTING
e_outtab_line = ls_sflight.
ls_sflight-seatsmax = ls_sflight-price + 99.
ls_sflight-price = ls_sflight-seatsmax + '99.99'.
CALL METHOD tree1->add_node
EXPORTING
i_relat_node_key = l_selected_node
i_relationship =
cl_tree_control_base=>relat_next_sibling
is_outtab_line = ls_sflight
is_node_layout
it_item_layout
i_node_text = 'Next Sibling'. "#EC NOTEXT
importing
e_new_node_key
ELSE.
MESSAGE i227(0h).
ENDIF.
ENDCASE.
update frontend
CALL METHOD tree1->frontend_update.
ENDMETHOD. "on_function_selected
METHOD on_toolbar_dropdown.
create contextmenu
DATA: l_menu TYPE REF TO cl_ctmenu,
l_fc_handled TYPE as4flag.
CREATE OBJECT l_menu.
CLEAR l_fc_handled.
CASE fcode.
WHEN 'INSERT_LC'.
l_fc_handled = 'X'.
insert as last child
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_LC'
text = 'Insert New Line as Last Child'. "#EC NOTEXT
insert as first child
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_FC'
text = 'Insert New Line as First Child'. "#EC NOTEXT
insert as next sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_NS'
text = 'Insert New Line as Next Sibling'. "#EC NOTEXT
insert as last sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_LS'
text = 'Insert New Line as Last Sibling'. "#EC NOTEXT
insert as first sibling
CALL METHOD l_menu->add_function
EXPORTING
fcode = 'INSERT_FS'
text = 'Insert New Line as First Sibling'. "#EC NOTEXT
ENDCASE.
show dropdownbox
IF l_fc_handled = 'X'.
CALL METHOD mr_toolbar->track_context_menu
EXPORTING
context_menu = l_menu
posx = posx
posy = posy.
ENDIF.
ENDMETHOD. "on_toolbar_dropdown
ENDCLASS. "lcl_toolbar_event_receiver IMPLEMENTATION[/code]
<b>INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8.</b>
[code]----
INCLUDE ZUS_SDN_BCALV_TREE_EVENT_RCVR8 *
class lcl_tree_event_receiver definition.
public section.
methods handle_node_ctmenu_request
for event node_context_menu_request of cl_gui_alv_tree
importing node_key
menu.
methods handle_node_ctmenu_selected
for event node_context_menu_selected of cl_gui_alv_tree
importing node_key
fcode.
methods handle_item_ctmenu_request
for event item_context_menu_request of cl_gui_alv_tree
importing node_key
fieldname
menu.
methods handle_item_ctmenu_selected
for event item_context_menu_selected of cl_gui_alv_tree
importing node_key
fieldname
fcode.
methods handle_item_double_click
for event item_double_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_button_click
for event button_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_link_click
for event link_click of cl_gui_alv_tree
importing node_key
fieldname.
methods handle_header_click
for event header_click of cl_gui_alv_tree
importing fieldname.
endclass.
class lcl_tree_event_receiver implementation.
method handle_node_ctmenu_request.
append own functions
call method menu->add_function
exporting fcode = 'USER1'
text = 'Usercmd 1'. "#EC NOTEXT
call method menu->add_function
exporting fcode = 'USER2'
text = 'Usercmd 2'. "#EC NOTEXT
call method menu->add_function
exporting fcode = 'USER3'
text = 'Usercmd 3'. "#EC NOTEXT
endmethod.
method handle_node_ctmenu_selected.
case fcode.
when 'USER1' or 'USER2' or 'USER3'.
message i000(0h) with 'Node-Context-Menu on Node ' node_key
'fcode : ' fcode. "#EC NOTEXT
endcase.
endmethod.
method handle_item_ctmenu_request .
append own functions
call method menu->add_function
exporting fcode = 'USER1'
text = 'Usercmd 1'.
call method menu->add_function
exporting fcode = 'USER2'
text = 'Usercmd 2'.
call method menu->add_function
exporting fcode = 'USER3'
text = 'Usercmd 3'.
endmethod. -
Hello Everbody!
How can I implement customer specific hierarchy via alv-tree.
like:
Customer-Nr
Period
-> Information.
These both upper hierarchies "Customer-Nr" and "Period" should have a
Folder-Icon as usually which indicates being the upper hierarchy.
Is the method add_node responsible for it ? If so
at which part of this method must it determined.
call method gd_tree->add_node
Generally whereby is it specified exactly what node the upper hierarchy
is (Folder-Icon ) and not. How can I stear it to my desire.
Reagards
IlhanAmit Khare thank you but it doesn' t answers my question.
I only want to know how can I create my own hierarchy concerning
to an existing code-problem. If you have one minute take a look at this code.
It is problematical to construct the folowing hierarchy :
1 hierarchy (yellow Folder icon)-> Customer-Nr
2 hierarchy (yellow Folder icon)-> Period
3 hierarchy (any other icon)-> datas
TABLES: ZQMCOMP.
TYPE-POOLS: slis. "ALV Declarations
DATA: it_ekko TYPE STANDARD TABLE OF ZQMCOMP INITIAL SIZE 0,
it_ekpo TYPE STANDARD TABLE OF ZQMCOMP INITIAL SIZE 0,
it_emptytab TYPE STANDARD TABLE OF ZQMCOMP INITIAL SIZE 0,
wa_ekko TYPE ZQMCOMP,
wa_ekpo TYPE ZQMCOMP.
DATA: ok_code like sy-ucomm, "OK-Code
save_ok like sy-ucomm.
*ALV data declarations
DATA: fieldcatalog TYPE lvc_t_fcat WITH HEADER LINE.
DATA: gd_fieldcat TYPE lvc_t_fcat,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv.
*ALVtree data declarations
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA: gd_tree TYPE REF TO cl_gui_alv_tree,
gd_hierarchy_header TYPE treev_hhdr,
gd_report_title TYPE slis_t_listheader,
gd_logo TYPE sdydo_value,
gd_variant TYPE disvariant.
DATA: l_tree_container_name(30) TYPE c,
l_custom_container TYPE REF TO cl_gui_custom_container,
gd_tree_container_name TYPE REF TO cl_gui_custom_container,
gd_custom_container TYPE REF TO cl_gui_custom_container.
* Add following code to 'Z......F01' INCLUDE
*& Form CREATE_ALVTREE_CONTAINER
* Create container for alv-tree
FORM create_alvtree_container.
create object gd_custom_container
exporting
container_name = 'SCREEN_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 x208(00) with 'ERROR'.
endif.
ENDFORM.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_hierarchy_header CHANGING gd_hierarchy_header.
PERFORM build_report_title USING gd_report_title gd_logo.
PERFORM build_variant.
call screen 100.
*& Form DATA_RETRIEVAL
* Retrieve data into Internal tables
FORM data_retrieval.
select * from ZQMCOMP into TABLE it_ekko.
select * from ZQMCOMP into TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'. "Field name in itab
fieldcatalog-scrtext_s = 'Kunden-Nr'. "Column text
fieldcatalog-col_pos = 0. "Column position
fieldcatalog-outputlen = 15. "Column width
fieldcatalog-emphasize = 'X'. "Emphasize (X or SPACE)
fieldcatalog-key = 'X'. "Key Field? (X or SPACE)
APPEND fieldcatalog TO gd_fieldcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-scrtext_s = 'PO Iten'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-scrtext_s = 'Status'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-scrtext_s = 'Item change date'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-scrtext_s = 'Material Number'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-scrtext_s = 'PO quantity'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-scrtext_s = 'Order Unit'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-scrtext_s = 'Net Price'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 7.
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-scrtext_s = 'Price Unit'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 8.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(230).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
ENDFORM. " BUILD_LAYOUT
*& Form build_hierarchy_header
* build hierarchy-header-information
* -->P_L_HIERARCHY_HEADER structure for hierarchy-header
FORM build_hierarchy_header CHANGING
p_hierarchy_header TYPE treev_hhdr.
p_hierarchy_header-heading = 'Kunden-Nr.'(013).
p_hierarchy_header-tooltip = 'Kundenummer'(014).
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
ENDFORM. " build_hierarchy_header
*& Form BUILD_REPORT_TITLE
* Build table for ALVtree header
* <-> p1 Header details
* <-> p2 Logo value
FORM build_report_title CHANGING
pt_report_title TYPE slis_t_listheader
pa_logo TYPE sdydo_value.
DATA: ls_line TYPE slis_listheader,
ld_date(10) TYPE c.
* List Heading Line(TYPE H)
CLEAR ls_line.
ls_line-typ = 'H'.
* ls_line-key "Not Used For This Type(H)
ls_line-info = 'INFO'.
APPEND ls_line TO pt_report_title.
* Status Line(TYPE S)
ld_date(2) = sy-datum+6(2).
ld_date+2(1) = '/'.
ld_date+3(2) = sy-datum+4(2).
ld_date+5(1) = '/'.
ld_date+6(4) = sy-datum(4).
ls_line-typ = 'S'.
ls_line-key = 'Date'.
ls_line-info = ld_date.
APPEND ls_line TO pt_report_title.
* Action Line(TYPE A)
CLEAR ls_line.
ls_line-typ = 'A'.
ls_line-info = 'Liste pro Kunde'.
APPEND ls_line TO pt_report_title.
ENDFORM.
*& Form BUILD_VARIANT
* Build variant
form build_variant.
* Set repid for storing variants
gd_variant-report = sy-repid.
endform. " BUILD_VARIANT
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS1'.
SET TITLEBAR 'STATUS1'.
IF gd_tree IS INITIAL.
PERFORM create_alvtree_container.
PERFORM create_object_in_container.
PERFORM create_empty_alvtree_control.
PERFORM create_alvtree_hierarchy.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
DATA return TYPE REF TO cl_gui_event.
save_ok = ok_code.
case ok_code.
when 'BACK' or '%EX' or 'RW'.
* Exit program
leave to screen 0.
* Process ALVtree user actions
when others.
call method cl_gui_cfw=>get_current_event_object
receiving
event_object = return.
call method cl_gui_cfw=>dispatch.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
* Add following code to 'Z......F01' INCLUDE
*& Form CREATE_OBJECT_IN_CONTAINER
* Create ALVtree control
FORM create_object_in_container.
create object gd_tree
exporting
parent = gd_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = 'X'
no_html_header = ''
no_toolbar = ''
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
if sy-subrc <> 0.
message x208(00) with 'ERROR'.
endif.
ENDFORM.
* Add following code to 'Z......F01' INCLUDE
*& Form CREATE_EMPTY_ALVTREE_CONTROL
* Create empty tree control
FORM create_empty_alvtree_control.
* Create emty tree-control
CLEAR: it_emptytab.
REFRESH: it_emptytab.
CALL METHOD gd_tree->set_table_for_first_display
EXPORTING
I_STRUCTURE_NAME = 'ZQMCOMP'
is_hierarchy_header = gd_hierarchy_header
it_list_commentary = gd_report_title
i_logo = gd_logo
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = gd_variant
CHANGING
it_outtab = it_emptytab . "Must be empty
* it_fieldcatalog = gd_fieldcat.
ENDFORM. " CREATE_EMPTY_ALVTREE_CONTROL
* Add following code to 'Z......F01' INCLUDE
*& Form CREATE_ALVTREE_HIERARCHY
* text
* Builds ALV tree display, (inserts nodes, subnodes etc)
form create_alvtree_hierarchy.
data: ld_ebeln_key type lvc_nkey,
ld_ebelp_key type lvc_nkey.
loop at it_ekko into wa_ekko.
perform add_ekko_node using wa_ekko
changing ld_ebeln_key.
perform add_node_date using wa_ekko
changing ld_ebeln_key.
perform add_ekpo_line using wa_ekko
ld_ebeln_key
changing ld_ebelp_key.
endloop.
* calculate totals
call method gd_tree->update_calculations.
* this method must be called to send the data to the frontend
call method gd_tree->frontend_update.
endform. " CREATE_ALVTREE_HIERARCHY
*& Form add_node_date
* text
* -->P_WA_EKPO text
* -->P_0553 text
* <--P_EBELN_KEY text
form add_node_date using ps_ekko like wa_ekko
value(p_relate_key)
changing p_node_key.
data: ld_node_text type lvc_value,
ls_sflight type sflight.
* Set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@1U@'.
ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
ls_item_layout-style = cl_gui_column_tree=>style_default.
ld_node_text = 'Period'.
append ls_item_layout to lt_item_layout.
* Add node
call method gd_tree->add_node
exporting
i_relat_node_key = p_relate_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = ld_node_text
is_outtab_line = ps_ekko-KUNDE
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " ADD_EKKO_NODE
* FORM add_ekko_node *
* --> PS_EKKO *
* --> VALUE(P_RELATE_KEY) *
* --> P_NODE_KEY *
form add_ekko_node using ps_ekko like wa_ekko
value(p_relate_key)
changing p_node_key.
data: ld_node_text type lvc_value,
ls_sflight type sflight.
* Set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@A0@'.
ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
ls_item_layout-style = cl_gui_column_tree=>style_default.
ld_node_text = 'Customer-Nr..'.
append ls_item_layout to lt_item_layout.
* Add node
call method gd_tree->add_node
exporting
i_relat_node_key = p_relate_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = ld_node_text
is_outtab_line = ps_ekko-KUNDE
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " ADD_EKKO_NODE
*& Form ADD_EKPO_LINE
* text
* -->P_WA_EKPO text
* -->P_LD_EBELN_KEY text
* <--P_LD_EBELP_KEY text
form add_ekpo_line using ps_ekpo like wa_ekpo
value(p_relate_key)
changing p_node_key.
data: ld_node_text type lvc_value,
ls_sflight type sflight.
* Set item-layout
data: lt_item_layout type lvc_t_layi,
ls_item_layout type lvc_s_layi.
ls_item_layout-t_image = '@90@'.
ls_item_layout-fieldname = gd_tree->c_hierarchy_column_name.
ls_item_layout-style = cl_gui_column_tree=>style_default.
ld_node_text = ps_ekpo-KUNDE.
append ls_item_layout to lt_item_layout.
* Add node
call method gd_tree->add_node
exporting
i_relat_node_key = p_relate_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = ld_node_text
is_outtab_line = ps_ekpo
it_item_layout = lt_item_layout
importing
e_new_node_key = p_node_key.
endform. " ADD_EKPO_LINE -
Error while calling a method on Bean (EJB 3.0)
I am getting an error while calling a method on EJB. I am using EJB3.0 and my bean is getting properly deployed(i am sure b'cos i can see the successfullly deployed message). Can any body help me
Error is -->
Error while destroying resource :An I/O error has occured while flushing the output - Exception: java.io.IOException: An established connection was aborted by the software in your host machine
Stack Trace:
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
at sun.nio.ch.IOUtil.write(IOUtil.java:75)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
at com.sun.enterprise.server.ss.provider.ASOutputStream.write(ASOutputStream.java:138)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.postgresql.PG_Stream.flush(PG_Stream.java:352)
at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
at org.postgresql.jdbc1.AbstractJdbc1Connection.rollback(AbstractJdbc1Connection.java:1031)
at org.postgresql.jdbc2.optional.PooledConnectionImpl$ConnectionHandler.invoke(PooledConnectionImpl.java:223)
at $Proxy34.close(Unknown Source)
at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:274)
at com.sun.enterprise.resource.LocalTxConnectorAllocator.destroyResource(LocalTxConnectorAllocator.java:103)
at com.sun.enterprise.resource.AbstractResourcePool.destroyResource(AbstractResourcePool.java:603)
at com.sun.enterprise.resource.AbstractResourcePool.resourceErrorOccurred(AbstractResourcePool.java:713)
at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:424)
at com.sun.enterprise.resource.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:393)
at com.sun.enterprise.resource.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:69)
at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:618)
at com.sun.gjc.spi.ConnectionHolder.close(ConnectionHolder.java:163)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:379)
at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:367)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:402)
at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.afterJTSTransaction(DatasourceAccessor.java:100)
at oracle.toplink.essentials.threetier.ClientSession.afterTransaction(ClientSession.java:104)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.afterTransaction(UnitOfWorkImpl.java:1816)
at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.afterCompletion(AbstractSynchronizationListener.java:161)
at oracle.toplink.essentials.transaction.JTASynchronizationListener.afterCompletion(JTASynchronizationListener.java:87)
at com.sun.ejb.containers.ContainerSynchronization.afterCompletion(ContainerSynchronization.java:174)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:467)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy84.addDepartment(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
End of Stack Trace
|#]
RAR5035:Unexpected exception while destroying resource. To get exception stack, please change log level to FINE.
EJB5018: An exception was thrown during an ejb invocation on [DepartmentSessionBean]
javax.ejb.EJBException: Unable to complete container-managed transaction.; nested exception is: javax.transaction.SystemException
javax.transaction.SystemException
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:452)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy84.addDepartment(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)Means theres an error in XML/ABAP conversion probably due a syntax error...
Regards
Juan -
I would love some help with this issue. I have configured my SharePoint foundation 2010 site to use Claims Based Auth with Certificate authentication method with ADFS 2.0 I have a test account set up with lab.acme.com to use the ACS.
When I log into my site using Windows Auth, everything is great. However when I log in and select my ACS token issuer, I get sent, to the logon page of the ADFS, after selected the ADFS method. My browser prompt me which Certificate identity I want
to use to log in and after 3-5 second
and return me the logon page with error message “Authentication failed”
I base my setup on the technet article
http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx
I validated than all my certificate are valid and able to retrieve the crl
I got in eventlog id 300
The Federation Service failed to issue a token as a result of an error during processing of the WS-Trust request.
Request type: http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue
Additional Data
Exception details:
Microsoft.IdentityModel.SecurityTokenService.FailedAuthenticationException: MSIS3019: Authentication failed. ---> System.IdentityModel.Tokens.SecurityTokenValidationException:
ID4070: The X.509 certificate 'CN=Me, OU=People, O=Acme., C=COM' chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. 'A certification chain processed
correctly, but one of the CA certificates is not trusted by the policy provider.
at Microsoft.IdentityModel.X509CertificateChain.Build(X509Certificate2 certificate)
at Microsoft.IdentityModel.Tokens.X509NTAuthChainTrustValidator.Validate(X509Certificate2 certificate)
at Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler.ValidateToken(SecurityToken token)
at Microsoft.IdentityModel.Tokens.SecurityTokenElement.GetSubject()
at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
--- End of inner exception stack trace ---
at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.BeginGetScope(IClaimsPrincipal principal, RequestSecurityToken request, AsyncCallback callback, Object state)
at Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService.BeginIssue(IClaimsPrincipal principal, RequestSecurityToken request, AsyncCallback callback, Object state)
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.DispatchRequestAsyncResult..ctor(DispatchContext dispatchContext, AsyncCallback asyncCallback, Object asyncState)
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.BeginDispatchRequest(DispatchContext dispatchContext, AsyncCallback asyncCallback, Object asyncState)
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.ProcessCoreAsyncResult..ctor(WSTrustServiceContract contract, DispatchContext dispatchContext, MessageVersion messageVersion, WSTrustResponseSerializer responseSerializer, WSTrustSerializationContext
serializationContext, AsyncCallback asyncCallback, Object asyncState)
at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.BeginProcessCore(Message requestMessage, WSTrustRequestSerializer requestSerializer, WSTrustResponseSerializer responseSerializer, String requestAction, String responseAction, String
trustNamespace, AsyncCallback callback, Object state)
System.IdentityModel.Tokens.SecurityTokenValidationException: ID4070: The X.509 certificate 'CN=Me, OU=People, O=acme., C=com' chain building
failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. 'A certification chain processed correctly, but one of the CA certificates is not trusted by the policy provider.
at Microsoft.IdentityModel.X509CertificateChain.Build(X509Certificate2 certificate)
at Microsoft.IdentityModel.Tokens.X509NTAuthChainTrustValidator.Validate(X509Certificate2 certificate)
at Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler.ValidateToken(SecurityToken token)
at Microsoft.IdentityModel.Tokens.SecurityTokenElement.GetSubject()
at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
thx
Stef71This is perfectly correct on my case I was not adding the root properly you must add the CA and the ADFS as well, which is twice you can see below my results.
on my case was :
PS C:\Users\administrator.domain> $root = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\
cer\SP2K10\ad0001.cer")
PS C:\Users\administrator.domain> New-SPTrustedRootAuthority -Name "domain.ad0001" -Certificate $root
Certificate : [Subject]
CN=domain.AD0001CA, DC=domain, DC=com
[Issuer]
CN=domain.AD0001CA, DC=portal, DC=com
[Serial Number]
blablabla
[Not Before]
22/07/2014 11:32:05
[Not After]
22/07/2024 11:42:00
[Thumbprint]
blablabla
Name : domain.ad0001
TypeName : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
DisplayName : domain.ad0001
Id : blablabla
Status : Online
Parent : SPTrustedRootAuthorityManager
Version : 17164
Properties : {}
Farm : SPFarm Name=SharePoint_Config
UpgradedPersistedProperties : {}
PS C:\Users\administrator.domain> $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\
cer\SP2K10\ADFS_Signing.cer")
PS C:\Users\administrator.domain> New-SPTrustedRootAuthority -Name "Token Signing Cert" -Certificate $cert
Certificate : [Subject]
CN=ADFS Signing - adfs.domain
[Issuer]
CN=ADFS Signing - adfs.domain
[Serial Number]
blablabla
[Not Before]
23/07/2014 07:14:03
[Not After]
23/07/2015 07:14:03
[Thumbprint]
blablabla
Name : Token Signing Cert
TypeName : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
DisplayName : Token Signing Cert
Id : blablabla
Status : Online
Parent : SPTrustedRootAuthorityManager
Version : 17184
Properties : {}
Farm : SPFarm Name=SharePoint_Config
UpgradedPersistedProperties : {}
PS C:\Users\administrator.PORTAL> -
Using G_SET_GET_ALL_VALUES Method
Hi,
I need to use the following method. G_SET_GET_ALL_VALUES. But I'm not sure of the data type that it returns.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
CLIENT = ' '
FORMULA_RETRIEVAL = ' '
LEVEL = 0
setnr = wa_itab_progrp-setname
VARIABLES_REPLACEMENT = ' '
TABLE = ' '
CLASS = ' '
NO_DESCRIPTIONS = 'X'
NO_RW_INFO = 'X'
DATE_FROM =
DATE_TO =
FIELDNAME = ' '
tables
set_values = ????????
EXCEPTIONS
SET_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.
Can anyone please let me know what I should do at the SET_VALUES section.
Thanks
LilanHi,
See the FM Documentation,
This function module determines all the values of a set or its subordinate sets. The required call parameter is the set ID (SETNR). The other parameters are optional:
FORMULA_RETRIEVAL: 'X' => The formulas in the set are also returned (default ' ' requires fewer database accesses)
LEVEL: The default value is 0 and means "expand all levels". Values other than 0 determine the level to which they are to be expanded
VARIABLES_REPLACEMENT: 'X' => The value variables in the set hierarchy are replaced by their default values (this means additional database accesses for each variable)
NO_DESCRIPTIONS: 'X' => The short descriptions of the sets and set lines are not read from the database. For performance reasons you should only set this parameter to ' ' if you need the texts
The values determined are returned to the internal table SET_VALUES.
Thanks. -
Clearing values from request in decode method
I am using a custom table paginator. In its decode method I have the next code to control whether next link is clicked:
String pLink = (String)requestMap.get("pLink" + clientId);
if ((pLink != null) && (!pLink.equals(""))) {
if (pLink.equals("next")) {
} else if (pLink.equals("previous")) {
}But the next sequence produces some problems:
1. Initial page load.
2. Click on next link.
3. Table navigates ok to next page.
4. Reload page (push F5).
5. The previous click still remains in the request, so decode method think next link is pressed again.
6. Application abnormal behaviour arises.
So, I am trying to clear the next_link key from the request, but next code throws an UnsupportedOperationException:
String pLink = (String)requestMap.get("pLink" + clientId);
if ((pLink != null) && (!pLink.equals(""))) {
if (pLink.equals("next")) {
} else if (pLink.equals("previous")) {
requestMap.put("pLink" + clientId, "");
}Do any of you have some ideas?Hey, where are you RaymondDeCampo, rLubke, BalusC ... the masters of JSF Universe?
;-) -
Hi,
Is there a method that get the all the values of a row? I've gone through the java api but didn't found one, but wanted to be sure.
If not I'll have to do getValueAt for every column?
GrtzHere is one possible implementation using RowTableModel (a self made class).
To access a row, we can use this: Product product = (Product) model.getRow(rowIndex);
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.util.List;
public class Tabel extends JPanel {
private JTable table;
private JTextField filterText;
private TableRowSorter<MyTableModel> sorter;
private String output;
private final MyTableModel model;
public Tabel() {
//Create a table with a sorter.
model = new MyTableModel();
sorter = new TableRowSorter<MyTableModel>(model);
table = new JTable(model);
table.setRowSorter(sorter);
table.setPreferredScrollableViewportSize(new Dimension(500, 200));
table.setFillsViewportHeight(true);
//Single selection
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
//Making sure columns can't be dragged and dropped
table.getTableHeader().setReorderingAllowed(false);
//Double click event
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent mouseEvent) {
if (mouseEvent.getClickCount() == 2) {
System.out.print(output);
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this panel.
add(scrollPane);
JPanel form = new JPanel();
JLabel l1 = new JLabel("Filter Text:");
form.add(l1);
filterText = new JTextField(15);
//Whenever filterText changes, invoke newFilter.
filterText.getDocument().addDocumentListener(
new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
newFilter();
public void insertUpdate(DocumentEvent e) {
newFilter();
public void removeUpdate(DocumentEvent e) {
newFilter();
l1.setLabelFor(filterText);
form.add(filterText);
add(form);
* Update the row filter regular expression from the expression in
* the text box.
private void newFilter() {
RowFilter<MyTableModel, Object> rf = null;
//If current expression doesn't parse, don't update.
try {
rf = RowFilter.regexFilter("(?i)" + filterText.getText(), 0); //"(?i)" => Zoeken gebeurd case-insensitive
} catch (java.util.regex.PatternSyntaxException e) {
return;
sorter.setRowFilter(rf);
class MyTableModel extends RowTableModel {
private final List<Product> mData;
private final List<String> cNames;
public MyTableModel() {
super(Product.class);
mData = new ArrayList<Product>();
mData.add(new Product("Frontline Small", 5, 1));
mData.add(new Product("Frontline Medium", 10, 2));
mData.add(new Product("Frontline Large", 15, 1));
mData.add(new Product("Frontline Extra Large", 20, 2));
mData.add(new Product("Frontline spuitbus", 7.5, 3));
cNames = new ArrayList<String>();
cNames.add("Product");
cNames.add("Prijs");
cNames.add("Aantal stuks beschikbaar");
setDataAndColumnNames(mData, cNames);
setColumnClass(0, String.class);
setColumnClass(1, Double.class);
setColumnClass(2, Integer.class);
public Object getValueAt(final int rowIndex, final int columnIndex) {
switch (columnIndex) {
case 0:
return mData.get(rowIndex).getDescriction();
case 1:
return mData.get(rowIndex).getPrice();
case 2:
return mData.get(rowIndex).getNumber();
return null;
@Override
public Class getColumnClass(int column) {
return super.getColumnClass(column);
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
Tabel newContentPane = new Tabel();
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(final String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
class Product {
private String descriction;
private double price;
private int number;
Product(final String descriction, final double price, final int number) {
this.descriction = descriction;
this.price = price;
this.number = number;
public String getDescriction() {
return descriction;
public void setDescriction(final String descriction) {
this.descriction = descriction;
public int getNumber() {
return number;
public void setNumber(final int number) {
this.number = number;
public double getPrice() {
return price;
public void setPrice(final int price) {
this.price = price;
@Override
public String toString() {
return descriction + ", " + price + ", " + number;
} -
How can I move an ArrayList from one method to another?
As the subject reveals, I want to know how I move an ArrayList. In one method, I fill my ArrayList with objects, and in the next I want to pick an arbitrary object out of the ArrayList.
How do I make this work??You pass the same array list to both the method. Both method are getting the same thing.
void main(){
//create array list here
ArrayList aList = new ArrayList();
//pass it to a method to fill items
fillArrayList(aList);
//pass the same arraylist to another method
printArrayList(aList);
void fillArrayList(ArrayList list){
list.add("A");
void printArrayList(ArrayList list){
//The array list will contain A added by the previos method
System.out.println(list);
FeedFeeds : http://www.feedfeeds.com -
HT1918 Can I have multiple payment methods on one account
Currently, both of my teenage sons and I are sharing an Apple account with one payment method. I would like to have a payment method for each of us.
If they are teenagers, it is not too soon to set up individual accounts per person.
This will address the separate payments issue, and will make it much easier in a few years when they start heading off to university or moving to their own living arrangements. -
A method to convert an existing iCloud account to a Child iCloud Account for Family Sharing
I do not see any method by which to convert an existing iCloud account (we have three set up for our kids, all their birthdays are set later than their actual birthdays so we could grab their actual names before they were all gone years ago) to a new Child iCloud Account for use with Family Sharing (namely to be able to take advantage of the new features: Family Calendar, Photostream, 'Ask to Buy' on the Stores, etc. on their own iPad minis.
If this is just not possible under the current scheme, please oh please Apple make this an option - there are probably thousands of others in this same boat, and I refuse to give up my kids' iCloud accounts!I've read every string and workaround solution on these forums (to date). There's really no good options here.
USER STORY: My kid (age 7) has an iPad 2. I created an email address for him (which he doesn't know about). I created an apple ID for him (which he also doesn't know or care about) and I set up his Apple ID with my credit card. In addition I've set up parental controls on the iPad to lock it down and make it more age appropriate. Over the past year or so it's worked out fine, he sees something he might like, brings the iPad to me and if I approve, I enter the Apple ID Password and approve the purchase. After a year of doing this, he has a nice little collection of apps, kid songs, a few movies, etc. I would like to move my kid over to a legitimate kid account now that Apple has released features that support this. Currently the ability to convert an account does not exist. Seems like it should be easy to change a birthday, etc.
Almost seems like Apple is penalizing us for getting our kid an iPad last year.
Apple - Please consider my user story for your upcoming feature enhancements. -
How can i execute ejb method in a servlet?
hi
I am using a IBM HTTP Server and Weblogic Server.
I could execute below source in a main method of application but i could not that in a init method of servlet because of ClassCastException.
(a classpath of weblogic contains client's classpath)
// source code
Hashtable props = new Hashtable();
props.pu(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
props.put(Context.PROVIDER_URL,
"t3://192.168.1.5:7001");
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("session.LigerSessionHome");
LigerSessionHome home = (LigerSessionHome) PortableRemoteObject.narrow (obj, LigerSessionHome.class);
// error code
Exception : session.LigerSessionBeanHomeImpl_ServiceStub
java.lang.ClassCastException: session.LigerSessionBeanHomeImpl_ServiceStub
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:253)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
at credit.getCreditResearch(credit.java:41)
at creditResearchClient.doGet(creditResearchClient.java:122)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
thanksHave your stubs somehow got out of sync? So that your Servlet engine is pointing to a different jar than that of your jvm on which you were running your client application
hi
I am using a IBM HTTP Server and Weblogic Server.
I could execute below source in a main method of
application but i could not that in a init method of
servlet because of ClassCastException.
(a classpath of weblogic contains client's classpath)
// source code
Hashtable props = new Hashtable();
props.pu(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
props.put(Context.PROVIDER_URL,
"t3://192.168.1.5:7001");
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("session.LigerSessionHome");
LigerSessionHome home = (LigerSessionHome)
PortableRemoteObject.narrow (obj,
LigerSessionHome.class);
// error code
Exception :
session.LigerSessionBeanHomeImpl_ServiceStub
java.lang.ClassCastException:
session.LigerSessionBeanHomeImpl_ServiceStub
at
com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(Porta
leRemoteObject.java:253)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObj
ct.java:136)
at credit.getCreditResearch(credit.java:41)
at
creditResearchClient.doGet(creditResearchClient.java:12
at
javax.servlet.http.HttpServlet.service(HttpServlet.java
740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java
865)
thanks
Maybe you are looking for
-
Hi Expart, In ALV report ,what is the work of 1) REUSE_ALV_VARIANT_DEFAULT_GET function module 2) SLIS_LAYOUT_ALV Regards Bhabani
-
Re: How to restore data after HDD format?
hi, folks I need your help to restore some important data that gone after hdd formatting. I didn't make any backup that was my mistake. Everyone's help is appreciated. Thanks to all.
-
I changed my payment info and am unable to make in app purchases
I changed my payment info in my apple id and was unable to complete in app purchases for pharohs way slots game. I then changed my payment info back to the original details, and am still unable to purchase credits for the app. How do I fix this probl
-
DELL 2500 - freeze! v early in boot-latest kernel 'iomem', 'prefetch'
Hi everyone....! Well, a problem is an opportunity right!!? :--) Here's the short version: All fine on the old Dell Inspiron 2500, 1 ghz PIII intel basically UNTIL an -Syu a couple of weeks ago. It was time to wipe the old test laptop anyways so now
-
LDAP Replication - Two suppliers no consumers
Simply put I just want to set up a load balanced LDAP environment where any two servers could be leveraged for updaing or querying. Is this the same thing as setting up a multi-master replication but with no consumer configuration?