SAP Adapter - Error connection SAPBasicException

Good morning,

I’m trying to connect the SAP Adapter to SAP following the manual, but when I clicked on “Enabled - No” to enable the connection, webMethods returns this error:


[ART.118.5042] Adapter Runtime (Connection): Unable to enable connection resource SAPConnection:connNode_SAP1.
[ART.118.5063] Adapter Runtime (Connection): Unable to start connection SAPConnection:connNode_SAP1: after 1 attempt(s).
[ART.118.5036] Adapter Runtime (Connection): Unable to configure connection manager.
[SAP.103.9103] WmSAP Adapter: Error on creating adapter connection: com.wm.adapter.sap.error.SAPBasicException - [SAP.100.9013] WmSAP Adapter: Error on retreiving runtime attributes: Initialization of destination SAP1 failed: Connect from SAP gateway to RFC server failed
Connection parameters: TYPE=R DEST=SAP1 TPNAME=ESB GWHOST=192.XX.XX.XX GWSERV=3300 PCS=1 DELTA=0

LOCATION    SAP-Gateway on host xxxxxxxx / sapgw00
ERROR       program ESB not registered
TIME        Wed Jun 26 15:56:17 2019
RELEASE     773
COMPONENT   SAP-Gateway
VERSION     2
RC          679
MODULE      /bas/773_REL/src/krn/si/gw/gwr3cpic.c
LINE        2063
DETAIL      TP ESB not registered
COUNTER     3
: Connect from SAP gateway to RFC server failed
Connection parameters: TYPE=R DEST=SAP1 TPNAME=ESB GWHOST=192.XX.XX.XX GWSERV=3300 PCS=1 DELTA=0

LOCATION    SAP-Gateway on host xxxxxxxxxxxxxxxx / sapgw00
ERROR       program ESB not registered
TIME        Wed Jun 26 15:56:17 2019
RELEASE     773
COMPONENT   SAP-Gateway
VERSION     2
RC          679
MODULE      /bas/773_REL/src/krn/si/gw/gwr3cpic.c
LINE        2063
DETAIL      TP ESB not registered
COUNTER     3

In the Package tab of Integration Server, the package WmSAP works.

Can anyone help me please?

Thank you,
Diego

You have to set the gateway service configuration at SAP end as well. Did you confirm if you have done so?

I apologize for being late.
I don’t manage the SAP side, but the SAP vendor told me that is the system is configured. We tested the ESB server also with RSSBus, a little system with a SAP connector, and its work. We also done test with RFCExec, an official SAP program to test the connection, and its work.

How can i check the correct configuration between SAP and webMethods?

Thank you,
Diego

Hi Diego,

please provide your SAP-Adapter version with applied Fixes as well as the version for the JCo API and JCo IDoc API.

Did you configure the /etc/services (or windows analogon) to reserve the ports from 3200 thur 3299 and 3300 thru 3399 for the SAP Adapter?
See SAP Adapter Users Guide and/or Readme for futher informations.

Can you share parts of your SAP Connection and/or SAP Listener config (remove ip adresses and user info if neccessary)?

Regards,
Holger

1 Like

Hi Diego,

An SAP instance can communicate with external programs through different application protocols. These application protocols are transported through the Transaction Control Protocol (TCP). An SAP instance component opens a TCP port on its host for each application protocol. SAP Basis supports the following three protocols:

Dynamic Information and Action Gateway (DIAG)
DIAG is an application protocol used for communication between the SAP GUI and SAP instance. The SAP instance uses this protocol to send screens and lists to the SAP GUI and to accept user commands.The dispatcher implements this protocol within the SAP instance. The
dispatcher opens the TCP port with the number 32 on the host to communicate with DIAG. Because the port numbers must be
unique, every instance on a host must have a different port number. In the services file of computers that want to communicate with an
SAP instance through this port, the sapdp service name is assigned to the port.

Remote Function Call (RFC)
RFC is an SAP application protocol that external programs can use to call function modules in the SAP instance. In this case, parameters can
be transferred to the function module and received by it. RFC is implemented by the gateway. The gateway opens the TCP port
with the number 33 on the host; the corresponding service name is sapgw.
When the SAP GUI is being installed on a computer, the service names and relevant port numbers are automatically entered into the services
file. The services file is located under /system32/drivers/etc on Windows systems.

To send and receive IDocs, the ALE subsystem must be configured
accordingly.

