• [转]Draw a box with title


    在abap报表的第二画面画一个带title的方框,这个功能在我们编写报表的时候会经常地用到。所以偶就拿出来,省得以后用到的时候找不到了,同时也能带给大家方便。

    REPORT ZBOX NO STANDARD PAGE HEADING.
    PERFORM BOX USING 1 2 'TITLE1'.
    PERFORM BOX USING 5 4 'TITLE2'.
    PERFORM BOX USING 11 7 'TITLE3'.
    PERFORM BOX USING 20 7 'TITLE4'.
    *---------------------------------------------------------------------*
    * FORM BOX                                                            *
    * Draw a box with title                                               *
    *    YPOS:   y coordinate of the upper left corner                    *
    *    HEIGHT: height of the box                                        *
    *    TEXT:   the title of te box                                      *
    *---------------------------------------------------------------------*
    FORM BOX USING VALUE(YPOS) HEIGHT TEXT.
    *
      DATA: WIDTH TYPE I VALUE 84,
            R TYPE I, K TYPE I.
    * Bottom horizontal line
      R = HEIGHT + YPOS.
      SKIP TO LINE R.
      DO WIDTH TIMES.
        WRITE '-' NO-GAP.
      ENDDO.
    * Top horizontal line with text
      K = STRLEN( TEXT ).
      R = WIDTH - 2 - K.
      SKIP TO LINE YPOS.
      WRITE:  '--'.
      WRITE AT 3(K) TEXT NO-GAP.
      DO R TIMES.
        WRITE:  '-' NO-GAP.
      ENDDO.
    * Vertical lines
      DO HEIGHT TIMES.
        SKIP TO LINE YPOS.
        WRITE: '|'. POSITION WIDTH. WRITE: '|'.
        YPOS = YPOS + 1.
      ENDDO.
    ENDFORM.

  • 相关阅读:
    Linux命令-查看进程
    Linux命令-查看内存
    Linux命令---vim
    oracle分页查询按日期排序失败问题
    oracle使用between and边界问题
    给大家介绍一个自我感觉好用的网站
    想学习一下微服务
    oracle获取年、月、日
    mybatis返回map结果集
    修改表中列
  • 原文地址:https://www.cnblogs.com/wequst/p/1513869.html
Copyright © 2020-2023  润新知