赞
踩
客户要求,在VT02N和VT03N的主屏幕上增强客制化字段,经查阅资料得知,标准的屏幕增强只供SAP内部使用,所以只能换一种方式实现。
最终我的实现方法是,在VT02N,VT03N复制标准GUI增加客制化的按钮,点击按钮跳转到克制化屏幕,具体实现步骤如下:
用户出口:EXIT_SAPMV56A_004 创建INCLUDE : EXIT_SAPMV56A_004
添加代码如下:
- DATA: L_TA_CONTROL LIKE LINE OF C_TA_CONTROL.
- FIELD-SYMBOLS <CUA> LIKE LINE OF C_CUA_CONTROL.
-
- *Set a custom status which includes the button required to navigate
- *to the Extra data screen. This status will dynamically be called
- *from the program control and is a copy of the standard status of the
- *screen 1020
-
- IF SY-TCODE = 'VT02N'OR
- SY-TCODE = 'VT03N'.
- READ TABLE C_CUA_CONTROL ASSIGNING <CUA>
- WITH KEY PROGNAME = 'SAPMV56A'
- DYNPRO = '1020'
- TRTYP = '*'.
- IF SY-SUBRC = 0.
- *这一步就是为下一步调用的GUI_STATUS先创建一个函数组 ,下面是函数组主程序名
- <CUA>-STATPROG = 'SAPLZ_PLES_SHIPMENT'.
- *这一步就是修改标准的调用步骤,将标准的GUI_STATUS--->TRA_MAIN 复制成ZTRA_MAIN
- <CUA>-STATUS = 'ZTRA_MAIN'.
- ENDIF.
- ENDIF.
第二步,在用户出口:EXIT_SAPMV56A_001 创建 INCLUDE ZXV56U18.
添加如下代码
- *Description : User EXIT EXIT_SAPMV56A_001 (ENHANCEMENT V56AFCCH)
- *The normal purpose OF this EXIT IS TO CHECK IF a
- *particular FUNCTION CODE may be executed (see doc)
- *IN this CASE it IS used TO initialise/read extra DATA
- *pertaining TO the shipment that IS processed IN a cusom SCREEN.
-
- CHECK I_FCODE EQ 'DETAILS'. "这个就是上一步 你复制出来的GUI_STATUS中新增的按钮名
- "这里传入运输单号,进入自建的function 里面调用你想要的展示的屏幕
- CALL FUNCTION 'ZSD_SHIPMENT_ENHANCEMENT'
- EXPORTING
- IV_TKNUM = I_XVTTK_WA-TKNUM
- .
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。