Additional SharePoint and SAP Info
Ted Teng, who's been contributing a lot to SharePoint (especially his MSD2D articles), is posting a short series on connecting SharePoint and SAP. I had the (mis)fortune of having to do this with a previous project I was on (can you tell I loathe SAP?) and while it's interesting, having to deal with SAP (at least in our environment) was just plain painful. Having no .NET developers on the SAP side of things didn't help as I just wanted to call a Web Service but unfortunately we had to interface to the BAPI calls and thus the whole .NET connector garbage is there. Ted's posts can be found here (Part I: Setup) and here (Part II: Defining the Proxy).
Anyways, just a couple of things to add on Ted's posts. His IT guy said in his first post "It would require no additional server components. Your .Net Applications would communicate directly to R/3 46C via RFC with the inclusion of a single Assembly DLL." In the immortal words of Albert Nimziki, "Uh... Mr. President. That's not entirely accurate." In addition to having to deploy the SAP.Connector.RFC.dll we also had to deploy the SAP.Connector.dll. This is the core of the connector when then proxies calls through the RFC protocol to SAP. I didn't see the SAP.Connector.dll mentioned in Ted's diagram so I thought I would mention it here. If you install the connector through the install program it doesn't show up because it's tossed in the GAC in your development environment but for deployment to a WSS server (where you don't want to install anything except WSS, trust me) you might miss it.
Also (our environment again) we needed to update the SERVICES file (found in %WINDIR%\system32\drivers\etc directory). This file contains alias' to the SAP system with the protocol to us. While you do set the name of the server you're connecting to in the Server Explorer and it can resolve via DNS no problem, internally the connector will use the SAP alias (or whatever the heck they call it) to make the actual RPC call. So if you get some odd error like "cannot find server sapdp00" in your exception, this might be the cause. Again, our environment so YMMV.
Doing it this way, I was able to include the SAP setup as part of our build so the other developers didn't need to install the connector or anything. They just copied three DLL files to the server and updated the SERVICES file (the LIBRFC32.DLL couldn't be deployed to the bin directory like the connector DLLs could so we had to copy it to %WINDIR%\system32 for everything to work). Oh yeah, one more thing. If your IT people in SAP land update the BAPI calls (in any way, even just recompiling them) then you'll need to regen your proxy classes. I separated them out in our solution and put them into an isolated service layer so we didn't have to deploy our entire solution when SAP changed. Hope that helps.