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.
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.
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.
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.
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.
Click on “JCA Connection Factory Details”
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”.
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”.
Once Saved, the following Resource Names should be visible in Application Resources of NWA.
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 |
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>
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.
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
Click on Start
If successfully started, you should be able to see all the Resource Names of the Resource Adapter in Application Resources are green.
Now enter the Resource Adapter Name in the IDOC Sender Communication Channel.
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://help.sap.com/saphelp_nw73ehp1/helpdata/en/29/ca36fa7f5544f6aa5808f1d3414184/content.htm
http://help.sap.com/saphelp_nw73ehp1/helpdata/en/4a/5d28bcf2cb351ce10000000a42189b/frameset.htm
good and usefull Blog Sai..
Usefull blog Sai.
Regards.
Very interesting blog. Thanks for sharing this.
Thanks for this useful blog. we had this issue at a client of ours. Greetings.
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.
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
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
Hi, Jens,
in property Local (local gateway) we have Value "false"
Christoph
our entry for multiRepository is always lost after system-restart.
> http://scn.sap.com/thread/3529153
any idea ?
Nice blog Sai....
Really informative
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....
HI Sreenivas,
Yes. You need create 2 each, one pointing to 100 other to 200.
Thanks,
Sai
Sreenivas,
as per my understanding you have two options:
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
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...
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 ?
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.