cancel
Showing results for 
Search instead for 
Did you mean: 

implementing java mapping using SAX or DOM parser

Former Member
0 Kudos

Hi,

what are the packages that need to be downloaded from SAP for creating java mappings in XI. any blog where let us say i have source XML on my desktop and i have mapping java program in a text file. how do i execute this java file and produce the target xml file.

thanks

sankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Find this link

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6153

Download

aii_map_api.jar (For Java Mapping)

In XI Server : \usr\sap\<SID>\DVEBMGS00\j2ee\cluster\server0\apps\sap.com\com.sap.xi.services

and get aii_map_api.jar

You can test u r java mapping from u r desktop by providing the test file

see code as below:

public static void main(String[] args)
	{
		FileInputStream in = null;
		FileOutputStream out = null;
		ValidateSchema test = new ValidateSchema();
		try {
			*test.execute(in,out);*
		} catch (StreamTransformationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		try
		{
		 in = new FileInputStream ("*C:/Documents and Settings/9000031/Documents/SAP/workspace/ValidateXml.xml*");
		 out = new FileOutputStream ("*C:/Documents and Settings/9000031/Documents/SAP/workspace/ValidateOutput.xml*");
		}
		catch (IOException io)
		{
			io.printStackTrace();
		
		
	}
	}

reward point if useful

rgds

srini

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Sankara,

U can either export the file as a jar or as a zip file.

if u r using NWDS,click on the class select export -jar and save it on ur local folder.

In imported archive option in mapping objects,import the jar and use it in interface mapping.

But remember it is always better to use a main method in ur java program to test it in the editor it self as a standalone application, to avoid the reimporting it again and again.

public static void main(String[] args)

{

try {

InputStream in =new FileInputStream(new File("C:/ ur file path"));

OutputStream out =new FileOutputStream(new File("C:/ file path"));

mappingClass myMapping = new mappingClass();

myMapping.execute(in, out);

}

catch (Exception e)

{

System.out.println(e.toString());

}

}

Should help u out

Former Member
Former Member
0 Kudos

Hi,

Check this link

Former Member
0 Kudos
Former Member
0 Kudos

hi

download file "SAPXITOOL13P_3-20000274.zip" from the sap pages.

It contains several .sda files which contain all the java-packages (like "aii_map_api.jar") you need for XI-Java mapping.

check the below blog

Think objects when creating Java mappings

XI Java Mapping Helper (DOM)

reward points if helpfull

regards

kummari

Former Member
0 Kudos

Hi

can u provode me the exact link from where i can download also tell me where should i keep the zip folder, is it in the j2sdk folder or in c:->program files->java->jre folder. how do i execute the mapping program from the command prompt from my local pc.

thanks

sankar

Former Member
0 Kudos

Hi,

If u haver u r XI Server Access get into following path to get the jar file

\usr\sap\<SID>\DVEBMGS00\j2ee\cluster\server0\apps\sap.com\com.sap.xi.services

Hope u r using NWDS or Eclipse to write JAVA Coding.

So before coding add Jar file to the Java project which u have created.

hope this serves u carrying on with the rest

rwd pnts if useful

rgds

srini

Former Member
0 Kudos

hi

ok my next question is i have created source interface and target interface in XI and i have a .java file in local desktop which contains the java code for the mapping. Now tell me the steps what i need to follow inorder to implement the java mapping. lets assume that i have all the jar files setup in the XI server.

thanks

sankar

Former Member
0 Kudos

Hi,

Well once u have tested u r Java mapping,

just ZIP it.

Use in Interface Mapping "There u can select the type of Mapping u r gonna use"

Select from Drop down : JAVA : And use u r "Java.Zip" files.

Before doing so u have to import that zip File under "Imported Archive"

under that SWCV.

rwd pts if useful

rgds

srini

Former Member
0 Kudos

Hi venkat,

thanks for the reply.please tell me exactly what are the things i need t zip.

thanks

sankar

Former Member
0 Kudos

Hi

Just the JAVA file

For Example if u r using Eclipse

Click on the Java Program "Mapping.java" and from menu choose file--> Export --> Chhose "zip" and save it to local pc.

and import this to "import archive" and use as said above

rgds

srini

Former Member
0 Kudos

Hi,

I do not have Netweaver developer studio in my system. i want to test a java mapping. let us say I have a source XML file in my local PC. Now how do i write a java mapping program and generate a target XML in my local PC with the desired structure. Please give me a simple example if possible. what is eclipse and from where i can download this.

thanks

sankar