SAP TREE(转)

这篇报告展示了如何使用 SAP GUI ALV Tree 控件构建层级结构。注意,不能使用简单的 ALV Tree 控件来构建这个层级,因为无法通过排序定义月份级别的顶级节点。报告还提到,此示例没有进行初始计算或特殊布局,并未隐藏输出表中的列,但演示了构建和填充树结构的基本步骤。
摘要由CSDN通过智能技术生成
导读:
  REPORT BCALV_TREE_01.
  *&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  * Purpose:
  * ~~~~~~~~
  * This report shows the essential steps to build up a hierarchy
  * using an ALV Tree Control (class CL_GUI_ALV_TREE).
  * Note that it is _not_ possible to build up this hierarchy
  * using a simple ALV Tree Control (class CL_GUI_ALV_TREE_SIMPLE).
  *-----------------------------------------------------------------
  * To check program behavior
  * ~~~~~~~~~~~~~~~~~~~~~~~~~
  * Start this report. The hierarchy tree consists of nodes for each
  * month on top level (this level can not be build by a simple ALV Tree
  * because there is no field for months in our output table SFLIGHT.
  * Thus, you can not define this hierarchy by sorting).
  * Nor initial calculations neither a special layout has been applied
  * (the lines on the right do not show anything).
  * Note also that this example does not build up and change the
  * fieldcatalog of the output table. For this reason, _all_ fields
  * of the output table are shown in the columns although the fields
  * CARRID and FLDATE are already placed in the tree on the left.
  * (Of course, this is not a good style. See BCALV_TREE_02 on how to
  * hide columns).
  *-------------------------------------------------------------------
  * Essential steps (Search for ')
  * ~~~~~~~~~~~~~~~
  * 1.Usual steps when using control technology.
  * 1a. Define reference variables.
  * 1b. Create ALV Tree Control and corresponding container.
  *
  * 2.Create Hierarchy-header
  * 3.Create empty Tree Control
  * 4.Create hierarchy (nodes and leaves)
  * 4a. Select data
  * 4b. Sort output table according to your conceived hierarchy
  * 4c. Add data to tree
  *
  * 5.Send data to frontend.
  * 6.Call dispatch to process toolbar functions
  *
  *&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
   * 1a. Define reference variables
   * 定义关键使用的 ALV 的类 . 和自定义的容器
  DATA: G_ALV_TREE TYPE REF TO CL_GUI_ALV_TREE,
  G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
  *定义输出的表结构
  DATA: GT_SFLIGHT TYPE SFLIGHT OCCURS 0, "Output-Table
  OK_CODE LIKE SY-UCOMM,
  SAVE_OK LIKE SY-UCOMM, "OK-Code
  G_MAX TYPE I VALUE 255.
  END-OF-SELECTION.
  CALL SCREEN 100.
  *&---------------------------------------------------------------------*
  *& Module PBO OUTPUT
  *&---------------------------------------------------------------------*
  * process before output
  *----------------------------------------------------------------------*
  MODULE PBO OUTPUT.
  SET PF-STATUS 'MAIN100'.
  SET TITLEBAR 'MAINTITLE'.
  IF G_ALV_TREE IS INITIAL.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值