zoukankan      html  css  js  c++  java
  • Simple ALV with custom table

      REPORT  ZTESTFORGG_OOALV_NO_CONTAINER.
    tables sflight.
    data: begin of test,
          f1(10) type C,
          f2(10) type C,
        end of test.
    data: it_out like standard table of test,
          wa_out like line of it_out.
    data: f_cat type lvc_t_fcat,
          wa_f_cat type lvc_s_fcat.
    data: it_sflight type standard table of sflight.
    start-of-selection.
    select from sflight into table it_sflight up to 100 rows.
    wa_out-f1 = 'gaivn'.
    wa_out-f2 = 'test'.
    append wa_out to it_out.
    wa_out-f1 = 'gaivn2'.
    wa_out-f2 = 'test2'.
    append wa_out to it_out.
      wa_f_cat-FIELDNAME = 'F1'.
      wa_f_cat-SCRTEXT_L = 'Type'.
      wa_f_cat-SCRTEXT_M = 'Type'.
      wa_f_cat-SCRTEXT_S = 'Type'.
      append wa_f_cat to f_cat.
      wa_f_cat-FIELDNAME = 'F2'.
      wa_f_cat-SCRTEXT_L = 'Message'.
      wa_f_cat-SCRTEXT_M = 'Message'.
      wa_f_cat-SCRTEXT_S = 'Message'.
      append wa_f_cat to f_cat.

    data: l_alv type ref to cl_gui_alv_grid.
    create object l_alv
    exporting
      i_parent = cl_gui_container=>screen0.
    call method l_alv->set_table_for_first_display
    exporting
      i_structure_name = 'test'
    changing
      it_fieldcatalog = f_cat
      it_outtab = it_out.
    write: ''.

    结尾的write很重要,没有的话不会显示。

  • 相关阅读:
    各种平衡树板子
    字符串板子
    数学公式/定理/板子整理
    线性筛 板子整理
    set乱搞时需注意的坑点
    可持久化数据结构板子整理(可持久化 线段树/字典树/可并堆)
    洛谷p2483 模板k短路 可持久化可并堆
    p4929 DLX舞蹈链
    百度ai 图像增强与特效
    百度ai php请求获取access_token返回false
  • 原文地址:https://www.cnblogs.com/yanluckly/p/1783738.html
Copyright © 2011-2022 走看看