huysentruitw / SapNwRfc

SAP NetWeaver RFC library for .NET 5, .NET Core and .NET Framework
MIT License
148 stars 43 forks source link

Consistent mapping with plain old sapnco #39

Closed Wouter-Vandenputte closed 2 years ago

Wouter-Vandenputte commented 3 years ago

We are moving away from the old .NET Framework and moving everything to .NET5 SAP unfortunately does not offer their sapnco.dll file for the new .NET5, so we are trying out this library instead.

But it seems that migration is not so easy. For example, the following properties are abscent in this library that are present in the official one

So we have overridden the SapConnectionsParameters class and added them ourselves. Tests will point out if our SapName attribute was correct.

But the largest issue we are facing now is that of classes which are non-existent in this library. For example, the official library offers a service that works with RfcDestination with the service called RfcDestinationManager.GetDestination(rfcConfig);. Also, the official library had classes that inherits IRfcFunction which exposes methods like GetTable or SetValue, while ISapFunction has no such functionality.

Other missing classes are IRfcStructure, IRfcTable. Do we need to rework our entire app if we want to use this library or how would that be achieved in this library?

huysentruitw commented 3 years ago

Regarding the missing connection parameters: you can indeed override the SapConnectionParameters class or if you want them in this library, I'm happy to accept a pull-request.

Regarding RfcDestination, I have never used the sapnco library of any other library for communicating with an SAP system, so I have no idea what that method is supposed to do. In February, @campersau has added a GetAttributes on ISapConnection/SapConnection that contains a Dest property, perhaps this is what you're looking for?

Regarding IRfcStructure and IRfcTable: this library uses object mapping by convention. C# classes, structs or records are mapped to RFC structures, while C# arrays are mapped to RFC tables.

In general: in no way this library tries to be compatible with sapnco.