• ABAP alv输出的方式


    1. FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_callback_program       = sy-repid
          is_layout_lvc            = gs_layout
          it_fieldcat_lvc          = gt_fieldcat[]
    *     i_grid_settings          = ls_glay
           i_callback_pf_status_set    = 'FM_SET_STATUS'
          i_callback_user_command  = 'FRM_UCOMM'
          i_default                = 'X'
          i_save                   = 'A'
          it_excluding             = it_exclude
          it_event_exit            = gt_event_exit[]
    *     i_grid_title             = r_title
          is_variant                  = gs_alv_variant
        TABLES
          t_outtab                 = gt_out
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.

    2. FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    * I_INTERFACE_CHECK = ' '
    * I_BYPASSING_BUFFER = ' '
    * I_BUFFER_ACTIVE = ' '

    i_callback_program = sy-repid

    i_callback_pf_status_set = 'FM_FULLSCREEN'

    i_callback_user_command = 'ALV_COMMADN'

    * I_CALLBACK_TOP_OF_PAGE = ' '
    * I_CALLBACK_HTML_TOP_OF_PAGE = ' '

    * I_CALLBACK_HTML_END_OF_LIST = ' '
    * I_STRUCTURE_NAME =
    * I_BACKGROUND_ID = ' '
    * I_GRID_TITLE =
    * I_GRID_SETTINGS =
    is_layout = lt_layo
    it_fieldcat = t_zsdr059
    it_excluding = it_exclude
    * IT_SPECIAL_GROUPS =
    * IT_SORT =
    * IT_FILTER =
    * IS_SEL_HIDE = * I_DEFAULT = 'X'
    i_save = 'A'
    * IS_VARIANT =
    it_events = git_events
    * IT_EVENT_EXIT =
    * IS_PRINT =
    * IS_REPREP_ID =
    * I_SCREEN_START_COLUMN = 0
    * I_SCREEN_START_LINE = 0
    * I_SCREEN_END_COLUMN = 0
    * I_SCREEN_END_LINE = 0
    * I_HTML_HEIGHT_TOP = 0
    * I_HTML_HEIGHT_END = 0
    * IT_ALV_GRAPHICS =
    * IT_HYPERLINK =
    * IT_ADD_FIELDCAT =
    * IT_EXCEPT_QINFO =
    * IR_SALV_FULLSCREEN_ADAPTER =
    * IMPORTING
    * E_EXIT_CAUSED_BY_CALLER =
    * ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = it_zsdr059
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    一般调用:

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_structure_name   = 'KKBCS'
          it_fieldcat        = lt_field
          is_layout          = gs_layout
          i_callback_program = sy-repid
          i_grid_title       = ''
        TABLES
          t_outtab           = gt_kkbcs[]

    3.OO方式的alv:set_table_for_first_display

    ls_variant-report = sy-repid.
     
    CALL METHOD gc_alvgrid->set_table_for_first_display
        EXPORTING
          is_layout       = ls_layout
          i_save          = 'A'          "设置成A
           is_variant       = ls_variant   "这个参数也必须输入
        CHANGING
          it_outtab       = git_item[]
          it_fieldcatalog = git_fieldcat[].

    4.FUNCTION 'LVC_FIELDCATALOG_MERGE' 根据表结构生成fieldcat

    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'ZSSD028'
        CHANGING
          ct_fieldcat            = gt_fieldcatalog[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
  • 相关阅读:
    linux中的umask命令
    The meaning of the number displayed on the man page in Linux
    Runlevel in Linux
    C语言指针与指向指针的指针
    JS函数、变量作用域
    JS对象、数据类型区别、函数
    JavaScript基础
    DOM
    HTML色码表
    GIT
  • 原文地址:https://www.cnblogs.com/ybinlog/p/11174994.html
Copyright © 2020-2023  润新知