本文主要是介绍MFBF:装配反冲-----收货过账,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、此文章主要是针对MFBF事务码中的装配反冲,就是进行收货过账的,原本这个装配反冲可以用BAPI_REPMANCONF_CREATE_MTS进行过账的,但是由于BAPI不能修改移动类型,导致最后只能使用BDC进行过账
MFBF中装配反冲的原始界面:
不能用BAPI_REPMANCONF_CREATE_MTS过账的原因如下:
程序示例如下:移动类型不同,导致BDC录屏也不同
if pv_bwart = '132' or pv_bwart = 'Z50'.clear:gt_bdcdata.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=ZPKT'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点perform bdc_field using 'RM61B-REP_POINTS' 'X'.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=REVR'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'BDC_CURSOR' 'RM61B-ERFMG'.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=PARA'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'BDC_CURSOR' 'RM61B-ACHARG'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点perform bdc_field using 'RM61B-REP_POINTS' 'X'.perform bdc_field using 'RM61B-ZPUNKT' pv_zpunkt. "报告点if pv_charg is not initial.perform bdc_field using 'RM61B-ACHARG' pv_charg. "系统批次endif.perform bdc_field using 'RM61B-ERFMG' pv_menge. "数量perform bdc_dynpro using 'SAPLBARM' '0150'.perform bdc_field using 'BDC_CURSOR' 'RM61B-BWAWE'.perform bdc_field using 'BDC_OKCODE' '=GOON'.perform bdc_field using 'RM61B-LBOFF' 'X'.perform bdc_field using 'RM61B-RADIOFR' 'X'.perform bdc_field using 'RM61B-BWAWE' pv_bwart. "移动类型perform bdc_field using 'RM61B-BWAWA' '262'.perform bdc_field using 'RM61B-BWAWEM' '572'.perform bdc_field using 'RM61B-BWAWAM' '571'.perform bdc_field using 'RM61B-BWACR' '292'.perform bdc_field using 'RM61B-BWASC' '552'.perform bdc_field using 'RM61B-BWACO' '532'.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE' '=POST'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-PLWERK' pv_werks.perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点if pv_charg is not initial.perform bdc_field using 'RM61B-ACHARG' pv_charg. "系统批次endif.perform bdc_field using 'RM61B-ERFMG' pv_menge. "数量else.clear:gt_bdcdata.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=ZPKT'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点perform bdc_field using 'RM61B-REP_POINTS' 'X'.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=GOON'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点perform bdc_field using 'RM61B-REP_POINTS' 'X'.perform bdc_field using 'RM61B-ZPUNKT' pv_zpunkt. "报告点perform bdc_field using 'RM61B-ERFMG' pv_menge. "数量perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=PARA'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-PLWERK' pv_werks.perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点if pv_charg is not initial.perform bdc_field using 'RM61B-ACHARG' pv_charg. "系统批次endif.perform bdc_field using 'RM61B-ERFMG' pv_menge. "数量perform bdc_dynpro using 'SAPLBARM' '0150'.perform bdc_field using 'BDC_CURSOR''RM61B-BWAWE'.perform bdc_field using 'BDC_OKCODE''=GOON'.perform bdc_field using 'RM61B-LBOFF' 'X'.perform bdc_field using 'RM61B-RADIOFR' 'X'.perform bdc_field using 'RM61B-BWAWE' pv_bwart. "移动类型perform bdc_field using 'RM61B-BWAWA' '261'.perform bdc_field using 'RM61B-BWAWEM' '571'.perform bdc_field using 'RM61B-BWAWAM' '572'.perform bdc_field using 'RM61B-BWACR' '291'.perform bdc_field using 'RM61B-BWASC' '551'.perform bdc_field using 'RM61B-BWACO' '531'.perform bdc_dynpro using 'SAPLBARM' '0800'.perform bdc_field using 'BDC_OKCODE''=POST'.perform bdc_field using 'RM61B-BUDAT' pv_budat. "过账日期perform bdc_field using 'RM61B-BLDAT' pv_bldat. "凭证日期perform bdc_field using 'RM61B-RB_BAUGR' 'X'.perform bdc_field using 'RM61B-MATNR' pv_matnr. "物料号perform bdc_field using 'RM61B-WERKS' pv_werks. "工厂perform bdc_field using 'RM61B-VERID' pv_verid. "生产版本perform bdc_field using 'RM61B-PLWERK' pv_werks.perform bdc_field using 'RM61B-ALORT' pv_lgort. "库存地点if pv_charg is not initial .perform bdc_field using 'RM61B-ACHARG' pv_charg. "系统批次endif.perform bdc_field using 'RM61B-ERFMG' pv_menge. "数量endif.clear: gt_messtab.call transaction 'MFBF'using gt_bdcdatamode 'N' "A:前台执行 N:后台执行update 'S' "S:同步 A:异步messages into gt_messtab.clear: lt_return.call function 'CONVERT_BDCMSGCOLL_TO_BAPIRET2'tablesimt_bdcmsgcoll = gt_messtabext_return = lt_return.read table lt_return into ls_return with key type = 'E'. "#EC CI_STDSEQif sy-subrc eq 0. "BDC出现错误cv_flag = 'X'.move-corresponding ls_return to cs_return.return.else. "BDC更新成功commit work.read table lt_return into ls_return with key type = 'S' id = 'RM'." number = '190' or '191' or '215'. "#EC CI_STDSEQif sy-subrc eq 0.move-corresponding ls_return to cs_return.cv_flag = ''.cv_mblnr = ls_return-message_v1. "凭证号endif.endif.
这篇关于MFBF:装配反冲-----收货过账的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!