修改盤點數量、過帳 api
一、MI04: 庫存盤點 ide
二、MI07過帳 編碼
三、MI09 = MI01 + MI04spa
【MI04: 庫存盤點】blog
回車輸入盤點數量圖片
點保存便可it
【MI07過帳】class
MI07:im
系統根據帳面庫存數量和用戶輸入的盤點數量,計算出差額。檢查無誤後,點擊保存按鈕,屏幕左下角會顯示憑證保存成功的信息d3
REPORT YLM_TEST012.SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.PARAMETERS:P_WERKS LIKE MARD-WERKS DEFAULT 'RYL5', P_LGORT LIKE MARD-LGORT DEFAULT '3100', P_MATNR LIKE MARD-MATNR DEFAULT '0609990060199012', P_CHARG TYPE ISEG-CHARG DEFAULT '2013102799', P_ERFMG TYPE ISEG-ERFMG DEFAULT '999', P_MEINS TYPE MEINS DEFAULT 'CTL', P_IBLNR TYPE IKPF-IBLNR DEFAULT '100000173', P_DATE TYPE IKPF-BLDAT DEFAULT '20140618', P_GJAHR TYPE IKPF-GJAHR DEFAULT '2014'.SELECTION-SCREEN END OF BLOCK BLK1.DATA: GT_RETURN_CODE LIKE TABLE OF BAPIRET2 WITH HEADER LINE, "建立憑證返回信息 GT_RETURN_CODE2 LIKE TABLE OF BAPIRET2 WITH HEADER LINE, "建立憑證返回信息 GT_ITEM LIKE ISEG OCCURS 0 WITH HEADER LINE, GT_BAPI_ITEM LIKE BAPI_PHYSINV_COUNT_ITEMS OCCURS 0 WITH HEADER LINE, GT_BAPI_ITEM2 LIKE BAPI_PHYSINV_POST_ITEMS OCCURS 0 WITH HEADER LINE.DATA: GV_DATUM LIKE IKPF-BLDAT, "盤點日期 GV_IBLNR LIKE IKPF-IBLNR, "盤點憑證號 GV_GJAHR LIKE IKPF-GJAHR. "會計年度GT_BAPI_ITEM-ITEM = 1. "行號GT_BAPI_ITEM-MATERIAL = P_MATNR."物料編碼GT_BAPI_ITEM-BATCH = P_CHARG."批次GT_BAPI_ITEM-ENTRY_QNT = P_ERFMG."錄入系統實盤數GT_BAPI_ITEM-ENTRY_UOM = P_MEINS."計量單位CASE P_ERFMG. WHEN 0. GT_BAPI_ITEM-ZERO_COUNT = 'X'. WHEN OTHERS.ENDCASE.APPEND GT_BAPI_ITEM.GT_BAPI_ITEM2-ITEM = 1. "行號GT_BAPI_ITEM2-MATERIAL = P_MATNR."物料編碼GT_BAPI_ITEM2-BATCH = P_CHARG. "批次APPEND GT_BAPI_ITEM2.**************調用bapi,至關於MI04錄入實盤數GV_IBLNR = P_IBLNR."盤點憑證GV_DATUM = P_DATE."盤點日期GV_GJAHR = P_GJAHR."會計年度CALL FUNCTION 'BAPI_MATPHYSINV_COUNT' EXPORTING PHYSINVENTORY = GV_IBLNR FISCALYEAR = GV_GJAHR COUNT_DATE = GV_DATUM TABLES ITEMS = GT_BAPI_ITEM RETURN = GT_RETURN_CODE.CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'.***************調用bapi,至關於MI07差別過賬CALL FUNCTION 'BAPI_MATPHYSINV_POSTDIFF' EXPORTING PHYSINVENTORY = GV_IBLNR FISCALYEAR = GV_GJAHR PSTNG_DATE = GV_DATUM TABLES ITEMS = GT_BAPI_ITEM2 RETURN = GT_RETURN_CODE2.