Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to I find out the SAP Gateway Hostname?

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
0
0
US
Hi,
I'm a QA Engineer who was given the unpleasant task of testing a SAP plug-in for one of our products. I know absolutely nothing about SAP and I've only been stumbling around the SAP GUI for a few days, so please be explicit in your explainations. :)

The program I'm testing uses the SAP RFC library to communicate to SAP from a Windows box. I've tried a number of different options with varying levels of success, but I'm 99% sure I just need to set the right options in the saprfc.ini file.

I'm communicating to a SAP R/3 server, and I can connect to it since I managed to lock out my User ID with too many failed logins. ;-) This is the information that I have about the SAP server I'm using:
- Application Server IP Address.
- System ID.
- System Number = 00
- System = R/3
- Client = 500 (whatever that means?)
- Username.
- Password.
- Language = EN

I set the following info in my saprfc.ini file:
Code:
DEST=BIN_HS0011
TYPE=E
ASHOST=##.##.##.##
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0
USE_SAPGUI=0
With that I get the following in my trace file:
Code:
**** ERROR file opened at 20070221 191322 Eastern Standar, REL 46D,0,925, VER 3 MT-SL
T:2704 ======> SAP gateway host name 'GWHOST=' not found
So I believe I need to add GWHOST and GWSERV parameters for the "SAP Gateway Hostname" and "SAP Gateway Service Name".
I managed to figure out how to add the BIN_HS0011 RFC Destination all by myself! [smarty] I just don't know how to find what the gateway hostname is or the service name (whatever that is?).

Any help you SAP experts can provide would be greatly appreciated.
 
Here are all the TYPE values I've tried and the errors I get with each of them:

Using TYPE=2
Code:
**** ERROR file opened at 20070222 163523 Eastern Standar, REL 46D,0,925, VER 3 MT-SL
T:1720 ======> Connect to SAP gateway failed
Connect_PM  DEST=BIN_HS0011, GWHOST=ihsap4, GWSERV=sapgw00

LOCATION    SAP-Gateway on host eccserver2 / sapgw00
ERROR       max no of SAP gateway workprocess (0) exceeded

TIME        Thu Feb 22 16:28:17 2007
RELEASE     700
COMPONENT   SAP-Gateway
VERSION     2
RC          231
MODULE      gwxxrd.c
LINE        4270
DETAIL      check parameter gw/max_wp, actual value is 0
COUNTER     4

Using TYPE=A
Code:
**** ERROR file opened at 20070222 120922 Eastern Standar, REL 46D,0,925, VER 3 MT-SL
T:3772 ======> RFC server type unknown (only 2, 3 or E available)

Using TYPE=3
Code:
**** ERROR file opened at 20070222 121046 Eastern Standar, REL 46D,0,925, VER 3 MT-SL
T:3628 ======> TYPE for destination 'BIN_HS0011' not valid

Using TYPE=E
Code:
**** ERROR file opened at 20070222 120534 Eastern Standar, REL 46D,0,925, VER 3 MT-SL
T:3000 ======> TP host name 'TPHOST=' not found
 
Hello,

I am not very familiar with RFC connections; but I hope I can help a little.
I think first of all you will have to find out wich TYPE= you will need; this link may be helpful:

The 'service' you asked about is just one of the services defined in your 'services' file; they are used for SAP communication; they depend on your system number; for '00' you will need at least one (or maybe all) of these entries in your services file:
sapdp00 3200/tcp
sapgw00 3300/tcp
sapmsXXX 3600/tcp # replace XXX by your SAP system ID (3 Characters)
 
Thanks.
I added those to my 'services' file, and now after banging my head on the keyboard all day and reading lots of SAP 'help' pages, I believe I need to use TYPE=E. The only problem now is it tells me "hostname 'qa-win2k3-dc1' unknown", even though I added qa-win2k3-dc1 to my Windows hosts file.
So now after reading some more SAP pages, I think I might need to install SAProuter on my machine for it to work. What do you think?
 
Hello,

I don't think that you need to install SAProuter on your machine. It is necessary to connect systems in different networks. The most common use for it is connecting customer systems with SAP support at Walldorf/Germany or a few other places all over the world.
If I understood correctly, your systems are in the same local network? And in your first posting you wrote that you are able to connect to your SAP system. Is this correct? Not sure then what else needs to be done ...

And the 'hostname unknown' seems to be a network issue. Maybe your machine is using DNS instead of hosts file? (I know, SAP says you have to put it in the hosts file. But there also are other helps files regarding DNS.)

hope this helps
 
Actually, I'm connecting to a SAP system across the Internet, not on my local network.

Windows always checks the 'hosts' file before looking in the DNS.
 
