欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

在alv list小计之后输出分割线

发布时间:2025/3/20 编程问答 52 豆豆
生活随笔 收集整理的这篇文章主要介绍了 在alv list小计之后输出分割线 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
程序代码:
  • *---type pools
  • TYPE-POOLS: slis.
  • *---internal tables
  • DATA: BEGIN OF it_flight OCCURS 0,
  •        carrid  LIKE sflight-carrid,
  •        connid   LIKE sflight-connid,
  •        fldate   LIKE sflight-fldate,
  •        seatsmax LIKE sflight-seatsmax,
  •        seatsocc LIKE sflight-seatsocc,
  •       END OF it_flight,
  • *--internal tables for ALV
  •       it_fieldcat TYPE  slis_t_fieldcat_alv,
  •       wa_fcat LIKE LINE OF it_fieldcat,
  •       layout TYPE  slis_layout_alv,
  •       it_sort type  slis_t_sortinfo_alv,
  •       wa_sort like line of it_sort.
  • *---start-of-selection .
  • START-OF-SELECTION.
  • CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  •   EXPORTING
  •     i_program_name         = sy-repid
  •     i_internal_tabname     = 'IT_FLIGHT'
  •     i_inclname             = sy-repid
  •   CHANGING
  •     ct_fieldcat            = it_fieldcat
  •   EXCEPTIONS
  •     inconsistent_interface = 1
  •     program_error          = 2.
  • *----get data
  •   SELECT carrid
  •          connid
  •          fldate
  •          seatsmax
  •          seatsocc
  •    FROM sflight
  •    INTO CORRESPONDING FIELDS OF TABLE it_flight
  •    UP TO 20 ROWS.
  •   .
  •   wa_fcat-do_sum = 'X'.
  •   MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
  •    WHERE fieldname = 'SEATSOCC' .
  •   wa_sort-fieldname = 'CARRID'.
  •   wa_sort-group = 'UL'.  "显示分割线
  •   wa_sort-up = 'X'.
  •   APPEND wa_sort TO it_sort.
  •   wa_sort-fieldname = 'CONNID'.
  •   wa_sort-subtot = 'X'.
  •   wa_sort-up = 'X'.
  •   APPEND wa_sort TO it_sort.

  •   CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  •     EXPORTING
  •       i_callback_program = sy-repid
  •       is_layout          = layout
  •       it_fieldcat        = it_fieldcat
  •       it_sort            = it_sort
  •     TABLES
  •       t_outtab           = it_flight
  •     EXCEPTIONS
  •       program_error      = 1.
  • 复制代码

    程序执行效果:
    与50位技术专家面对面20年技术见证,附赠技术全景图

    总结

    以上是生活随笔为你收集整理的在alv list小计之后输出分割线的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。