MM--关于MIRO的分析基于订单的发票校验的跟踪

1)关于计算交货单的可能的输入到发票校验(MIRO)可以参见RM08RL82
计算的说明:
1)读取适合条件的EKKO
SELECT  * FROM  "EKKO"
WHERE
  "MANDT" = '800' AND "BSTYP" IN ('L' , 'F') AND "EBELN" = ''4500000005' AND "BUKRS" = '1002'
  AND "LIFRE" = '0011000843' AND "FRGRL" = ''  AND "LOEKZ" = ' '  AND ( "MEMORY" =' '  OR "MEMORY" IS NULL )
2)根据读取出的EKKO读取EKPO和EKBE
SELECT  * FROM  EKPO WHERE "MANDT" = '800' AND "EBELN" = '4500000005' AND "REPOS" = 'X' AND "LOEKZ" = ' '
SELECT * FROM EKBE WHERE "MANDT" = '800' AND "EBELN" = '4500000005' AND ( "VGABE" = '1' OR "VGABE" = '2' )
3)循环读取EKKO的内表,来计算EKBE的交货和发货的的数量和金额,来生成需要开票的金额。


2)MIRO的操作保存时用到的函数
CALL FUNCTION 'CKMV_AC_DOCUMENT_POST'
CALL FUNCTION 'POST_DOCUMENT' IN UPDATE TASK
CALL FUNCTION 'G_FI_POSTING' IN UPDATE TASK
CALL FUNCTION 'G_LC_POSTING' IN UPDATE TASK
CALL FUNCTION 'AC_DOCUMENT_MM_UPDATE' IN UPDATE TASK
call function 'MCE_STATISTICS_UPD_V2' in update task
CALL FUNCTION 'ME_UPDATE_INVOICE' IN UPDATE TASK
CALL FUNCTION 'MRM_INVOICE_DOCUMENT_POST' IN UPDATE TASK

CALL FUNCTION 'SD_SCD_IV_SELCRITERIA_SAVE_DB' IN UPDATE TASK

CALL FUNCTION 'SWE_EVENT_CREATE_FOR_UPD_TASK' IN UPDATE TASK

3)MIRO的操作保存时用到的数据表
新增 CKMI1
新增 BKPF

新增 EKBE
INSERT VALUES( '800' , '4500000005' , 00030 , 00 , '2' , 2007 , '5105614013' , 0006 , 'Q' , ' ' , 20071022 , 1 , 1 , 36 , 36 , 'RMB'
注意此处的2表示采购发票的处理,1表示采购订单收货的处理,这会在计算交货单的可能的输入到发票校验用到。
新增RBKP
INSERT VALUES( '800' , '5105614013' , 2007 , 'RE' , 20071022 , 20071022 , 'SDSUPPORT01' , 'MIRO' , 20080222 , 191406 , 'RD' , ' ' , '
新增RESG
INSERT VALUES( '800' , '5105614013' , 2007 , 000006 , '4500000005' , 00030 , 00 , '00049251' , '1101' , ' ' , '1002' , '1101' , 36
新增 BSIK

新增 BSIS

新增带有用于IDES功能范围的实际行项目表 GLFUNCA

新增在AWKEY 上查找FI-SL基础凭证的索引 GLIDXA

新增SAP 合并: 日记帐分录标 (实际) ECMCA

更新供应商主数据 (业务额) LFC1
UPDATE SET "UM10S" = "UM10S" + 0 , "UM10H" = "UM10H" + 29062.8 , "UM10U" = "UM10U" + -29062.8 WHERE "MANDT" = '800' AND "LIFNR" = '0011000843' AND "BUKR = '1002' AND "GJAHR" = 2008
UPDATE SET "UMSAV" = "UMSAV" + -29062.8 WHERE "MANDT" = '800' AND "LIFNR" = '0011000843' AND "BUKRS" = '1002' AND "GJAHR" = 2008
更新有IDES功能范围的总计表_ GLFUNCT

更新 SAP 合并: 总计表 ECMCT

更新总帐科目主记录业务额 GLT0


 

你可能感兴趣的:(function,null,SAP,insert,statistics)