Skip to Content
Author's profile photo Sai Krishna Chandra Mohan

Connect multiple SAP ECC clients from Java IDOC Sender Adapter by Resource Adapter Cloning

During testing phase of a project, there might be a scenario where SAP PI,PO or AEX 7.31/7.30 needs to be connected to SAP ECC’s multiple clients (say client 100 for Test Cycle-1, Client 200 for Test Cycle-2, etc. which might happen in parallel to each other) for sending and receiving IDocs.

SAP PI, PO or AEX Java IDOC receiver adapter can be configured using “RFC Client Parameters” as Manual, for which each SAP ECC’s Business System will have IDOC receiver communication channel which will be pointed to their respective SAP ECC clients as shown below.

IDocReceiverAdapter.png

But for Java IDOC sender adapter it’s a different configuration for connecting to multiple clients of SAP ECC.

The only “RFC Server Parameters” available in IDOC sender adapter are

  • Default (Recommended)
  • Manual
  • From NWA

When you configure as Default, which is by default one can connect to just one client of SAP ECC. For this you will be configuring in NWA the default inboundRA resource adapter by setting appropriate parameters and also creating the RFC destination (XI_IDOC_DEFAULT_DESTINATION) in NWA pointing the just one SAP ECC client.

When you configure as Manual, for which you can provide the appropriate parameters and create communication channel for each respective SAP ECC Business System for connecting each SAP ECC client. There might be a problem when you use this, as some security parameters which do not allow registering RFC server programs from remote host or a non-local host. The error is shown below.

JCOError.png

Last parameter left is “From NWA”. So, before setting this parameter we need to create/clone resource adapter for each client which we want to connect. For this you need to login to NWA –> Configuration –> Infrastructure –> Application Resources, Create a New Resource Adapter.

CreateRA.png

Use Default Template “SAPJRATemplate”

In Application enter the name for the Resource Adapter. Here I am following a naming as “inboundRA_<SID of SAP ECC>_<SAP ECC Client>” ex. inboundRA_SID_100, and then click Next.

RA1.png

In JNDI Name enter the same name of Resource Adapter given in the above step and give some description for the Resource Adapter, and then click Next.

RA2.png

Click on “JCA Connection Factory Details

RA3.png

Enter the JNDI a name. Here I am following a naming as “inboundRA_CF_<SID of SAP ECC>_<SAP ECC Client>” ex. inboundRA_CF_SID_100, and then click “Configuration Properties”.

RA4.png

Enter a Destination Name. Here I am following a naming as “XI_IDOC_DEFAULT_DEST_<SID of SAP ECC>_<SAP ECC Client>” ex. XI_IDOC_DEFAULT_DEST_SID_100, and then click “Save”.

RA5.png

Once Saved, the following Resource Names should be visible in Application Resources of NWA.

RA6.png

You need to add few properties to the Cloned Resource Adapter, so click on the Resource Adapter [Cloning] of inboundRA_<SID>_<Client XXX>. You can add property in the Properties tab by clicking “Add New Property”, after adding the properties save the Resource Adapter.

Add the following properties

Name

Type

Value

ProgramID

String

Naming what I follow XI_IDOC_DEFAULT_<SID>_<Client XXX>

Ex. XI_IDOC_DEFAULT_SID_100

MaxReaderThreadCount

Integer

5

GatewayServer

String

SAP PI PO AEX host name

GatewayService

String

sapgwXX (where XX is the gateway service)

XX is SAP PI/PO/AEX’s System number + 1

Ex. SAP PI/PO/AEX’s System number is 00 then gateway service is sapgw01

DestinationName

String

XI_IDOC_DEFAULT_DEST_<SID of SAP ECC>_<SAP ECC Client> Ex. XI_IDOC_DEFAULT_DEST_SID_100

local

Boolean

true

bindingKey

String

PI_AAE_IDOC

RA7.png

Now we need to create RFC destination from SAP PI to SAP ECC, NWA –> Configuration –> Security –> Destinations

Create a new Destination of Type RFC

Destination Name – The DestinationName given in the Resource Adapter Property above XI_IDOC_DEFAULT_DEST_<SID of SAP ECC>_<SAP ECC Client>

Dest1.png

Enter all the details of the Destination. Once all the parameters are entered, test the connection by clicking “Ping Destination”, make sure the ping is successful.

Dest2.png

Now start the resource adapter.

NWA –> Configuration –> Infrastructure –> Application Resources

Filter the Resource Name of the Resource Adapter, select it and click on More Actions and click Start Applications you want to start

RA8.png

Click on Start

RA9.png

If successfully started, you should be able to see all the Resource Names of the Resource Adapter in Application Resources are green.

RA10.png

Now enter the Resource Adapter Name in the IDOC Sender Communication Channel.

CC.png

In the SAP ECC system create a new RFC destination (SM59) of type T with a Registered Server Program for the each SAP ECC client.

Program ID – XI_IDOC_DEFAULT_<SID>_<Client XXX> (same name entered in the Resource Adapter property “ProgramID”)

