SAP ABAP TCODE MR8M Enhancement Cancel Invoice Save

Demo Souce About: SAP ABAP TCODE MR8M Enhancement Cancel Invoice Save.

Enhancement Point: CMOD-LMR1M001 , Function Module: EXIT_SAPLMRMP_010

Purpose: After Click Save Button on tcode MR8M, modify the cancel flag in customer table.

 

Demo Source Code: Learn More Enhancement

IF sy-tcode = ‘MR8M’ AND e_trbkpv-bukrs+0(2) = ’83’.
*  根据冲销发票凭证,更新自建表冲销标记
IF e_trbkpv-stblg IS NOT INITIAL.
*    先从单物料发票子件表中找
SELECT COUNT(*)
FROM zd_cancel_log
WHERE belnr_id = e_trbkpv-stblg
AND   gjahr    = e_trbkpv-stjah
.
IF sy-subrc = 0.
UPDATE zd_cancel_log
SET    cxbz = ‘X’
WHERE  belnr_id = e_trbkpv-stblg
AND    gjahr    = e_trbkpv-stjah
.
ELSE.
*      再从应付发票自建表中找
SELECT COUNT(*)
FROM zap_invoices
WHERE belnr    = e_trbkpv-stblg
AND   fp_gjahr = e_trbkpv-stjah
.
IF sy-subrc = 0.

UPDATE zap_invoices
SET    cxbz = ‘X’
WHERE  belnr    = e_trbkpv-stblg
AND    fp_gjahr = e_trbkpv-stjah
.
ENDIF.
ENDIF.
ENDIF.

ENDIF.

我的微信公众号【 hot583 】 或者在这个链接联系我

本文链接 http://www.hot583.com/2022/06/28/lmr1m001/

本文为作者原创,如果这篇文章对您有用,欢迎转载,

转载请务必注明来源《今日热点在看》http://www.hot583.com/

微信原文《全文完》

今日热点在看SAP HOT583