Wednesday 13 August 2008

Some Information On WCF Adapter-SAP

The SAP.NET Connector exposes two classes for dealing with IDocs - SAPIDocSender, and SAPIDocReceiver (I hope I got the names correct). Both these methods deal only with data in "flat file" format as we call it - a bunch of lines of text - the first line represents the Control Record, and then each subsequent line represents a Segment.

The WCF Adapter exposes a Send() and Receive() method to do something almost similar. The difference is that the methods are actually something like Send(ORDERS05), Send(MATMAS03), etc (and similarly for Receive) - these operations are "strongly typed" to a specific IDoc, which allows for better validation. In order to obtain this metadata, at runtime, the adapter executes IDOCTYPE_READ_COMPLETE to get the metadata, so that the adapter can validate the data flowing across. Hence, we make the extra calls, for exposing extra functionality.

The Adapter also exposes a SendIdoc() and ReceiveIdoc() call, which is similar to the SAP.NET Connector - the functions just take in a String (which should contain the lines of text, with the first line being the control record, and subsequent lines being the data records) - in these functions, since there is no metadata to validate, the adapter won't make any extra calls to IDOCTYPE_READ_COMPLETE.

Therefore, you should be able to use the SendIdoc() / ReceiveIdoc() methods in your scenario.

This forum post seems to be very similar : http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3725298&SiteID=1, and also contains a MSDN link to the SendIdoc()/ReceiveIdoc() methods.

In the MSB UI, on the left pane, click on IDOC (which is the top level category along with RFC / TRFC / BAPI). In the right top pane, SendIdoc and ReceiveIdoc should show up - they appear there, since they are generic operations for all IDocs (as compared to Send/Receive, which only show up after you've navigated the tree to a particular MessageType+IdocType+Release+Version).
***************************************************

No comments: