cancel
Showing results for 
Search instead for 
Did you mean: 

Webpage(XML File) to RFC Scenario possible?

Former Member
0 Kudos

Hi ,

I have a requirement where I need to load exchange rates file (xml file) into SAP ECC (BAPI_EXCHRATE_CREATEMULTIPLE). I have configured File to RFC scenario. Now file is manually copied from the below given link and processed using File Adapter.

Is there any way where I can eliminate the manual intervention and automate this process. I mean is there any adapter available in PI which can go to the below link and fetch the data from the XML file and load it into ECC? Can SOAP Adapter do this?

http://www.westpac.co.nz/olcontent/olcontent.nsf/fx.xml

Thanks in Advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

You can try with Java Proxy or HTTP or SOAP.

below code enough to read data from web site, i think you can convert the same to JAVA Proxy and try it or you can speak with web site people to send data in the form or web service request, so you can easily use SOAP adapter direclty, this is bect way to achive your req.

AbstractTrace trace = container.getTrace();
String var1 = null;
try{  
  
	URL url = new URL("http://www.westpac.co.nz/olcontent/olcontent.nsf/fx.xml");
	URLConnection uc = url.openConnection();
                     BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
                     String inputLine;
	while ((inputLine = in.readLine()) != null) {
    	   if (inputLine.indexOf("	<cb:value") != -1) {
    	       var1= (inputLine.substring(inputLine.indexOf('>')+1,inputLine.indexOf('<',2)));
           }
       	}
      	 in.close(); 
 }
catch(Exception e) {
trace.addInfo(e.getMessage());
}
result.addValue(var1);

Regards,

Raj

Former Member
0 Kudos

Hi Raj,

Thanks for your reply. I would like to do this using Java Proxy. I am new to this. Can you please paste me some supporting links? Thank you.