码迷,mamicode.com
首页 > 其他好文 > 详细

VL01N/VL02N/VL03N项目的屏幕增强

时间:2019-08-08 13:02:15      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:field   type   alt   bsp   目的   spl   检验   输出   sele   

VL01N/VL02N/VL03N项目的屏幕增强

步骤:

1.在表lips中加入附加结构并激活:

技术图片

2.SE80新建功能组ZFG_DELIVERY_ENHC:

  (1)创建功能模块ZSET_DELIVERY_ITEM_SCRN_VAL以获取主程序数据:

技术图片

FUNCTION ZSET_DELIVERY_ITEM_SCRN_VAL.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  IMPORTING
*"     REFERENCE(I_LIPS) TYPE  LIPS
*"----------------------------------------------------------------------

  gv_prueflos = i_lips-prueflos.
  gv_vcode    = i_lips-vcode.

  si_lips = i_lips.

ENDFUNCTION.

  (2)创建功能模块ZGET_DELIVERY_ITEM_SCRN_VAL将数据输出给主程序:

 技术图片

FUNCTION ZGET_DELIVERY_ITEM_SCRN_VAL.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  EXPORTING
*"     REFERENCE(E_LIPS) TYPE  LIPS
*"----------------------------------------------------------------------

  e_lips-prueflos = gv_prueflos.
  e_lips-vcode    = gv_vcode.

  so_lips = e_lips.

ENDFUNCTION.

  (3)创建屏幕1001

技术图片

技术图片

*----------------------------------------------------------------------*
***INCLUDE LZFG_DELIVERY_ENHCO01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  GET_ITEM  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE GET_ITEM OUTPUT.
  DATA scr_vbeln TYPE lips-vbeln.
  DATA scr_posnr TYPE char6.

*  取使用决策描述
  DATA vcodetxt  TYPE qpct-kurztext.
  DATA ls_qals   TYPE qals.
  DATA ls_qave   TYPE qave.
  DATA ls_qpac   TYPE qpac.
  DATA ls_qpct   TYPE qpct.
*  BREAK ybin.

* ----- 屏幕vbeln
  scr_vbeln = si_lips-vbeln.

* ----- 屏幕posnr
  scr_posnr = si_lips-posnr.

* ----- 屏幕prueflos
  lips-prueflos = si_lips-prueflos.

* ----- 屏幕vcode
  lips-vcode    = si_lips-vcode.

* ----- 屏幕使用决策描述:vcodetxt
  CLEAR: ls_qals, ls_qave, ls_qpac, ls_qpct.
*  取qals
  SELECT SINGLE *
    INTO CORRESPONDING FIELDS OF ls_qals
    FROM qals
    WHERE prueflos = lips-prueflos
      AND art      = Z03
      AND herkunft = 10.

*  取qave
  IF ls_qals IS NOT INITIAL.
    SELECT SINGLE *
      INTO CORRESPONDING FIELDS OF ls_qave
      FROM qave
      WHERE prueflos = ls_qals-prueflos
        AND kzart = L.

*    取qpac
    IF ls_qave IS NOT INITIAL.
      SELECT SINGLE *
        INTO CORRESPONDING FIELDS OF ls_qpac
        FROM qpac
        WHERE katalogart = ls_qave-vkatart
          AND werks      = ls_qave-vwerks
          AND auswahlmge = ls_qave-vauswahlmg
          AND codegruppe = ls_qave-vcodegrp
          AND code       = ls_qave-vcode
          AND versionam  = ls_qave-versionam.

*      取qpct
      IF ls_qpac IS NOT INITIAL.
        SELECT SINGLE *
          INTO CORRESPONDING FIELDS OF ls_qpct
          FROM qpct
          WHERE katalogart = ls_qpac-katalogart
            AND codegruppe = ls_qpac-codegruppe
            AND code       = ls_qpac-code
            AND version    = ls_qpac-versionam
            AND sprache    = 1.

        IF ls_qpct IS NOT INITIAL.
          vcodetxt = ls_qpct-kurztext.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.

ENDMODULE.

技术图片

3.SE18:

  BADI name: LE_SHP_TAB_CUST_ITEM -->  Display

技术图片

4.继续创建实现类ZCL_IM_IMPL_LE_SHP_TAB_IT:

技术图片

方法 IF_EX_LE_SHP_TAB_CUST_ITEM~ACTIVATE_TAB_PAGE:

  method IF_EX_LE_SHP_TAB_CUST_ITEM~ACTIVATE_TAB_PAGE.
    ef_caption = 检验结果.
    ef_position = 11.
    ef_program = SAPLZFG_DELIVERY_ENHC.
    ef_dynpro = 1001.
    cs_v50agl_cust = X.
  endmethod.

方法 IF_EX_LE_SHP_TAB_CUST_ITEM~TRANSFER_DATA_TO_SUBSCREEN:

  method IF_EX_LE_SHP_TAB_CUST_ITEM~TRANSFER_DATA_TO_SUBSCREEN.
*    BREAK ybin.
    CALL FUNCTION ZSET_DELIVERY_ITEM_SCRN_VAL
      EXPORTING
        i_lips = is_lips.
  endmethod.

方法 IF_EX_LE_SHP_TAB_CUST_ITEM~TRANSFER_DATA_FROM_SUBSCREEN:

  method IF_EX_LE_SHP_TAB_CUST_ITEM~TRANSFER_DATA_FROM_SUBSCREEN.
*    BREAK ybin.
    CALL FUNCTION ZGET_DELIVERY_ITEM_SCRN_VAL
      IMPORTING
        e_lips = cs_lips.
  endmethod.

5.QA32 --> 使用决策 --> QA11:

技术图片

填写"使用决策代码"后保存:

技术图片

用隐式增强写入表lips:

技术图片

6.点击"取消UD"的时候

 

VL01N/VL02N/VL03N项目的屏幕增强

标签:field   type   alt   bsp   目的   spl   检验   输出   sele   

原文地址:https://www.cnblogs.com/ybinlog/p/11320356.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!