Today we learn how to add customer fields column to tcode MD04.
Tcode md04 enhancement add fields ebeln, charg. Po number, batch number.
Enhancement exit M61X0002.
Step1:Cmod Crete Project ZMM_001
Step2:Add enhancement component M61X0002
Active EXIT_SAPLM61R_001[PAI after click Push Button] and EXIT_SAPMM61R_001[PBO add push button]
Step3:Write Souce Code.
3. 功能模块EXIT_SAPMM61R_001
*&———————————————————————*
*& 包括 ZXM61U04
*&———————————————————————*
IF imdkp-plwrk = ‘1000’ OR imdkp-plwrk = ‘2000’ OR imdkp-plwrk = ‘3000’. ” www.hot483.com工厂下使用
CASE sy-langu. ” 判断当前系统语言
WHEN ‘E’.
MOVE ‘PO Number’ TO button1_ez.
MOVE ‘Batch’ TO button2_ez.
WHEN ‘1’.
MOVE ‘采购订单编号’ TO button1_ez. ” 按钮一
MOVE ‘批次’ TO button2_ez. ” 按钮二
ENDCASE.
ENDIF.
4. 功能模块EXIT_SAPLM61R_001中双击创建包含程序INCLUDE ZXM61U03 ,当行项目是销售订单时,点击按钮取得对应信息
*&———————————————————————*
*& 包括 ZXM61U03
*&———————————————————————*
DATA:l_bstkd TYPE vbkd-bstkd.
DATA:l_charg TYPE vbap-charg.
IF imdkpexit-plwrk = ‘4040’ OR imdkpexit-plwrk = ‘4048’ OR imdkpexit-plwrk = ‘4049’. ” 桥梁工厂使用
IF ibutt1 IS NOT INITIAL. ” 按钮一First Push button
IF imdezexit-delkz = ‘VC’. ” VC 代表销售订单for sales order.
SELECT SINGLE bstkd
INTO l_bstkd
FROM vbkd
WHERE vbeln = ie3mdpslx-delnr ” 销售和分销凭证号
AND posnr = ie3mdpslx-delps. ” 销售和分销凭证的项目号
IF sy-subrc = 0.
MOVE l_bstkd TO emdezx_usex1 . ” 取得采购订单号Purchase Order
ENDIF.
ENDIF.
ENDIF.
IF ibutt2 IS NOT INITIAL. ” 按钮二Second Push Button.
IF imdezexit-delkz = ‘VC’. ” VC 代表销售订单
SELECT SINGLE charg
INTO l_charg
FROM vbap
WHERE vbeln = ie3mdpslx-delnr
AND posnr = ie3mdpslx-delps.
IF sy-subrc = 0.
MOVE l_charg TO emdezx_usex2 . ” 取得批次
ENDIF.
ENDIF.
ENDIF.
ENDIF.
我的微信公众号【 hot583 】 或者在这个链接联系我
本文链接 :http://www.hot583.com/2022/07/28/md04-m61x0002/
本文为作者原创,如果这篇文章对您有用,欢迎转载,
转载请务必注明来源《今日热点在看》http://www.hot583.com/
微信原文《全文完》