VL06O报表添加增强字段

业务描述

用户需要在VL06O事务代码下进行批量交货过账,现有的筛选条件不太适用当前公司的业务,需要在报表中新增三个交货单增强字段,方便其筛选(选择屏幕没有加,用户在报表里用标准按钮功能自己筛选)

效果展示

VL06O报表添加增强字段_第1张图片

操作步骤

1、扩展LIPOV结构字段

VL06O报表添加增强字段_第2张图片

VL06O报表添加增强字段_第3张图片扩展完之后系统会自动带出likp增强字段,如果没有别的表字段就可以结束了

如果有别的表的增强字段

在DisplayALV之前把字段加到gt_outtab中即可

方法1:隐式增强->LV50QF1W->list_display_basic_list

form list_display_basic_list.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form LIST_DISPLAY_BASIC_LIST, Start                                                                                                               A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1  ZCL_VL06O_UPDATE.    "active version
*
  SELECT vbeln ,posnr ,zjqbm FROM lips
    INTO TABLE @DATA(ltt_lips)
    FOR ALL ENTRIES IN @gt_outtab
    WHERE vbeln = @gt_outtab-vbeln .
  SORT ltt_lips BY vbeln .
  LOOP AT gt_outtab ASSIGNING FIELD-SYMBOL() .
    READ TABLE ltt_lips INTO DATA(lss_lips) WITH KEY vbeln = -vbeln BINARY SEARCH.
    IF sy-subrc = 0 .
      -zjqbm = lss_lips-zjqbm .
      CLEAR : lss_lips .
    ENDIF .
  ENDLOOP .
ENDENHANCEMENT.
*$*$-End:   (1)---------------------------------------------------------------------------------$*$*

  data: lf_save_alv_variant type c value 'A'.
  data: lt_events type slis_t_event,                        "v_n_544950
        ls_event  type slis_alv_event.

  ls_event-name = 'TOP_OF_PAGE'.
  ls_event-form = 'TOP_OF_PAGE'.
  append ls_event to lt_events.                             "^_n_544950

  perform variant_authority_check changing lf_save_alv_variant.

  if gf_list_category+1(1) eq 'G'.
    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        i_buffer_active          = ''                         "n_1565980
        i_callback_program       = gf_callback_program
        i_callback_pf_status_set = gf_status
        i_callback_user_command  = gf_user_command
        i_structure_name         = 'LIPOV'
        is_layout                = gs_layout
        it_fieldcat              = gt_fieldcat
        it_sort                  = gt_sort
        i_save                   = lf_save_alv_variant  "50A
        is_variant               = gs_variant
      tables
        t_outtab                 = gt_outtab
      exceptions
        program_error            = 1
        others                   = 2.
    if sy-subrc <> 0.
     message e500 with 'Error: LIST_DISPLAY_BASIC_LIST'.    "#EC NOTEXT
    endif.
  else.
    call function 'REUSE_ALV_LIST_DISPLAY'
      exporting
        i_buffer_active          = ''                         "n_1565980
        i_callback_program       = gf_callback_program
        i_callback_pf_status_set = gf_status
        i_callback_user_command  = gf_user_command
        i_structure_name         = 'LIPOV'
        is_layout                = gs_layout
        it_fieldcat              = gt_fieldcat
        it_events                = lt_events                "n_544950
        it_sort                  = gt_sort
        i_save                   = lf_save_alv_variant  "50A
        is_variant               = gs_variant
      tables
        t_outtab                 = gt_outtab
      exceptions
        program_error            = 1
        others                   = 2.
    if sy-subrc <> 0.
     message e500 with 'Error: LIST_DISPLAY_BASIC_LIST'.    "#EC NOTEXT
    endif.
  endif.

endform.                               " LIST_DISPLAY_BASIC_LIST

方法2:SMOD->V50Q0001->EXIT_SAPLV50Q_001

同样的方法给ct_postab中添加值

如果业务非要在选择屏幕加的话也可以,选择屏幕在一个INCLUDE里,里面也有隐式增强点,完事在DisplayALV之前在做一个筛选就行

你可能感兴趣的:(笔记,经验分享,ABAP,SAP)