ok, in this case I think you will need SAProuter, but not necessarily on your machine. Any machine in your local network will do.
 
Thanks, I'll try that when I get to work (I have a cold now). Do you know where I can download SAProuter from?
 
At there is a link 'Software download'.
You will need a login for it, usually an S-user, that is a username with an S followed by a long number. If you haven't got one so far, you could ask a colleague to download it for you. If your company is a customer or partner of SAP, it should be no problem getting one of your own.
By the way, it's always quite annoying when I have to download from SAP; it takes a long time to find what I need. Or is it just me .... ? [wink]
 
Hello again,

I just did a bit of research:
service.sap.com/patches
'Support Packages and Patches' -> 'Entry by Application Group' -> Link 'Additional Components' -> 'SAPROUTER'
and probably SAPROUTER 6.40

hope this helps
 
OK, I installed SAP GUI on my test machine, but it didn't help. :-(

My configuration is like this:

RFC Program (sapagent.exe) on test system (qa-win2k3-dc1)
|
|
Internet
|
|
Remote SAP Server (eccserver2)


My saprfc.ini looks like:
Code:
DEST=WINTOSAP
TYPE=E
GWHOST=eccserver2
GWSERV=sapgw00
TPHOST=qa-win2k3-dc1  /* or eccserver2? */
TPNAME=/Progra~1/cpjust/Synchr~1/sapagent.exe
RFC_TRACE=1
USE_SAPGUI=1

Whenever I have TPHOST set to my local test machine (qa-win2k3-dc1) I get this in the RFC Trace:
Code:
======> Connect from SAP gateway to RFC server failed
Connect_PM  DEST=WINTOSAP, GWHOST=eccserver2, GWSERV=sapgw00, TPHOST=qa-win2k3-dc1, TPNAME=/Progra~1/cpjust/Synchr~1/sapagent.exe

LOCATION    SAP-Gateway on host eccserver2 / sapgw00
ERROR       hostname 'qa-win2k3-dc1' unknown

But if I set TPHOST to the remote SAP server (eccserver2), I get this in my RFC Trace:
Code:
======> Connect from SAP gateway to RFC server failed
Connect_PM  DEST=WINTOSAP, GWHOST=eccserver2, GWSERV=sapgw00, TPHOST=eccserver2, TPNAME=/Progra~1/cpjust/Synchr~1/sapagent.exe

LOCATION    SAP-Gateway on host eccserver2 / sapgw00
ERROR       Start of TP /Progra~1/cpjust/Synchr~1/sapagent.exe failed

I'm not 100% sure what I'm supposed to use for TPHOST & TPNAME? Do I put the host name of where the RFC program is running on, or the SAP server that it's contacting?
 
Also, in the 'RFC Destination WINTOSAP' on the SAP server (which is a TCP/IP connection type), I have the following choices for "Activation Type":
- Start on Application Server
- Start on Explicit Host
- Start on Front-end Workstation
- Registered Server Program

The SAPGUI Help doesn't have any information for this, so I'm guessing I need either "Start on Explicit Host" or "Start on Front-end Workstation"?
I can't get it to work with either setting.
 
Success at last!!! [thumbsup]

I finally got my RFC program to talk to SAP (and it only took a week to figure out). For anyone else who might need to go through the same nightmare in the future, here's what I did:

I used an RFC Destination Type = 3 in SAP. Almost any combination of settings works for me, I believe Target Host and System Number are required in the Techical Settings tab.
In Logon & Security, I entered Language = EN, my Client #, and User & Password with Admin privileges.
In MDMP & Unicode, I can use either Unicode or Non-Unicode.
In Special Options, I can use qRFC = 0 or 1.

Then in my saprfc.ini on my test machine, I have:
Code:
DEST=BIN_HS0011
TYPE=[b]A[/b]
ASHOST=1.2.3.4  /* Where 1.2.3.4 is the IP address of my SAP server. */
SYSNR=00
GWHOST=eccserver2
GWSERV=sapgw00
Then, the most important thing of all --- I changed the password of my admin SAP user to be all numeric. I don't know if it's a problem with the settings on the SAP server which is mis-interpreting the password from RFC or if it's a bug in my RFC program, but that was the problem holding me back all week.

BTW, I didn't need SAProuter or the SAP GUI installed on my test machine after all. At least not for TYPE=A.

Thanks for all your help. I learned more than I ever wanted to know about SAP. ;-)
 
cpjust,

glad you got it to work,
and thank you very much for posting your findings here!
 
One final thing I just found out... The problem I was having was a bug in the RFC program I'm testing. It was written for an older version of SAP which apparently only supported upper case passwords, so my RFC program was changing the password to uppercase behind the scenes. :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top