cancel
Showing results for 
Search instead for 
Did you mean: 

XML Tag Issue: Need extra Line with Xml RooTag

Former Member
0 Kudos

HI Experts,

I would like to know how to achieve this requirement in order to get the below xml format

<?xml version="1.0" encoding="ISO-8859-1"?>
*<?xml-stylesheet type='text/xsl' href='gateway_detail_status_display.xsl'?>*
<File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
        <File_Header>
		<File_Format_Version></File_Format_Version>

		<Selection_Info>
			<General_Info>
				<Plugin_ID></Plugin_ID>

				<Plugin_Name></Plugin_Name>

				<Plugin_Type></Plugin_Type>

				<Option_ID></Option_ID>

				<Operator_ID></Operator_ID>

				<Operator_Name></Operator_Name>

				<Filename></Filename>
			</General_Info>
		</Selection_Info>
	</File_Header>
  </File>

In order to get this root tag:

<?xml-stylesheet type='text/xsl' href='gateway_detail_status_display.xsl'?>

Below to <?xml version="1.0" encoding="ISO-8859-1"?>

Can anyone tell me what exactly needs to be done: I mean is not possible without going to JAVA mapping.

If that is the only case Keeping Java Mapping next to Graphical mapping in the operation mapping.

But I am not aware of Java mapping: If that is the case can anyone send me a java mapp code with

the above requirement and remaining Body structure remains as it is.

Regards:

Amar Srinivas Eli

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Thanks for all giving immediate responses and I finally used that code and placed in server and used in file adpater module parameters

Former Member
0 Kudos

Hi Amar

I am working in SAP XI...i just need a help from you... saw ur post in the forum where you wrote that you have successfully done the RFC lookup for the SOAP - XI - RFC - SOAP scenario.....could you please help me in this.....also i have to do this without BPM

Your help will be very much appreciated.

Thnks in advance !!

P.S. i have to do this RFC lookup using a java mapping program instead of message mapping.

Former Member
0 Kudos

Hi

Yes I did that SOAP - XI - SOAP in PI 7.1.

In PI 7.1 there is any option in the Graphical mapping -> Conversions-->>RFC Look Up so that you can use directly and very easily.

[;

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8661] [original link is broken] [original link is broken] [original link is broken];

a) First create RFC Communication Channel

b) Map input required Field from Sender file structure and mapp to RFC LOOK UP and double click on that and selct your Comm Channel there in that window and select your RFC from drop down list and select required input fields from RFC Req and Output look up fields from RFC Response structure.

YOu can view both RFC REQ and RESP structure in the same window.

Then mapp respective fields to output FileREceiver Structure

Regards:

Amar Srinivas Eli

Former Member
0 Kudos

Hi Amar

I am working in SAP XI...i just need a help from you... saw ur post in the forum where you wrote that you have successfully done the RFC lookup for the SOAP - XI - RFC - SOAP scenario.....could you please help me in this.....also i have to do this without BPM

Your help will be very much appreciated.

Thnks in advance !!

sunilchandra007
Active Contributor
0 Kudos

Hi Amar,

Try this code for java mapping.

import java.io.*;
import java.util.Map;
import com.sap.aii.mapping.api.*;

public class addStylesheet {
    public void setParameter(Map map) {   }
    public void execute(InputStream inStream, OutputStream outStream)   throws StreamTransformationException {
        try{

            BufferedReader in = new BufferedReader(new InputStreamReader(inStream));
            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
            
            String inputLine="";     out.write(in.readLine());
            out.write("<?xml-stylesheet type='text/xsl' href='gateway_detail_status_display.xsl'?>");
            while ((inputLine = in.readLine()) != null)  out.write(inputLine);
            in.close();  out.close();
            
        }catch(Exception e){
            e.printStackTrace();
        }
    }
 }

Regards,

Sunil Chandra

Former Member
0 Kudos

Hi Sunil ,

Thanks For your valid solution. But I have facing some other issue. I have developed

Your code and assigned at operation mapping level. In the receiver pay load I saw the Style sheet entry

("<?xml-stylesheet type='text/xsl' href='gateway_detail_status_display.xsl'?>"

But this style sheet tag doesnu2019t come in the receiver file location .Except this tag all data has successfully placed in correct FTP location.

Please suggest me to get this style sheet entry in the receiver FTP file.

Thanks & Regards,

Srikanth.