REPORT z18_01.
TYPES: node_table_type LIKE STANDARD TABLE OF mtreesnode
WITH DEFAULT KEY.
DATA : tree_con_ref TYPE REF TO cl_gui_custom_container.
DATA : g_tree TYPE REF TO cl_gui_simple_tree.
DATA : con1_ref TYPE REF TO cl_gui_custom_container.
DATA : g_grid TYPE REF TO cl_gui_alv_grid.
DATA : gs_variant TYPE disvariant.
DATA : gt_sflight TYPE TABLE OF sflight.
DATA : ok_code TYPE sy-ucomm.
START-OF-SELECTION.
SELECT * FROM sflight
INTO TABLE gt_sflight UP TO 25 ROWS.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module INIT_CON OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE init_con OUTPUT.
IF con1_ref IS INITIAL.
CREATE OBJECT con1_ref
EXPORTING
container_name = 'CON1'.
CREATE OBJECT g_grid
EXPORTING
i_parent = con1_ref.
ENDIF.
gs_variant-report = sy-repid.
gs_variant-username = sy-uname.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
is_variant = gs_variant
i_save = ''
CHANGING
it_outtab = gt_sflight.
ENDMODULE. " INIT_CON OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
IF ok_code = 'BACK'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS '100_STATUS'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module INIT_TREE OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module INIT_TREE output.
IF g_tree IS INITIAL.
DATA: node_table TYPE node_table_type.
DATA : events TYPE cntl_simple_events,
event TYPE cntl_simple_event.
CREATE OBJECT tree_con_ref
EXPORTING
container_name = 'TREE_CONTAINER'.
* create a tree control
CREATE OBJECT g_tree
EXPORTING
parent = tree_con_ref
" single node selection is used
node_selection_mode = cl_gui_simple_tree=>node_sel_mode_single.
PERFORM build_node_table USING node_table.
* node_table_structure_name = 'MTREESNODE'
CALL METHOD g_tree->add_nodes
EXPORTING
table_structure_name = 'MTREESNODE'
node_table = node_table.
* define the events which will be passed to the backend
event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
event-appl_event = 'X'. " process PAI if event occurs
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.
ENDIF.
endmodule. " INIT_TREE OUTPUT
*&---------------------------------------------------------------------*
*& Form BUILD_NODE_TABLE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_NODE_TABLE text
*----------------------------------------------------------------------*
FORM build_node_table
USING
node_table TYPE node_table_type.
DATA: node LIKE mtreesnode.
CLEAR node.
node-node_key = 'Root'.
node-isfolder = 'X'. " a folder.
node-text = 'AIRPLANE'.
APPEND node TO node_table.
CLEAR node.
node-node_key = 'Child1'.
node-relatkey = 'Root'.
node-isfolder = 'X'.
node-text = 'CARRID'.
node-expander = 'X' .
APPEND node TO node_table.
CLEAR node.
node-node_key = 'AA'.
node-relatkey = 'Child1'.
node-n_image = '@10@'.
node-text = 'AA'.
APPEND node TO node_table.
CLEAR node.
node-node_key = 'AZ'.
node-relatkey = 'Child1'.
NODE-style = CL_GUI_SIMPLE_TREE=>style_emphasized.
node-text = 'AZ'.
APPEND node TO node_table.
CLEAR node.
node-node_key = 'DL'.
node-relatkey = 'Child1'.
node-expander = ' '.
* NODE-HIDDEN = ' '.
node-disabled = 'X'.
NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.
node-text = 'DL'.
APPEND node TO node_table.
ENDFORM. " build_node_table
form refresh_grid .
DATA : l_scroll TYPE lvc_s_stbl.
l_scroll-row = 'X'.
l_scroll-col = 'X'.
CALL METHOD g_grid->refresh_table_display
EXPORTING
i_soft_refresh = ''
is_stable = l_scroll.
endform. " refresh_grid
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
671 | 직원 데이터 [1] | sapjoy | 2024.07.02 | 241 |
670 | REPORT Z99_24. | sapjoy | 2024.05.21 | 83 |
669 | REPORT Z06_01. | sapjoy | 2024.04.21 | 60 |
668 | REPORT z05_36 | sapjoy | 2023.02.08 | 270 |
667 | API | sapjoy | 2022.11.03 | 351 |
666 | z15_21_drag | sapjoy | 2022.02.24 | 307 |
665 | Z18_06_DRAGCLASS | sapjoy | 2022.02.23 | 334 |
664 | REPORT Z21_01 | sapjoy | 2015.10.28 | 2276 |
663 | subroutine pool | sapjoy | 2013.11.16 | 3314 |
662 | REPORT Z20_01. | sapjoy | 2012.08.02 | 5097 |
661 | REPORT Z19_02. | sapjoy | 2012.08.02 | 3953 |
660 | REPORT z19_01. | sapjoy | 2012.08.02 | 3559 |
659 | REPORT z18_06. | sapjoy | 2012.08.02 | 3195 |
658 | REPORT z18_05 | sapjoy | 2012.08.02 | 3384 |
657 | REPORT z18_04 . | sapjoy | 2012.08.02 | 3388 |
656 | REPORT z18_03. | sapjoy | 2012.08.02 | 4598 |
655 | REPORT z18_02. | sapjoy | 2012.08.02 | 3124 |
» | REPORT z18_01. | sapjoy | 2012.08.02 | 3152 |
653 | REPORT z17_23 | sapjoy | 2012.08.02 | 2538 |
652 | REPORT z17_22 | sapjoy | 2012.08.02 | 2307 |