You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call the BAPI interface, after successfully creating the function, when passing parameters during invocation, I need to pass both Structure and table at the same time, and receive the returned table.
Here is my code:DOCUMENTHEADER is class and ACCOUNTPAYABLE is datatable var result = postFunction.Invoke<BapiRet>(new { DOCUMENTHEADER = DOCUMENTHEADER, ACCOUNTPAYABLE = ACCOUNTPAYABLE });
but return exception:SAP RFC Error: RFC_CONVERSION_FAILURE with message: ACCOUNTPAYABLE of type RFCTYPE_TABLE cannot be converted to type RFC_STRUCTURE_HANDLE
Please someone support me
The text was updated successfully, but these errors were encountered:
Your code doesn't really tell the whole story, so it is hard to know exactly what you are trying to do. Since you mention structures and tables, you will likely need to define parameter and result models that use attributes to map SAP fields to your models. Passing a .NET DataTable isn't going to work. There are examples in the documentation:
OK, I show the whole code.
When, I use var result = postFunction.Invoke<BapiRet>(new { DOCUMENTHEADER = DOCUMENTHEADER, ACCOUNTPAYABLE = ACCOUNTPAYABLE }); function .It throw exception:SAP RFC Error: RFC_CONVERSION_FAILURE with message: ACCOUNTPAYABLE of type RFCTYPE_TABLE cannot be converted to type RFC_STRUCTURE_HANDLE
Without more information about the actual RFC function you are calling, I'm going to have to make some guesses
Are the document header and account payable items INPUT for the function, or are they what get returned? Right now, you are providing them as input and your BapiRet class is going to be the output.
Earlier, you said that document header was a structure and account payable was a table - if that is the case, I would do something more like this (notice that the table item is an array of the class):
I would also encourage you to use the SapNameAttribute to map the goofy SAP names to more appropriate C# names, but that doesn't change the functionality.
When I call the BAPI interface, after successfully creating the function, when passing parameters during invocation, I need to pass both Structure and table at the same time, and receive the returned table.
Here is my code:DOCUMENTHEADER is class and ACCOUNTPAYABLE is datatable
var result = postFunction.Invoke<BapiRet>(new { DOCUMENTHEADER = DOCUMENTHEADER, ACCOUNTPAYABLE = ACCOUNTPAYABLE });
but return exception:SAP RFC Error: RFC_CONVERSION_FAILURE with message: ACCOUNTPAYABLE of type RFCTYPE_TABLE cannot be converted to type RFC_STRUCTURE_HANDLE
Please someone support me
The text was updated successfully, but these errors were encountered: