cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping Program no NWDS

Former Member
0 Kudos

Hi All ,

Earlier I had posted a question asking if there was no NWDS installed How would I debug or make changes to a JAVA mapping program that already exists in PI.

Some replied that JAVA developers could use the eclipse tool to make changes , test and debug. My JAVA Developer has the following question.

When the JAVA program is run where does the console output go ?

Thanks !

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>When the JAVA program is run where does the console output go ?

System.out

>>>>Earlier I had posted a question asking if there was no NWDS installed How would I debug or make changes to a JAVA mapping program that already exists in PI.

you don't need NWDS to change a java mapping - any java IDE will do

Regards,

Michal Krawczyk

Former Member
0 Kudos

Thanks Michal . Is there a file where the ouput goes to? Can the JAVA developer access this file ?

prateek
Active Contributor
0 Kudos

There is no file which gets generated. If you want to run it in some other tool than NWDS, you have to modify the code to print the output for you. If you use NWDS, you have option to debug it as well using remote debugging and then you can check output at each step (by setting breakpoint) in NWDS.

Regards,

Prateek Raj Srivastava

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>Is there a file where the ouput goes to? Can the JAVA developer access this file ?

add System.out to custom trace and the magic will appear

as per my blog:

Regards,

Michal Krawczyk

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Debugging can be done in various levels. If you use simple java program with main class, then you can use system.out.println statment to trace the information. This is very simple. You can run it in eclipse or any ide tool and display the result right away.

Example if you declare variable

String test ="500";
System.out.println("My result value is" + test);

anupam_ghosh2
Active Contributor
0 Kudos

Hi Teresa,

In case of java mapping programs you need an input XML and after mapping the program should generate the output XML. So when you test java mapping code in eclipse or NWDS you need an input file otherwise its difficult to type XML from console. I explained the steps of java mapping in PI 7.0 in this link, which also explains how to read an input XML and create an target XML after mapping.

http://wiki.sdn.sap.com/wiki/display/XI/BeginnersguidetoJavamappingusingDOMparserinSAPXI

You need to download java ,eclipse and collect jar files necessary for doing the mapping. There are changes in java mapping for PI7.1 and above versions. In case of java mapping for PI 7.1 and above you can also specify input and output xml file names check out my reply in this thread

?

In the links provided above, within the "main()" method of java program you need to specify the names of input and target output XML. When you upload or import the code into PI server you may delete the "main()" method since this method is not at all called by PI server (better if you upload the code as it is, helps in debugging later on). The PI server provides to the mapping code its own source XML and accepts output in target XML.

We use main in local system to test our mapping codes before deployment in PI server.

Hope this clarifies your doubts.

Regards

Anupam

Answers (0)