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
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
669 | <b>easy abap 소스 전체 파일 입니다. [188] | sapjoy | 2008.05.01 | 10120 |
668 | REPORT z18_033 [47] | sapjoy | 2008.10.13 | 9031 |
667 | REPORT Z15_003 [49] | sapjoy | 2008.04.15 | 7498 |
666 | report zunicode_027. [4] | sapjoy | 2008.11.21 | 6262 |
665 | REPORT Z20_01. | sapjoy | 2012.08.01 | 5056 |
664 | REPORT z18_03. | sapjoy | 2012.08.01 | 4552 |
663 | Z01_012 [9] | sapjoy | 2006.12.02 | 4543 |
662 | Z_EXPORT_GRAPHIC_FROM_SE78 [1] | sapjoy | 2011.03.28 | 4443 |
661 | report zsapdoi_002. | sapjoy | 2008.12.26 | 4405 |
660 | REPORT zsmw0010 | sapjoy | 2010.10.11 | 4313 |
659 | REPORT z18_028 | sapjoy | 2007.04.09 | 4278 |
658 | report zsalv_045 . | sapjoy | 2010.08.20 | 4262 |
657 | Dynamic Table Maintenance [1] | sapjoy | 2006.12.04 | 4093 |
656 | REPORT ZTABLE_UTIL | sapjoy | 2010.10.09 | 4010 |
655 | REPORT Z19_02. | sapjoy | 2012.08.01 | 3921 |
654 | report zsaptip_009 [1] | sapjoy | 2010.12.10 | 3852 |
653 | INCLUDE ZXF04U01 | sapjoy | 2008.12.15 | 3695 |
652 | REPORT ZTEST_ABAPTPDF | sapjoy | 2010.10.09 | 3691 |
651 | REPORT Z_3DGRAPH. [1] | sapjoy | 2010.10.17 | 3659 |
650 | REPORT zfalv_011. | sapjoy | 2011.02.16 | 3624 |