SAP MIGO生产订单入库校验BADI增强MB_MIGO_BADI
生活随笔
收集整理的這篇文章主要介紹了
SAP MIGO生产订单入库校验BADI增强MB_MIGO_BADI
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
SAP MIGO生產訂單入庫校驗BADI增強MB_MIGO_BADI
- 1. 創建BADI增強實施
- 2.修改增強實施
- 3.生產訂單MIGO過賬效果
1. 創建BADI增強實施
- SE19->創建BADI增強
- 輸入增強實施名稱
- 設置增強屬性
- 激活增強實施
2.修改增強實施
-
導航到增強實施類
-
創建全局變量
-
IF_EX_MB_MIGO_BADI~LINE_MODIFY 中傳入數據
method IF_EX_MB_MIGO_BADI~LINE_MODIFY.if CS_GOITEM-BWART = '101' OR CS_GOITEM-BWART = '102' . "移動類型101 102delete GT_GOITEM where ZEILE = I_LINE_ID.append CS_GOITEM to GT_GOITEM.endif. endmethod.
-
IF_EX_MB_MIGO_BADI~CHECK_ITEM 中做值校驗
method IF_EX_MB_MIGO_BADI~CHECK_ITEM.data: WA_GOITEM type GOITEM.data: LV_FLAG type C,WA_AFRU type AFRU.data: LV_LMNGA type AFRU-LMNGA, "報工數量LV_VORNR type AFVC-VORNR, "最后工序的工序號LV_ERFMG_101 type MSEG-ERFMG, "101收貨入庫數量LV_ERFMG_102 type MSEG-ERFMG. "102沖銷入庫數量data: LS_BAPIRET type BAPIRET2.break JIEMM.if SY-TCODE = 'MIGO'.loop at GT_GOITEM into WA_GOITEM where ZEILE = I_LINE_ID and PPS_AUFNR is not initial and BWART = '101'.clear: WA_AFRU,LV_FLAG.select single * from AFRUinto WA_AFRUwhere AUFNR = WA_GOITEM-PPS_AUFNR.if WA_AFRU-VORNR is initial.LV_FLAG = 'X'. "判斷是整體報工還是工序報工endif.clear: LV_LMNGA,LV_VORNR. "取已報工數量case LV_FLAG.when 'X'.select sum( LMNGA ) "整體報工已報工數量from AFRUinto @LV_LMNGAwhere AUFNR = @WA_GOITEM-PPS_AUFNR "訂單and STOKZ = @SPACE "排除已被沖銷和被取消的確認行and STZHL = @SPACE.when others.select B~VORNR "PP01訂單類型的最后一道工序工序號from AFRU as Ainner join AFVC as B on A~AUFPL = B~AUFPLwhere A~AUFNR = @WA_GOITEM-PPS_AUFNRand B~STEUS = 'PP01'order by B~VORNR descendinginto @LV_VORNR up to 1 rows.endselect.select sum( LMNGA )from AFRUinto @LV_LMNGA "工序報工最后一道工序報工數量where AUFNR = @WA_GOITEM-PPS_AUFNRand VORNR = @LV_VORNRand STOKZ = @SPACEand STZHL = @SPACE.endcase.select sum( ERFMG ) from MSEGwhere AUFNR = @WA_GOITEM-PPS_AUFNRand MATNR = @WA_GOITEM-MATNRand BWART = '101'into @LV_ERFMG_101.select sum( ERFMG ) from MSEGwhere AUFNR = @WA_GOITEM-PPS_AUFNRand MATNR = @WA_GOITEM-MATNRand BWART = '102'into @LV_ERFMG_102.if ( LV_LMNGA - ( LV_ERFMG_101 - LV_ERFMG_102 ) ) < 0.LS_BAPIRET-TYPE = 'E'.LS_BAPIRET-ID = '00'.LS_BAPIRET-NUMBER = '001'.LS_BAPIRET-MESSAGE_V1 = |生產訂單:{ WA_GOITEM-PPS_AUFNR alpha = out }前期數量超收,請聯系生產確認入庫單|.append LS_BAPIRET to ET_BAPIRET2.else.if WA_GOITEM-ERFMG > LV_LMNGA - ( LV_ERFMG_101 - LV_ERFMG_102 ).LS_BAPIRET-TYPE = 'E'.LS_BAPIRET-ID = '00'.LS_BAPIRET-NUMBER = '001'.LS_BAPIRET-MESSAGE_V1 = |生產訂單:{ WA_GOITEM-PPS_AUFNR alpha = out }收貨超過報工數量,目前可入庫數量為{ LV_LMNGA - ( LV_ERFMG_101 - LV_ERFMG_102 ) }個|.append LS_BAPIRET to ET_BAPIRET2.endif.endif.endloop.endif. endmethod.
-
IF_EX_MB_MIGO_BADI~POST_DOCUMENT 中釋放全局變量
method IF_EX_MB_MIGO_BADI~POST_DOCUMENT.CLEAR gt_goitem. endmethod.
3.生產訂單MIGO過賬效果
- BADI檢查
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
總結
以上是生活随笔為你收集整理的SAP MIGO生产订单入库校验BADI增强MB_MIGO_BADI的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: grub4dos 制作WIN7、WINP
- 下一篇: qss文件使用