问题
I am trying to use the .Net connector to send data to an SAP system. I have been able to send calls to RFC function module quite easily but there doesn't seem to be any way to send a standard Idoc directly. This is quite weird because Idocs are supposed to be the standard communication tool to talk with SAP.
Has anyone found if/how it's possible to do it?
回答1:
As far as I know there is currently no development library offered by SAP for the .NET Connector (NCo) for dealing with IDocs. If you would like to use the NCo, you have to code this IDoc handling stuff on your own. It's possible because also IDocs are usually transferred by calling special Remote Function Modules (e.g. IDOC_INBOUND_ASYNCHRONOUS). But this can become really cumbersome and difficult, especially if it should also work with non-unicode ABAP systems and multi-byte code pages like Chinese, Japanese or Korean.
But if you do not need to stick to NCo, I think the easiest way to do own development with using IDocs, is to switch to Java and use the SAP Java Connector (JCo) in conjunction with the SAP Java IDoc Class Library add-on. NCo and JCo have a very similar API, but this Java IDoc Class Library add-on is what is unfortunately missing for the .NET environment - at least it is not offered by SAP and I also do not know any other .NET library for this.
回答2:
There is no functionality within the NCO to send IDOCs, the NCO is intended for development of RFC clients or RFC servers using .NET. A simple search on stack I found the following with some suggestions that might help you if this is still the way you want to go.
How to create and send Idocs to SAP using SAP .Net Connector 3
BTW I wouldn't say that IDOCs are the standard communication tool for SAP, it is one of many and they are all equally valid so just depends on your situation.
Later...
来源:https://stackoverflow.com/questions/45354130/sap-net-connector-3-0-how-can-i-send-an-idoc-from-a-non-sap-system