Showing posts with label BizTalk. Show all posts
Showing posts with label BizTalk. Show all posts

Tuesday, August 11, 2009

Apply WCF BizTalk Adapter Pack to service-enable SAP BAPI/RFC's

One way to expose native SAP BAPI and RFC function modules is by generating a web service within SAP NetWeaver. In some cases this is less appropriate. For starters, you need to have a SAP Developer Key to be allowed to use the SAP web service wizard, and also have the required SAP authorizations. In other cases it may not be allowed by IT operations to make any modification to the SAP environment, even if it's limited to the full-automatic generation and activation of the BAPI webservice(s). Another reason from a system architecture viewpoint, is that the single BAPI and/or RFC calls may be of too low granularity. You actually want to perform a 'business transaction', consisting of multiple method invocations which must be treated as a Logical Unit of Work (LUW). SAP has introduced the concept of SAP Enterprise Services for this, and has delivered a first set of them. This is by far not complete yet, and SAP will augment it the coming years.
The by SAP delivered Enterprise Services will of course be limited to standard SAP functionality. In case of custom functionality you'll need to provide your own 'Enterprise Service' behaviour. This can be done in the SAP environment as a custom BAPI/RFC function module, and then exposed as BAPI webservice. However, another option is to apply the .NET WCF LOB Adapter SDK and the related BizTalk Adapter Pack. The LUW behaviour is then implemented within a .NET class. For transactional update behaviour, the .NET class must invoke BAPI_TRANSACTION_COMMIT at the end in case no problems are encountered, and otherwise BAPI_TRANSACTION_ROLLBACK to rollback all the earlier performed updates in the LUW.
Basic Steps:
  1. complement your local development environment:
    i) install the WCF LOB Adapter SDK 2.0
    ii) install the BizTalk Adapter Pack 2.0
    iii) install the SAP RFC SDK

  2. Generate in VS2005/2008 an 'Adapter Service Reference'; select the SAPbinding, configure the connection to the SAP system and connect, and next select the BAPI's and RFC's function modules that you're going to invoke in your business functionality. Important: if you need to implement a transactional update, also include the BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK function modules.

  3. Design and implement the client context that applies and invokes the SAP adapter binding.

The whitepaper Windows Communication Foundation (WCF) LOB Adapter SDK and the BizTalk Adapter Pack gives the reader a good and thorough insight on the vision and functionality of both. And excellent read for the ones interested in approaches to integrate arbitrair .NET clients (e.g. MOSS) with external Lines of Business application (e.g. SAP HR).
Tags: SAP NetWeaver Microsoft SharePoint integration interoperability WCF LOB Adapter

Friday, August 7, 2009

Tip - WCF LOB Adapter SDKs 'Add Adapter Service Reference' not present in VS2008

The WCF Lines of Business Adapter SDK contains development and runtime functionality to service-enable external applications. I downloaded and installed the SDK, but to my unpleasant surprise no change was visuable within the VS 2008 IDE. In particular, the promised 'WCF Adapter Service' project template is missing, as well as the 'Add Adapter Service Reference' menu option. As first repair I downloaded and installed the BizTalk Adapter Pack (which I'm going to need anyhow, since I want to service-enable SAP business functionality). However, still no change in VS2008...
After some fruitless searching on the web (bing-ing and googling...), I posted a question on the related forum. And thankfully with a quick and useful answer. When I installed the WCF LOB Adapter SDK I choose without really considering it the 'Typical' installation option. It appears however that the SDK authors do not consider the installation of the SDK 'Tools' to be part of the typical installation. A bit strange to my opinion for a development SDK, but instead handy for deployment of only the runtime parts of the SDK on an OTAP server. After augmenting the SDK installation I now do have both the 'WCF Adapter Service' project template as the 'Add Adapter Service Reference' menu option available.