zoukankan      html  css  js  c++  java
  • abap 动态生成alv列

    ZRP_FI007_A

    PERFORM F_INPUT_FIELDCAT USING:
    'A' '列1',
    'B' '列2',
    'C' '列3'.

    *如果不等于0就输出列4
    sort gt_tab by 列4.
    read table gt_tab with key 列4 = 0 BINARY SEARCH. “二分法检索,可查看博客
    IF sy-subrc <> 0.
    PERFORM F_INPUT_FIELDCAT USING 'D' '列4'.
    endif.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT_LVC = WS_LAYOUT
    IT_FIELDCAT_LVC = WS_FIELDCAT
    TABLES
    T_OUTTAB = GT_TAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.

    *&---------------------------------------------------------------------*
    *& Form F_INPUT_FIELDCAT
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * -->VALUE(P_FIELD) text
    * -->VALUE(P_NAME) text
    *----------------------------------------------------------------------*
    FORM F_INPUT_FIELDCAT USING VALUE(P_FIELD)
    VALUE(P_NAME).
    DATA: ST_FIELDCAT TYPE LVC_S_FCAT.
    ST_FIELDCAT-FIELDNAME = P_FIELD.
    ST_FIELDCAT-SCRTEXT_M = P_NAME.
    APPEND ST_FIELDCAT TO WS_FIELDCAT.
    CLEAR ST_FIELDCAT.
    ENDFORM. "F_INPUT_FIELDCAT

     

  • 相关阅读:
    Flask框架学习教程 汇总篇
    git版本管理工具
    Django-rest framework框架 汇总篇
    数据库学习之路 汇总篇
    Web后端开发学习教程 汇总篇
    Django框架学习教程 汇总篇
    Web前端开发学习教程 汇总篇
    Python开发之爬虫 汇总篇
    Python从入门到放弃 汇总篇
    flask之SQLAlchemy
  • 原文地址:https://www.cnblogs.com/springzt/p/3219641.html
Copyright © 2011-2022 走看看