JCO向“CSAP_MAT_BOM_MAINTAIN”传输错误的参数。
我试图调用功能模块“CSAP_MAT_BOM_MAINTAIN”在 SAP 中创建 BOM,但出现错误。
IFunctionTemplate ft = mRepository.getFunctionTemplate("CSAP_MAT_BOM_MAINTAIN");
System.out.println(" Functional Template Created ");
if (ft == null){return;}
JCO.Function function = ft.getFunction();
JCO.ParameterList importparams =function.getImportParameterList();
// Setting HeadData Structure Information
//importparams.setValue("C000000609", "CHANGE_NO");
importparams.setValue("CPF10104", "MATERIAL");
importparams.setValue("1", "BOM_USAGE");
importparams.setValue("0001", "PLANT");
importparams.setValue("01", "ALTERNATIVE");
importparams.setValue("11.11.2011", "VALID_FROM");
importparams.setValue("X", "FL_COMMIT_AND_WAIT");
importparams.setValue("X", "FL_BOM_CREATE");
importparams.setValue("X", "FL_NEW_ITEM");
importparams.setValue("X", "FL_COMPLETE");
importparams.setValue("X", "FL_DEFAULT_VALUES");
JCO.Structure headStructure = importparams.getStructure("I_STKO");
headStructure.setValue("01", "BOM_STATUS");
headStructure.setValue("1", "BASE_QUAN");
headStructure.setValue("KG", "BASE_UNIT");
headStructure.setValue("BOM01", "BOM_GROUP");
JCO.Table stpo = function.getTableParameterList().getTable("T_STPO");
stpo.appendRow();
stpo.setValue("BOM Position 2.1", "ITEM_TEXT1");
stpo.setValue("L", "ITEM_CATEG");
stpo.setValue("L", "ID_ITM_CTG");
stpo.setValue("0010", "ITEM_NO");
stpo.setValue("0010", "ID_ITEM_NO");
stpo.setValue("13", "COMP_QTY");
stpo.setValue("KG", "COMP_UNIT");
stpo.setValue("00000001", "ITEM_NODE");
stpo.setValue("00000001", "ITEM_COUNT");
stpo.setValue("000000000000000000", "DEP_LINK");
stpo.setValue("12345-R6000001", "COMPONENT");
//stpo.setValue("12345-R6000001", "ID_COMP");
JCO.Table stpu = function.getTableParameterList().getTable("T_STPU");
stpu.appendRow();
stpu.setValue("0", "POINTER");
stpu.setValue("00000000", "STLKN");
stpu.setValue("0010", "STPOZ");
stpu.setValue("0001", "UPOSZ");
stpu.setValue("46", "UPMNG");
stpu.setValue("T1", "EBORT");
我收到错误:
线程“main”com.sap.mw.jco.JCO$AbapException中的异常:(126)错误:终止处理。
在互联网上搜索后,我发现当我们输入参数错误。 但我无法找到错误。
请注意,我对 ABAP 编程的了解有限。
有人可以帮助我吗?
I am trying to call the function module "CSAP_MAT_BOM_MAINTAIN" to create a BOM in SAP but i get error.
IFunctionTemplate ft = mRepository.getFunctionTemplate("CSAP_MAT_BOM_MAINTAIN");
System.out.println(" Functional Template Created ");
if (ft == null){return;}
JCO.Function function = ft.getFunction();
JCO.ParameterList importparams =function.getImportParameterList();
// Setting HeadData Structure Information
//importparams.setValue("C000000609", "CHANGE_NO");
importparams.setValue("CPF10104", "MATERIAL");
importparams.setValue("1", "BOM_USAGE");
importparams.setValue("0001", "PLANT");
importparams.setValue("01", "ALTERNATIVE");
importparams.setValue("11.11.2011", "VALID_FROM");
importparams.setValue("X", "FL_COMMIT_AND_WAIT");
importparams.setValue("X", "FL_BOM_CREATE");
importparams.setValue("X", "FL_NEW_ITEM");
importparams.setValue("X", "FL_COMPLETE");
importparams.setValue("X", "FL_DEFAULT_VALUES");
JCO.Structure headStructure = importparams.getStructure("I_STKO");
headStructure.setValue("01", "BOM_STATUS");
headStructure.setValue("1", "BASE_QUAN");
headStructure.setValue("KG", "BASE_UNIT");
headStructure.setValue("BOM01", "BOM_GROUP");
JCO.Table stpo = function.getTableParameterList().getTable("T_STPO");
stpo.appendRow();
stpo.setValue("BOM Position 2.1", "ITEM_TEXT1");
stpo.setValue("L", "ITEM_CATEG");
stpo.setValue("L", "ID_ITM_CTG");
stpo.setValue("0010", "ITEM_NO");
stpo.setValue("0010", "ID_ITEM_NO");
stpo.setValue("13", "COMP_QTY");
stpo.setValue("KG", "COMP_UNIT");
stpo.setValue("00000001", "ITEM_NODE");
stpo.setValue("00000001", "ITEM_COUNT");
stpo.setValue("000000000000000000", "DEP_LINK");
stpo.setValue("12345-R6000001", "COMPONENT");
//stpo.setValue("12345-R6000001", "ID_COMP");
JCO.Table stpu = function.getTableParameterList().getTable("T_STPU");
stpu.appendRow();
stpu.setValue("0", "POINTER");
stpu.setValue("00000000", "STLKN");
stpu.setValue("0010", "STPOZ");
stpu.setValue("0001", "UPOSZ");
stpu.setValue("46", "UPMNG");
stpu.setValue("T1", "EBORT");
I get error:
Exception in thread "main" com.sap.mw.jco.JCO$AbapException: (126) ERROR: Terminate processing.
After searching over the internet i found that this error comes when we have wrong input params.
But i am unable to find the error.
Please note that i have limited knowledge about ABAP programming.
Can any one help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(126) ABAP EXCEPTION:远程系统中的功能模块抛出异常。
我认为您应该仔细检查所有这些新参数,因为其中一个参数会导致您的函数出现错误。
(126) ABAP EXCEPTION: An exception has been thrown by a function module in the remote system.
I think you should carefully review all of these new parameters, since one is causing a bug in your function.
如果您有权访问 SAP 系统,则可以运行事务 ST22 来获取详细的错误日志。但是,您可能需要按照 Raj 的建议在 SAP 中进行调试。
If you have access to the SAP system, you can run transaction ST22 to get a detailed error log. However, you may need to de-bug within SAP as per Raj's suggestion.