VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

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

步骤:

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

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

2.SE80新建功能组ZFG_DELIVERY_ENHC:

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

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

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将数据输出给主程序:

 VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

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

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

*----------------------------------------------------------------------* 
***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.

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

3.SE18:

  BADI name: LE_SHP_TAB_CUST_ITEM –>  Display

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

4.继续创建实现类ZCL_IM_IMPL_LE_SHP_TAB_IT:

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

方法 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:

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

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

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

用隐式增强写入表lips:

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

6.点击”取消UD”的时候,同时清空lips中的值:

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

7.结果

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

 8.请求

VL01N/VL02N/VL03N项目的屏幕增强详解编程语言

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/18586.html

(0)
上一篇 2021年7月19日 21:15
下一篇 2021年7月19日 21:15

相关推荐

发表回复

登录后才能评论