cancel
Showing results for 
Search instead for 
Did you mean: 

Deprecated API and RFC connection issues in PI 7.1

Former Member
0 Kudos

Hi all,

I am new to this Forum..

I am working in File to Proxy scenario where i am using UDF to implemnt few functions.

But i am getting the following Error :

Source text of object Message Mapping: MM_FILE_10_943 | urn://fiat.com/mm/if_10_943 has syntax errors:

Function sendMonitor, Line 14:

cannot find symbol symbol : class CallRFCManager location: class com.sap.xi.tf._MM_FILE_10_943_ CallRFCManager rfc=new CallRFCManager(); ^

Function sendMonitor, Line 14:

cannot find symbol symbol : class CallRFCManager location: class com.sap.xi.tf._MM_FILE_10_943_ CallRFCManager rfc=new CallRFCManager(); ^

Function sendMonitor, Line 17:

cannot find symbol symbol : variable Constants location: class com.sap.xi.tf._MM_FILE_10_943_ if(rfc.connect(Constants.XISYSTEM)){ ^ Note: /disk2/sap/TX0/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map9c6141de40a611e0ad290000003d38da/source/com/sap/xi/tf/_MM_FILE_10_943_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /disk2/sap/TX0/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map9c6141de40a611e0ad290000003d38da/source/com/sap/xi/tf/_MM_FILE_10_943_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors

The code i am using is:

//write your code here

// INPUT: activate ; id; descrizione

AbstractTrace trace;

String messID;

java.util.Map map;

trace = container.getTrace();

map = container.getTransformationParameters();

messID = (String) map.get(StreamTransformationConstants.MESSAGE_ID);

CallRFCManager rfc=new CallRFCManager();

if (a.equals("true")){

if(rfc.connect(Constants.XISYSTEM)){

try{

rfc.traceMonitor(messID,b,c);

trace.addInfo("Ok trace monitor");

rfc.disconnect();

} catch (Exception ex) {

trace.addInfo("Errore in sendMonitor CAUSA:" + ex.getMessage());

rfc.disconnect();

}

}else{

trace.addInfo("Errore in sendMonitor CAUSA: errore sulla connessione ad XI");

}

}

return a;

Pleasae help me ....what is the reason for this ???

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Steps to call an external Java Program into SAP PI message mapping.

if we have a requirement, where we want to use external created Java code into Sap PI (Message Mapping) to full fill some requirement in message mapping.

Steps:

1. Save .java and .class file into folder according to package name assigned in JAVA Program.

2. Covert it into compressed zipped folder.

3. Create imported archives Object in SAP Pi.

4. Import zip file with import archive option.

5. Now go to message mapping, open Functions tab.

6. Now on down left hand side, you will find archives Used, open this tab.

7. Add the above created imported archive into this.

8. And in import instructions add the package name, you have given in above used JAVA program.

9. Now enjoy using the classes and method of Java Program in your scenario (Message Mapping).

Regards

prabhat Sharma.

Former Member
0 Kudos

Thanks a lot prabhat tht was really help ful..

now that error is gone :)...

Now i will test the funcationality....

This site is really helpful...

my frst time i posted any query and the response was great :):)

thankyou to allllll....

:):)

stefan_grube
Active Contributor
0 Kudos

> CallRFCManager rfc=new CallRFCManager();

> if(rfc.connect(Constants.XISYSTEM)){

It seems there is an import missing for the classes CallRFCManager and Constants

In PI 7.1 you assign your Java libraries under tab "function" here you add import statements and archives.

Former Member
0 Kudos

Hi Stefan,

U r right ...now in the import i added the package com.fiat.sapiens.xi.udf.*

and com.fiat.sapiens.xi.core

That error is gone .

But now when i am executing the mapping i am getting the Error :

ava Area import, Line 7:

package com.fiat.sapiens.xi.udf does not exist import com.fiat.sapiens.xi.udf.*; ^

Java Area import, Line 8:

package com.fiat.sapiens.xi.core does not exist import com.fiat.sapiens.xi.core.*;

Note: /disk2/sap/TX0/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map46543bd940c011e085660000003d38da/source/com/sap/xi/tf/_MM_FILE_10_943_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /disk2/sap/TX0/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map46543bd940c011e085660000003d38da/source/com/sap/xi/tf/_MM_FILE_10_943_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors

If these jar files are not present than how are these error which i was getting before gone.???

i am all confused now

where shuld these jar files be present .

stefan_grube
Active Contributor
0 Kudos

> If these jar files are not present than how are these error which i was getting before gone.???

I suppose complier stops when jar files are not present, so following errors are not mentioned.

> where shuld these jar files be present .

Create an object type "Imported Archive" in same SWVC and add your jar files here.

Former Member
0 Kudos

Hi ,

the package com.fiat.sapiens.udf.* is saved in the IA_JAVA.zip file.

I imported it in the imported archive and added this jar in the import tab of function library

i also added ti in the archive used tab in function.

But still it is showing this Error.

under IA_JAVA.zip i have testJCO.java which has the folowing code:

package com.fiat.sapiens.xi.udf;

// Referenced classes of package com.fiat.sapiens.xi.udf:

// CallRFCManager

public class TestJCO

{

public TestJCO()

{

}

public static void main(String args[])

{

System.setProperty("SAPSYSTEMNAME", "DX0");

CallRFCManager rfc = new CallRFCManager();

rfc.connect("XI");

try

{

rfc.schedNR("10", "20", "30", "40", "50", "60");

}

catch(Exception e1)

{

e1.printStackTrace();

}

if(rfc.connect())

{

rfc.connect();

try

{

String a = rfc.checkRARCRE("ZZ");

System.out.println(a);

}

catch(Exception e)

{

e.printStackTrace();

}

}

System.out.println("");

}

}

stefan_grube
Active Contributor
0 Kudos

> the package com.fiat.sapiens.udf.* is saved in the IA_JAVA.zip file.

> I imported it in the imported archive and added this jar in the import tab of function library

jar files must be named .jar, not .zip. The content of the jar files should be .class files.

Former Member
0 Kudos

Hi,

There is an issue with the Java code that you are using in the mapping. To confirm, disable the field for which you have used this java code and run the scenario. Then it should definately work.

Please check your Java code.

Thanks,

Former Member
0 Kudos

Hi,

yes its working fine without the code....

But can you please tell me what is the problem....in this code.

I have made other UDF where i am not using any RFC connection ,but tht is working fine..

I need help in this UDF can u please helpp.

Former Member
0 Kudos

What exactly you are trying with this code. What I undestand is, if the first input value is true then RFC should be connected and if not then disconnect and also added trace to it.

I recon you trying to get the message ID? Also can you explain the complete scenario what you are trying to develop?

Thanks,

Former Member
0 Kudos

Yes in this function we are inputtin three vaues say a,b,c.

if the value of a is false, then it will go to else and print that message in trace.

if its true than it will connect to RFC and print the MSgID and b,c .

Former Member
0 Kudos

Instead of getting the trace by writing the code, it would be better to increase the trace level in SXMB_MONI.

Thanks,