The following steps are required:

  1. Define logical systems.
    Each system participating in ALE is identified by a logical name. These
    names are entered in the TBDLS database table.
  2. Assign logical systems to clients.
    A logical system is assigned to every client in an SAP system by maintaining
    the master data of the client.
    **3. Define target systems for RFC calls.
    In the sending system, you must use Transaction SM59 to create tRFC
    destinations for the target system. If the tRFC destination has the
    same name as the target system, some definitions can be generated
    automatically in the last step.
  3. Maintain distribution model.
    Here it is determined which messages the sending system sends to
    which receiving systems. This step is performed in the sending system.
  4. Maintain partner profiles.
    Finally, it is determined how outbound IDocs are sent to the receiving
    systems

You’ve to make sure step3 in particular reflects the same value you’ve configured in the SAP Adapter listener configuration for the gateway service.

For more info, please purchase the book SAP Interface Programming from SAP press. Otherwise if you’ve sure the issue lies on SAP side, I suggest you pass this back to your SAP Basis team to check. Also you may turn on SAP adapter debug log by set LOG level to TRACE for the setting at both server logger > SAP Adapter and also SAP Adapter > Setting > 8 (Verbose) and select all subsysystems.

I’ve already add the ports in the services file.

These are the versions:
-) webMethods: 10.3.0.0
-) SAP-Adapter: 10.1.0.0.1008
-) JCo: 3.0.19 (2018-12-03)
-) IDoc: 3.0.13 (2018-10-01)

In the attachment you’ll find the connector&listener’s screenshot


ESB1.PNG

I’ll send this part to our SAP vendor, thank you Mike.

I’ve found only the 6.5 version of this manual, could you give me the link of the latest version?
Thank you Holger

Hi,

please check if you have access to the following link:
http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/adapters_estandards/Adapters/SAP/sap.htm

You will find the new guides there.
Meanwhile the guide is named “Installation and Users Guide”.
Up to 6.5 these were two separate guides, starting with 7.1 they have been merged into one document.

Regards,
Holger

Thank Holger.

have you seen if anything is missing in the connector?

Hi Diego,

we do not use it like this.

We always keep the “External RFC Server” empty.
The Program-ID will be defined in the Listner and SAP Administration Team maps them in SM59 transaction to the proper destinations in SAP.

Regards,
Holger

Hi Mike,

I sent these notes to our SAP Vendor but they replyed that they have already checked all the steps.

Hi Holger,

I tried to set the “External RFC Server” empty, with the IP Address in the Application Server field, then I followed the SAP Connection Tutorial ( http://techcommunity.softwareag.com/pwiki/-/wiki/Main/webMethods+SAP+Adapter+Tutorial ) and it looks like it’s working. I tested only the RFC communication to call badi, but how can i test this configuration when SAP sends to webMethods an IDOC?

Creating IDOC

  1. Open SAP GUI
  2. Login using SAP credential
  3. Call up for WE19 from the SAP GUI Main Menu
  4. It will open Test tool of IDOC Processing
  5. Choose Via message type
  6. Enter MATMAS
  7. Select Edit → Edit Control Record.
  8. Enter sender and receiver port related information
  9. Tick the tick icon
  10. Click the Standard Outbound Processing
  11. If you want to create more than 1 IDOC, change the value on No. of IDOCS to be generated (repeat factor) to value more than 1
  12. Tick the ticked icon and the IDOC is created.
  13. Check the creation message at the bottom left of the screen
  14. Check SAP Adapter transaction (SAP Adapter > Transactio) page
  15. If successful, it will list out as “confirmed” or “commited”. If failed, it will show as “rollback”. If you want to see the detail logging, I suggest to open RFC Trace and CPIC trace for more info. If it got rollbacked, you can always check SM58 on SAP side to see what error code captured.

I suggest whoever want to understand or going to implement solution based on ALE/SAP/IDoc technologies, please read these books or try to get your hands on them:

  1. ALE, EDI, & IDoc Technologies for SAP, 2nd Edition
  2. What on Earth is an SAP IDoc?
  3. SAP Press: SAP Interface Programming written by Michael Wegelin, Michael Englbrecht

A lot of question will be answered itself by just going through them straightforward.

Hi Diego,

I strongly suggest you to log a case to GS SAG if you have a valid support contract in place.

I believe they will be able to assist you diagnose this issue further.

Hi Mike,

I tryed with the SAP Vendor to send an IDoc from SAP to webMethods, ma also with the External RFC Server = No, SAP cannot send IDoc, while i can see the BADI.

Hi Diego,

please check with your SAP Partner the following parameters:

  • Program-ID, under which you will receive the data. (this goes to the SAP-Listener configuration in SAP Adapter UI)
  • SAP Partner should create an appropriate destination in SAP-System where they are sending the IDoc to.
  • Have them map Program-ID and Destination together by using Transaction SM59.

Create a Listener Notification in Designer and assign it to your listener to listen on the IDoc type.
Define the fields you want to extract from the document.

Regards,
Holger