none
SAP Adapter as an RFC Server RRS feed

  • Question

  •  

    Hello all,

     

    I'm working on a SAP integration project, where SAP must asynchronously call BizTalk.

    I've been looking into the SAP adapter documentation and it talks about the steps required on the SAP side so that the Adapter may be used as an RFC Server.

     

    I also came across this How to Trigger a BizTalk Orchestration from SAP

    http://technet.microsoft.com/en-us/library/ms942196.aspx

     

    This is a bit dated. Is this still the right way to have SAP call BizTalk through the new WCF Adapter? Obviously I'm only talking about the SAP config part.

     

    Kind regards,

    Kostas

    Wednesday, January 9, 2008 8:38 AM

Answers

  • The article you mention is still relevant and very useful in configuring the SAP side of RFC server. However in the BizTalk side example, it illustrates using the BizTalk SAP Adapter (not the WCF based one which ships as part of the Adapter pack). To use the WCF based SAP adapter you need to change the way you configure the receive port in BizTalk. You would need to create a WCF custom receive location and choose SAP as the custom binding there - more details on this are present in the WCF SAP adapter documentation.

     

    Also the BizTalk SAP adapter only supported IDocs as a RFC server scenario. The WCF based SAP adapter also supports generic RFC server. Hence you can trigger a BizTalk orchestration by making a call to an RFC using the RFC server mechanism. Using IDocs to trigger a BizTalk orchestration will also work with the WCF based SAP adapter.

     

     

    Sunday, January 13, 2008 2:18 PM
  • This question has also been answered through the BizTalk Discussion Group.

     

    Hi Kostas

     

    Yes, the WCF-based SAP adapter supports RFC server  scenarios. Attached RFC server sample (using BTS orchestration).

     

    RFC server scenarios require an RFC destination and a PROGRAM ID to be configured (using transaction SM59 in SAP). In the example attached, SAP calls function Z_RFC_MKD_ADD (you could do this by invoking it from transaction SE37) which is received into a BTS orchestration via the SAP adapter. The orchestration has logic to add the 2 numbers (received as input parameters) and return the response to SAP.

     

    The RFC code in SAP is as follows (as you can see it has no implementation logic. All of it is in the BizTalk orchestration). The code just calls function Z_RFC_MOD_ADD onto a destination (this is the destination you should configure in SAP).

     

    FUNCTION Z_RFC_MKD_ADD.

    *"----------------------------------------------------------------------

    *"*"Local interface:

    *"  IMPORTING

    *"     VALUE(X) TYPE  INT4

    *"     VALUE(Y) TYPE  INT4

    *"     VALUE(DEST) TYPE  CHAR20 DEFAULT 'BIZTALK4'

    *"  EXPORTING

    *"     VALUE(RESULT) TYPE  INT4

    *"----------------------------------------------------------------------

     

    CALL FUNCTION 'Z_RFC_MKD_ADD' DESTINATION DEST

      EXPORTING X = X

                Y = Y

      IMPORTING RESULT = RESULT.

     

    ENDFUNCTION.

     

     

    The BizTalk Adapter Pack RC documentation has detailed instructions on the RFC Server scenario.

     

    Cheers,

    Maha

     

    Monday, January 14, 2008 12:28 AM

All replies

  • The article you mention is still relevant and very useful in configuring the SAP side of RFC server. However in the BizTalk side example, it illustrates using the BizTalk SAP Adapter (not the WCF based one which ships as part of the Adapter pack). To use the WCF based SAP adapter you need to change the way you configure the receive port in BizTalk. You would need to create a WCF custom receive location and choose SAP as the custom binding there - more details on this are present in the WCF SAP adapter documentation.

     

    Also the BizTalk SAP adapter only supported IDocs as a RFC server scenario. The WCF based SAP adapter also supports generic RFC server. Hence you can trigger a BizTalk orchestration by making a call to an RFC using the RFC server mechanism. Using IDocs to trigger a BizTalk orchestration will also work with the WCF based SAP adapter.

     

     

    Sunday, January 13, 2008 2:18 PM
  • This question has also been answered through the BizTalk Discussion Group.

     

    Hi Kostas

     

    Yes, the WCF-based SAP adapter supports RFC server  scenarios. Attached RFC server sample (using BTS orchestration).

     

    RFC server scenarios require an RFC destination and a PROGRAM ID to be configured (using transaction SM59 in SAP). In the example attached, SAP calls function Z_RFC_MKD_ADD (you could do this by invoking it from transaction SE37) which is received into a BTS orchestration via the SAP adapter. The orchestration has logic to add the 2 numbers (received as input parameters) and return the response to SAP.

     

    The RFC code in SAP is as follows (as you can see it has no implementation logic. All of it is in the BizTalk orchestration). The code just calls function Z_RFC_MOD_ADD onto a destination (this is the destination you should configure in SAP).

     

    FUNCTION Z_RFC_MKD_ADD.

    *"----------------------------------------------------------------------

    *"*"Local interface:

    *"  IMPORTING

    *"     VALUE(X) TYPE  INT4

    *"     VALUE(Y) TYPE  INT4

    *"     VALUE(DEST) TYPE  CHAR20 DEFAULT 'BIZTALK4'

    *"  EXPORTING

    *"     VALUE(RESULT) TYPE  INT4

    *"----------------------------------------------------------------------

     

    CALL FUNCTION 'Z_RFC_MKD_ADD' DESTINATION DEST

      EXPORTING X = X

                Y = Y

      IMPORTING RESULT = RESULT.

     

    ENDFUNCTION.

     

     

    The BizTalk Adapter Pack RC documentation has detailed instructions on the RFC Server scenario.

     

    Cheers,

    Maha

     

    Monday, January 14, 2008 12:28 AM
  • no sure if this is a similar problem but ...

     

     

    MATMAS IDOC message was coming through from SAP as evidenced from entry in HAT saying i did not have a type installed for this message.

    The sapbinding parameter ReceiveIDOCFormat was set to typed.

     

    Tried sending an Order IDOC through but no evidence of it.  Not even network sniffer showed traffic.

     

    When i switched the ReceiveIDOCFormat to rfc miraculously it came through but with the following error message

     

    There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port: "WcfReceivePort_SAPBinding_IdocORDERS01V3R700_Custom" URI: "sap://CLIENT=............." Reason: Finding the document specification by message type "http://Microsoft.LobServices.Sap/2007/03/Rfc/#IDOC_INBOUND_ASYNCHRONOUS" failed. Verify the schema deployed properly.

     

    but unfortunately MATMAS messages stopped flowing.

     

     

    I dont understand the correlation.  Is something on SAP side different about these two IDOC messages?

    Or how they are delivered to the place where my receive port is listening?

     

    Wednesday, March 26, 2008 7:58 PM