I thought I’d share a few interesting SAP tales.

I’ve been working on a project lately of integrating with not 1 SAP Server, but 2
and the 2nd one is across the seas accessible via a SAP Router (which
is similar to Proxy Servers for the internet). I’ve got to thank Rohit Singh (MS)
and his team for some great feedback, as well as Scotty and Kent Weare whom were helping
me to nut out where half these settings go.

Specifically I needed BTS to be a ’remote RFC server’ for the two SAP Servers.

What does a Router string look like I hear you ask – “/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme”. Something
like that, and the user’s type this into the SAP Client UI to connectmy chances of
being able to ’stick’ this somewhere in the BizTalk world was diminishing.

So I had to get my BizTalk box to talk through the ’SAP Router’ out with the right
credentials to another SAP Server 1200KMs away”good luck” little adapter I thought.
(“good luck” Mick I though too)

Here’s the low down:

  1. Use a saprfc.ini file – scarce documentation, but do able.
  2. Set a RFC_INI System Environment variable.
  3. Turn on Rfc Tracing
  4. Get on well with the SAP teams.
  5. Get on well with the SAP teamsoh I mentioned that one already.

Here’s how you do it – after you’ve installed and setup the prereqs for the SAP Adapter
(don’t forget to add the SAP Adapter property schema to BizTalk)

Starting out:

– I jumped in and used the ‘Consume Service Adapter’ Wizard to work out connection
details and look at the IDOCs schemas.

The problem is – as time goes by, you want to see debugging and other details to tweak
as trying to establish a connection. The Receive Location (WCF-Custom, sapBinding)
SAP URI get’s horribly long.

 

I was happy to put up with this when I got the first connection to the SAP Server1
(local).

 

This *didn’t* work for SAP Server2(remote) – trust me, it’s a square peg in a round
hole.

 

Using SAPRFC.INI :(generally the MS Docs will get you started, but
I found they had incomplete settings so I had to go elsewhere – a Siebel->SAP 2001
document served the purpose)

  1. Create a System Environment Variable called RFC_INI  and point
    it to where you want your saprfc.ini file to live.
    e.g. SET RFC_INI=d:\BizTalk_Dev\SAP\saprfc.ini
    (the MS documentation doesn’t say *exactly* where to put the saprfc.ini –
    I tried it in the bts folder, windir…many places)
  2. Set the Receive Location to use the saprfc.ini – e.g. sap://client=110;lang=en;@D/SAPSERVER?LISTENERDEST=BTS_INBOUND&RfcTraceSdk=true
  3. Using the SAPRFC.INI file

Sample SAPRFC.INI – for local SAP connection

DEST=SAPSERVER
TYPE=A
ASHOST=DEVAPP1
GWHOST=DEVDB1
GWSERV=sapgw00
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0
USE_SAPGUI=0

DEST=BTS_INBOUND
TYPE=R
GWHOST=DEVDB1
GWSERV=sapgw00
PROGID=BizTalkDev_Inbound  (<– this is allocated from SAP)
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0
USE_SAPGUI=0

Connecting to a SAP Server via a SAP Router String – sample
saprfc.ini
e.g. router string -/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme

ListenerURI (BTS Receive Location) = sap://client=110;lang=en;@D/ACMESAP?LISTENERDEST=ACMESAP_INBOUND&RfcTraceSdk=true

DEST=ACMESAP
TYPE=A
ASHOST=/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme
GWHOST/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme

GWSERV=sapgw00
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0

DEST=ACMESAP_INBOUND
TYPE=R
GWSERV=sapgw00
GWHOST=/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme
PROGID=BizTalkDev2_Inbound
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0

 

 

HTH folks and saves you guys some time – 🙂