ITPub博客

首页 > Linux操作系统 > Linux操作系统 > List输出树型结构

List输出树型结构

原创 Linux操作系统 作者:hzq2010 时间:2011-03-14 00:18:00 0 删除 编辑
 
 
REPORT  Ztree_TEST_demo.
Type-pools : fibs,stree.
data : t_node type snodetext.
data : node_tab like t_node occurs 0 with header line.
clear : node_tab, node_tab[].
node_tab-type = 'T'.
node_tab-name = 'Earth'.
node_tab-tlevel = '01'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'Europe'.
node_tab-tlevel = '02'.
node_tab-nlength = '6'.
node_tab-color = '1'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 4.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'Germany'.
node_tab-tlevel = '03'.
node_tab-nlength = '7'.
node_tab-color = '4'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 4.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'Berlin'.
node_tab-tlevel = '04'.
node_tab-nlength = '6'.
node_tab-color = '4'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'Asia'.
node_tab-tlevel = '02'.
node_tab-nlength = '4'.
node_tab-color = '1'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'India'.
node_tab-tlevel = '03-'.
node_tab-nlength = '5'.
node_tab-color = '1'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'Bombay'.
node_tab-tlevel = '04-'.
node_tab-nlength = '6'.
node_tab-color = '1'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.

node_tab-type = 'P'.
node_tab-name = 'America'.
node_tab-tlevel = '02'.
node_tab-nlength = '4'.
node_tab-color = '1'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'USA'.
node_tab-tlevel = '03-'.
node_tab-nlength = '5'.
node_tab-color = '1'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 3.
append node_tab.
clear node_tab.
CALL FUNCTION 'RS_TREE_CONSTRUCT'
* EXPORTING
*   INSERT_ID                = '000000'
*   RELATIONSHIP             = ' '
*   LOG                      =
  TABLES
    NODETAB                  = node_tab
* EXCEPTIONS
*   TREE_FAILURE             = 1
*   ID_NOT_FOUND             = 2
*   WRONG_RELATIONSHIP       = 3
*   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 FUNCTION 'RS_TREE_LIST_DISPLAY'
 EXPORTING
*   CALLBACK_PROGRAM                =
*   CALLBACK_USER_COMMAND           =
*   CALLBACK_TEXT_DISPLAY           =
*   CALLBACK_MOREINFO_DISPLAY       =
*   CALLBACK_COLOR_DISPLAY          =
*   CALLBACK_TOP_OF_PAGE            =
*   CALLBACK_GUI_STATUS             =
*   CALLBACK_CONTEXT_MENU           =
*   STATUS                          = 'IMPLICIT'
*   CHECK_DUPLICATE_NAME            = '1'
*   COLOR_OF_NODE                   = '4'
*   COLOR_OF_MARK                   = '3'
*   COLOR_OF_LINK                   = '1'
*   COLOR_OF_MATCH                  = '5'
*   LOWER_CASE_SENSITIVE            = ' '
*   MODIFICATION_LOG                = ' '
*   NODE_LENGTH                     = 30
*   TEXT_LENGTH                     = 75
*   TEXT_LENGTH1                    = 0
*   TEXT_LENGTH2                    = 0
*   RETURN_MARKED_SUBTREE           = ' '
*   SCREEN_START_COLUMN             = 0
*   SCREEN_START_LINE               = 0
*   SCREEN_END_COLUMN               = 0
*   SCREEN_END_LINE                 = 0
*   SUPPRESS_NODE_OUTPUT            = ' '
*   LAYOUT_MODE                     = ' '
*   USE_CONTROL                     = STREE_USE_LIST
   USE_CONTROL                     = 'L'.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23495244/viewspace-689324/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-03-11

  • 博文量
    196
  • 访问量
    171711