Dear all,
When we call "SAP BAPI" via "K2 Connect For SAP", we encounter the following problems:
SAP BAPI Structure and Method:
SAP BAPI name: SAP Test
Input Parameter: T_ROS(Parameter Name), Table(DataType)
Output Parameter: T_RETURN(Parameter Name), Table(DataType)
Only use the test tool provided by "K2 Connect For SAP" to call the BAPI method. The result is that when two data are passed in "T_ROS", if the first one is in the wrong format, the return value indicates the first format error. If the format is all correct, then Both returned successfully.
However, after using "K2 Connect For SAP" to generate "Service Object" for "SAP BAPI" and then "Smart Object" for "Service Object", the “ExecuteBulkScalar” method provided by K2 backend is used, regardless of whether the first format is wrong or not. Return the second success, and only one return value.
The specific calling logic is as follows:
using(serverName.Connection) {
SmartObject regionSmO = serverName.GetSmartObject("SAP Test");
regionSmO.MethodToExecute = "SAPTest";
using(DataTable inputDataTable = regionSmO.GetInputTable(regionSmO.MethodToExecute))
{
DataRow newRowA = inputDataTable.NewRow();
newRowAn"ID"] = "1";
newRowAn"Name"] = "Tom";
inputDataTable.Rows.Add(newRowA);
DataRow newRowB = inputDataTable.NewRow();
newRowBn"ID"] = "2";
newRowBn"Name"] = "Mary";
inputDataTable.Rows.Add(newRowB);
SmartObject result = serverName.ExecuteBulkScalar(regionSmO, inputDataTable);
}
}
So, I would like to ask if this is the cause of the problem. Is it a method error or a call error?
If the method is wrong, is there any other way to perfectly support the above Smart Object?
Thanks very much!