Gateway Host – SAP PI/PO/AEX host (same name entered in the Resource Adapter property “GatewayServer”)

Gateway Service – SAP PI/PI/AEX gateway (same name entered in the Resource Adapter property “GatewayService”)

Save and Test the RFC destination.

Use this RFC destination when creating the IDOC port for sending IDocs (WE21) and use the port created in Partner Profile (WE20) in the respective test clients of SAP ECC.

References –

http://scn.sap.com/people/william.li/blog/2011/05/04/configuring-pi-730-java-idoc-adapter

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/10/21/pixi-pi-73-new-java-based-idoc-adapters-configuration-sender-receiver–teaser

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/29/ca36fa7f5544f6aa5808f1d3414184/content.htm

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/4a/5d28bcf2cb351ce10000000a42189b/frameset.htm

http://scn.sap.com/docs/DOC-34155

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Adish Jain
      Adish Jain

      good and usefull Blog Sai..

      Author's profile photo Rodrigo Ferradas
      Rodrigo Ferradas

      Usefull blog Sai.

      Regards.

      Author's profile photo Nageshwar Reddy
      Nageshwar Reddy

      Very interesting blog. Thanks for sharing this.

      Author's profile photo Former Member
      Former Member

      Thanks for this useful blog. we had this issue at a client of ours. Greetings.

      Author's profile photo Jens Schwendemann
      Jens Schwendemann

      Thanks for the blog, however, do you have any experience how multiRepository property of inboundRA would play a role in connecting multiple SAP backends?

      We currently are having the issue that multiRepository gets erased once in a while and we'll have to manually fill it again.

      Author's profile photo Christoph Ostrop
      Christoph Ostrop

      Hi, Jens,

      actually we are faced with the same issue,

      => http://scn.sap.com/thread/3529153

      the attribute in multiRepository is lost after system-restart.

      did you get any solution to your issue ???

      Christoph

      Author's profile photo Jens Schwendemann
      Jens Schwendemann

      Hi Christoph,

      unfortunatelly no. We still have this issue periodically but I'm not quite sure its on every restart. If I may be curious, what is your setting on "local" property of inboundRA?

      Cheers

      Jens

      Author's profile photo Christoph Ostrop
      Christoph Ostrop

      Hi, Jens,

      in property Local (local gateway) we have Value "false"

      Christoph

      Author's profile photo Christoph Ostrop
      Christoph Ostrop

      our entry for multiRepository is always lost after system-restart.

      > http://scn.sap.com/thread/3529153

      any idea ?

      Author's profile photo Former Member
      Former Member

      Nice blog Sai....

      Author's profile photo vinay mittal
      vinay mittal

      Really informative

      Author's profile photo Sreenivasa V
      Sreenivasa V

      Hi Sai,

      Please confirm below things...

      If I want to connect 2 clients i.e. 100 and 200 so for this

      I need to create 2 inboundRA's and 2 Connection factories and 2 rfc destinations right i.e. for each client one one thing.....

      Is My understanding is right.. Please confirm....

      Author's profile photo Sai Krishna Chandra Mohan
      Sai Krishna Chandra Mohan
      Blog Post Author

      HI Sreenivas,

      Yes. You need create 2 each, one pointing to 100 other to 200.

      Thanks,

      Sai

      Author's profile photo Jens Schwendemann
      Jens Schwendemann

      Sreenivas,

      as per my understanding you have two options:

      1. Create multiple inboundRAs etc (covered in this blog)
      2. Use one inboundRA and fill in parameter "multiRepository" accordingly (e.g. here http://scn.sap.com/docs/DOC-43471)

      Using multiRepository would be easier to set up and maintain. However, currently there seems to be a bug that empties multiRepository parameter when your "clients" 100 or 200 are down while PI is being restarted.

      In addition you may also consider performance on high load scenarios where you may have more flexibility when using multiple inboundRAs (e.g. adjust MaxReaderThreadCount to your needs)

      Thanks and kind regards

      Jens

      Author's profile photo Sreenivasa V
      Sreenivasa V

      Thanks Sai and Jens

      Can you please let me know the perfect blogs what actua use of this inboundRA and connectionfactory and jco rfc provider things.... I read in SAP JRA Architecture - SAP Java Resource Adapter - SAP Library   but not understanded fully..... Please help me on this...

      Author's profile photo kiran reddy
      kiran reddy

      Hi Sai Krishna,

      We have similar kind off requirement. Need to receiver IDocs from cross clients to PI 7.30 system.

      I have followed step by step approach as per your blog.....but unfortunately when iam trying to start the Resource Adapter it is not starting at all 🙁

      Please could you suggest here ?

      Author's profile photo dhivakar muthusamy
      dhivakar muthusamy

      You can check the View logs option in the more action tab of Start and stop : Java Applications for investigating exact issue in starting this application.

      Author's profile photo dhivakar muthusamy
      dhivakar muthusamy