本文主要是介绍SAP PP BAPI_MATERIAL_SAVEDATA 保存时碰到的一个坑,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今早碰到一个奇怪的现象。
调用 BAPI_MATERIAL_SAVEDATA 批量修改物料主数据。
发现
1、批量传入单条时,是正常的,即mm03查看已经修改了。
2、传入多条时,第一条正常修改,后面的都没有成功,也没有报错。
经过调试发现 ,两个extension(ct_extensionin 和ct_extensioninX) 没有clear。
猜想机制,相同的extension 结构,不同数据,且与指定抬头物料不相同 ,也没有报错 。这个extension的增强应该没有做物料的校验 。
ls_te_mara-zyxwlz01 = ls_zsmara-zyxwlz01. "品牌ls_te_mara-zyxwlz02 = ls_zsmara-zyxwlz02. "产业ls_te_mara-zyxwlz03 = ls_zsmara-zyxwlz03. "产品线ls_te_mara-zyxwlz04 = ls_zsmara-zyxwlz04. "产品档次ls_te_mara-zyxwlz05 = ls_zsmara-zyxwlz05. "产品系列ls_te_mara-zyxwlz06 = ls_zsmara-zyxwlz06. "型号组合ls_te_mara-zyxwlz07 = ls_zsmara-zyxwlz07. "旋梭种类ls_te_mara-zyxwlz08 = ls_zsmara-zyxwlz08. "电控种类ls_te_mara-zyxwlz09 = ls_zsmara-zyxwlz09. "物联网ls_te_mara-zyxwlz10 = ls_zsmara-zyxwlz10. "业务曲线ls_te_mara-zyxwlz11 = ls_zsmara-zyxwlz11. "成品营销物料组11ls_te_mara-zyxwlz12 = ls_zsmara-zyxwlz12. "成品营销物料组12ls_te_mara-zyxwlz13 = ls_zsmara-zyxwlz13. "成品营销物料组13ls_te_mara-zyxwlz14 = ls_zsmara-zyxwlz14. "成品营销物料组14ls_te_mara-zyxwlz15 = ls_zsmara-zyxwlz15. "成品营销物料组15ls_te_mara-zyxwlz16 = ls_zsmara-zyxwlz16. "成品营销物料组16ls_te_mara-zyxwlz17 = ls_zsmara-zyxwlz17. "成品营销物料组17ls_te_mara-zyxwlz18 = ls_zsmara-zyxwlz18. "成品营销物料组18ls_te_mara-zyxwlz19 = ls_zsmara-zyxwlz19. "成品营销物料组19ls_te_mara-zyxwlz20 = ls_zsmara-zyxwlz20. "成品营销物料组20ls_te_mara-material = ls_material.lv_valuepart = ls_te_mara.ls_extensionin-structure = 'BAPI_TE_MARA'.ls_extensionin-valuepart1 = lv_valuepart(240).ls_extensionin-valuepart2 = lv_valuepart+240(240).ls_extensionin-valuepart3 = lv_valuepart+480(240).ls_extensionin-valuepart4 = lv_valuepart+720(240).APPEND ls_extensionin TO ct_extensionin.ls_te_marax-material = ls_material.ls_te_marax-zyxwlz01 = 'X'.ls_te_marax-zyxwlz02 = 'X'.ls_te_marax-zyxwlz03 = 'X'.ls_te_marax-zyxwlz04 = 'X'.ls_te_marax-zyxwlz05 = 'X'.ls_te_marax-zyxwlz06 = 'X'.ls_te_marax-zyxwlz07 = 'X'.ls_te_marax-zyxwlz08 = 'X'.ls_te_marax-zyxwlz09 = 'X'.ls_te_marax-zyxwlz10 = 'X'.ls_te_marax-zyxwlz11 = 'X'.ls_te_marax-zyxwlz12 = 'X'.ls_te_marax-zyxwlz13 = 'X'.ls_te_marax-zyxwlz14 = 'X'.ls_te_marax-zyxwlz15 = 'X'.ls_te_marax-zyxwlz16 = 'X'.ls_te_marax-zyxwlz17 = 'X'.ls_te_marax-zyxwlz18 = 'X'.ls_te_marax-zyxwlz19 = 'X'.ls_te_marax-zyxwlz20 = 'X'.lv_valuepartx = ls_te_marax.ls_extensioninx-structure = 'BAPI_TE_MARAX'.ls_extensioninx-valuepart1 = lv_valuepartx(240).ls_extensioninx-valuepart2 = lv_valuepartx+240(240).ls_extensioninx-valuepart3 = lv_valuepartx+480(240).ls_extensioninx-valuepart4 = lv_valuepartx+720(240).APPEND ls_extensioninx TO ct_extensioninx.CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'EXPORTINGheaddata = ls_headdataIMPORTINGreturn = ls_returnTABLESextensionin = ct_extensioninextensioninx = ct_extensioninx.
这篇关于SAP PP BAPI_MATERIAL_SAVEDATA 保存时碰到的一个坑的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!