zoukankan      html  css  js  c++  java
  • 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色

    REPORT  ydemo_rick_a .
    TYPE-POOLS: slis.
    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,
           color TYPE lvc_t_scol,
          END OF it_flight.
    DATA: it_fieldcat TYPE  slis_t_fieldcat_alv,
          layout TYPE  slis_layout_alv.
    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.
    SELECT  carrid
           connid
           fldate
           seatsmax
           seatsocc
    FROM sflight
    INTO CORRESPONDING FIELDS OF TABLE it_flight
    UP TO 20 ROWS.
    DATA: col TYPE lvc_s_scol,
          coltab TYPE lvc_t_scol,
    color TYPE lvc_s_colo.
    color-col = '6'.
    color-int = '0'.
    color-inv = '0'.
    LOOP AT it_flight.
      IF it_flight-seatsocc EQ 0.
        col-fname = 'SEATSOCC'.
        col-color = color.
        APPEND col TO coltab.
        CLEAR col.
        it_flight-color = coltab.
        MODIFY  it_flight.
      ENDIF.
    ENDLOOP.
    layout-coltab_fieldname = 'COLOR'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program = sy-repid
        is_layout          = layout
        it_fieldcat        = it_fieldcat
      TABLES
        t_outtab           = it_flight
      EXCEPTIONS
        program_error      = 1.

  • 相关阅读:
    树上点对统计poj1741(树的点分治)
    hdu5115(区间dp)
    bestcoder Round#52 1001(最短路+状压dp)
    lightoj1038(期望dp)
    模线性方程组
    hdu2089 数位dp
    poj2955括号匹配 区间DP
    poj1417 带权并查集 + 背包 + 记录路径
    poj1984 带权并查集(向量处理)
    zoj3261 并查集离线处理
  • 原文地址:https://www.cnblogs.com/ruingy/p/3454523.html
Copyright © 2011-2022 走看看