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


    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"的时候,同时清空lips中的值:

    7.结果

     8.请求

  • 相关阅读:
    微软不也是从Altair Basic这丑小鸭长成白天鹅吗?
    互联网创业应该如何找到创意
    互联网创业创意养成记1
    安卓CTS官方文档之兼容性方案概览
    跨平台移动应用开发是否真的是一个好选择?
    Ubuntu安装MyEclise16 过程差不多
    Ubantu下安装jdk 教程
    最近出错总结
    使用Eclipse编译运行MapReduce程序 Hadoop2.6.0_Ubuntu/CentOS
    关于最近学习出现的错误,及解决的想法
  • 原文地址:https://www.cnblogs.com/ybinlog/p/11320356.html
Copyright © 2020-2023  润新知