BADI SE19:ZINVOICE_UPDATE
MIRO发票检验过账好模拟时,检查采购订单line 是否有固定资产的行项目,如果有固定资产项目,则弹出提示框,提示消息:存在规定资产采购项目!
判断逻辑:检查MIRO ,选中的采购订单项目数据,项目的科目分配类别是否 = ‘A’,能找到为’A’的line ,则弹出提示框。
DEVK905455 ABAP30 B235 MIRO发票校验资产栏位检查 by rainy on 20150817 req by fi
method IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE.
DATA:ZWA_RSEG_NEW LIKE LINE OF TI_RSEG_NEW,
ZL_ANSWER TYPE C.
*&->add by rainy on 20150818 FOR b235 req by fi.
IF sy-ucomm EQ ‘BU‘ or sy-ucomm = ‘PB‘.
*&判断采购订单 line 的科目分配类别为‘A‘,则提示消息:
READ TABLE TI_RSEG_NEW INTO ZWA_RSEG_NEW WITH KEY KNTTP = ‘A‘.
* ‘K‘.
IF SY-SUBRC EQ 0.
CALL FUNCTION ‘POPUP_TO_CONFIRM_STEP‘
EXPORTING
titel = ‘存在固定资产提示‘
textline1 = ‘存在固定资产采购行项目!‘
cancel_display = space"不显示CANCEL按钮
IMPORTING
answer = Zl_answer.
IF Zl_answer EQ ‘N‘.
LEAVE TO SCREEN 6000.
* LEAVE TO LIST-PROCESSING.
ENDIF.
ENDIF.
* LOOP AT TI_RSEG_NEW INTO ZWA_RSEG_NEW.
* IF ZWA_RSEG_NEW-KNTTP EQ ‘A‘.
* CALL FUNCTION ‘POPUP_TO_DISPLAY_TEXT‘
* EXPORTING
* TITEL = ‘存在固定资产提示‘
* TEXTLINE1 = ‘存在固定资产采购行项目!‘
* START_COLUMN = 25
* START_ROW = 6.
* ENDIF.
* ENDLOOP.
ENDIF.
*&->end add by rainy on 20150818.
endmethod.
002 MIRO发票校验采购订单项目科目分配类别检查增强-20150819
原文:http://www.cnblogs.com/rainysblog/p/6731432.html