cancel
Showing results for 
Search instead for 
Did you mean: 

Third party system (JCO) ---RFC---> PI ---RFC---> ECC

Former Member
0 Kudos

Hello all,

We are trying to implement the following scenario:

Third party system (JCO) -RFC-> PI -RFC-> SAP ECC

The third party system connect to PI via Java Connector API with a know user id in PI. After that third party system tries to obtain the RFC that is already implemented and remote enabled in SAP ECC environment. But at this step there is something wrong in third party system software because we are not able to obtain the RFC interface and metadata from PI repository.

1. This step is working correctly. Connection is OK.

JCO.Client mConnectionPI = JCO.createClient("100", // SAP client

"user_id", // userid

"********", // password

"pt", // language

"10.x.x.x", // application server host name

"01"); // system number

mConnectionPI.connect();

2. This step is not working correctly:

JCO.Repository repository = new JCO.Repository("TestRep", mConnectionPI);

IFunctionTemplate ftemplate = repository.getFunctionTemplate("Z_RFC_XXX"); - not found exception

We would like to know if there is something missing in any environment that we have to configure or implement in order to fix this issue. Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Primini,

Try using [this document|http://wenku.baidu.com/view/e1e22122aaea998fcc220e3b.html] as a reference. You will find a step-by-step procedure of how to achieve what you require.

Hope this helps,

Grzegorz

Former Member
0 Kudos

Ok Grzegorz,

It is a good tutorial but it does not work for Java/JCO.

Tks, Primini

Former Member
0 Kudos

Hi Tiago, hi all,


> It is a good tutorial but it does not work for Java/JCO.

did you find out some more?


I just started looking into a legacy solution using JCo using RFM calls for BAPIs and RFCs.

(The software in question is a mapping framework XML<->BAPI/RFC structure/table hierarchies.)

Is a JCo connection via PI feasible? If so is it sensible?
If any one answer is "no", I assume we can still ignore PI on current SAP platforms and use JCo to connect to the SAP server behind?

Thx in advance

Stefan

Answers (9)

Answers (9)

Former Member
0 Kudos

Now we will try the solution creating FM in PI. We think it works.

Thks.

Edited by: Primini on Jan 10, 2012 5:54 PM

former_member184681
Active Contributor
0 Kudos

Hi,

Before copying your FM to PI (which in my opinion will not help) perform the following steps:

1. Import your BAPI to ESR for the JCo application's Business System.

2. Make sure you have a Sender Agreement for your sender system and sender interface.

2. Try connecting again and then find your Communication Channel in RWB and see if you can find any connection attempts from your JCo system. If so, then you should be able to find additional error details there. In my case the error was that Sender Agreement had not been found for a particular BAPI (which was true actually, because the only thing I prepared was the Sender RFC Communication Channel.

Hope this helps,

Grzegorz

Former Member
0 Kudos

1. OK

2. OK

3. JCO/Java program cannot achieve sender communication channel, so there is nothing about that in monitoring process.

Thks.

Edited by: Primini on Jan 10, 2012 5:16 PM

Former Member
0 Kudos

Will be necessary to implement the following steps?

1. Create RFC function in PI, exactly it was created in ECC. So now we will have the function in PI ESR.

2. Create a RFC destination pointing to PI.

3. The new RFC created on PI must execute this RFC destination in order to achieve RFC sender communication channel.

4. In RFC Sender Communication Channel: Parameter gwhost must be filled with PI address, parameter gwserv must be anything but the value must be the same in JCO/Java program, and Program id the created RFC destination in PI.

I think it can be a solution but if it works it cannot be recommended. Opinions?

henrique_pinto
Active Contributor
0 Kudos

Hi Primini,

couple of stupid-but-necessary questions:

1) have you imported the RFC model in PI Repository?

You don't need to have the RFC metadata in PI ABAP stack (there is no point in doing that), but rather in the PI Repository/ESR, within the SWCV you've created.

Check the "Activities" session of this link for more details:

http://help.sap.com/saphelp_nw70ehp2/helpdata/en/2b/a48f3c685bc358e10000000a11405a/frameset.htm

2) if you have done 1), have you configured the RFC Sender scenario properly?

I mean, have you ran the configuration wizard to create the agreements & determinations, setting the RFC interface as both the sender and the receiver interface? Of course, the systems would be different: as the sender system, you'll have a Business Service representing the legacy/JCo system; as the receiver, you'll have the ERP Business System.

This should make your scenario work.

If it doesn't, try one more thing: in the JCo code, just for the metadata repository connection, use a connection to the ERP system. But for the actual call, use the PI system.

Let us know the results.

Best regards,

Henrique.

Former Member
0 Kudos

1. Yes

2. Yes. It works in RWB tests.

3. This is not an elegant solution.

henrique_pinto
Active Contributor
0 Kudos

It's not about elegance, but rather the fact that you CAN read metadata from one system and execute the call in other.

It's the same principle behind the RFC Receiver Adapter itself - if you check it, you can logon to a system and read metadata from another one.

But it seems to me the connection is failing in general - your jco code just can't access the PI server.

BR,

Henrique.

Former Member
0 Kudos

Hi Henrique,

JCO code can connect in both environments, PI and ECC. Connection is OK.

I told that it is not an elegant solution because you can have a scenario where the client do not have access to ECC.

BR, Primini

Former Member
0 Kudos

Hi,

Did you tried providing the ECC server details for importing the metadata of RFC...instead from PI Server ...

You need to mention these details in the SAP GW Host and server name ....addition to the SAP Logon data...

As the metadata for the RFC is not available in PI server ..needs to be imported from ECC..for the RFC...

HTH

Rajesh

former_member184681
Active Contributor
0 Kudos

I don't think you have to create the BAPI in PI in addition to having it in ECC. Actually, that is why you provide the RFC Metadata Repository Parameter details - to avoid that redundancy.

Have you tried downloading any standard BAPI from JCo through PI? This might be useful to make sure that the configuration between PI and ECC is correct. Additionally, make sure that the Unicode indicator is set (or not) properly in your Communication Channel, depending on the encoding of your Java/JCo system encoding.

Regards,

Grzegorz

former_member184681
Active Contributor
0 Kudos

The only idea I have then is to check if your connection data for the ECC system is correct. You can also try downloading the metadata for any standard BAPI to see if the problem concerns your FM or the connection itself.

Former Member
0 Kudos

We think we have to achieve the configured sender communiction channel in some way, but at this point we are not achieving it, this can be the reason that JCO/Java program cannot retrieve function interface and metadata from repository.

Connection to ECC is ok because we have imported all Z_RFCs that we have to use in the scenarios, also we have another scenario where ECC sends data to the same JCO/Java program but from PI to Java we are using SOAP protocol.

Anybody knows about Java connector API? If there is some way to fix that?

Former Member
0 Kudos

There is something that we are missing but we are not shure if it is correct:

The function that will be called in SAP ECC environment must be exist in PI ABAP and must be RFC enable type, even without any code, but with its complete signature. This makes sense?

In order to check it can we call a standard function, for example, STFC_CONNECTION, that exists in PI and ECC in order to check this situation?

Former Member
0 Kudos

During the download of metadata instead of giving the PI host name try giving the ECC gateway name and server and check..

I presume as the metadata is not available in PI, it has to imported from ECC...

HTH

Rajesh

Former Member
0 Kudos

Sorry about the basic question, but when you say "download metadata" what do you mean?

Is there a process/action/operation to download the metadata from ECC to PI?

former_member184681
Active Contributor
0 Kudos

Primini,

Actually it looks like there is a way you can achieve what you require. Create a Communication Channel with the following settings:

Adapter type: RFC

Direction: Sender

Transport protocol: RFC

Message protocol: RFC (RFC XML)

Adapter Engine: Central Adapter Engine

Application Server (Gateway): IP address/domain name of your PI server

Application Server Service (Gateway): "sapgwXX", where XX is your PI's System number (for instance, 22)

Program ID: any program ID you will also use in the Java/JCo side

Moreover, you need to fill the RFC Metadata Repository Parameter section with:

Application Server, System Number, Logon User, Logon Password, Logon Language and Logon Client - use data for your ECC system, with Authentication Mode: Use Logon Data for SAP System

Hope this helps,

Grzegorz

Former Member
0 Kudos

We have our sender communication channel configured as you mentioned.

1. The third party JCO system connect to PI using parameters you said and the program id configured in sender communicaton channel is passed in parameter tpname. At this part, we cannot obtain function metadata from PI repository. JCO give us funcition not found exception.

2. We connect to ECC via JCO and at this step we can obtain function interface and metadata from ECC repository, but we could not execute this function using a pre stablished connection to PI.

Primini

Former Member
0 Kudos

Hi Grzegorz / Rajesh,

The use of another communication channel is a possibility that we are thinking about but third party system developer is not so much propitius to change his code part.

It must be a way in order to configure this scenario, it cannot be impossible, we hope.

Until now nobody tried to implement this situation? Anybody get success?

Primini

Former Member
0 Kudos

Hi,

How the third party system is trying to send the data to PI...

it should be using either FTP/HTTP/SOAP ...

so you need to configure one of the above adapter in PI for receiving the data and the RFC as receiver adapter for passing the request to ECC...

Also ensure that in ECC functional module is activated before use...

HTH

Rajesh

former_member184681
Active Contributor
0 Kudos

Hi,

I think I know the reason for your problem. As far as I understand, you have created the remote-enabled function module in the ECC system, but in the Java/JCo code mentioned you are trying to connect to that FM in PI. This can not succeed. Instead, try accessing PI from your Java code in other way (for instance, HTTP connection should be easier to implement in Java). Then you can use the possibilities of PI for further data processing (mapping and so on) do deliver the data to your ECC system.

Hope this helps,

Grzegorz