cancel
Showing results for 
Search instead for 
Did you mean: 

Functions

Former Member
0 Kudos

sdners

like in object oriented technologies ,we call functions through object ,can we call a function in xi using objects?

i was told that we can write functions in xi like i write in java and achieve cumbersome mapping using it ,can somebody tell how we do in xi?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

We can write mapping programs in java, XSLT and ABAP.

These mappings are only used when we have to map the complex XML data.

Other than this we can write java beans which can be attached to the adapters for modification of the xml data.

Java Mapping in XI

https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+mapping&adv=false&sortby=cm_rn...

SAP Network Blog: Implementing a Java Mapping in SAP PI

/people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi

Java Mapping (SAP Library - Partner Connectivity Kit)

http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

SAP Network Blog: XI Java Mapping Helper (DOM)

/people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom

SAP Network Blog: Testing and Debugging Java Mapping

/people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio

Binary Conversion in XI - Java Mapping - Code Gallery - Wiki

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/binary%2bconversion%2bin%2bxi%2b-%2bjava...

SAP Network Blog: "JAVA MAPPING", an alternate way of reading a CSV file

/people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file

Regards

Ramesh P

Former Member
0 Kudos

I will try to do graphical mapping first and use java function in it.

Former Member
0 Kudos

hi,

You are right, first try our some graphical mapping which itself internally constructs the java programs.

And you can then try for some sample UDFs

REgards

Ramesh p

Former Member
0 Kudos

sdners

i tried a simple mapping of udf in which i will take an array of input values and put an if then clause and map all these values to target,but the test mapping tool gives an error ,i guess udf is not getting all the input values ,it is only getting the first value. in java editor it is running fine.. any idea

Former Member
0 Kudos

Check the queues ,right click on all the boxes involved in your mapping: there is an option of checking the queues , if the udf box queue is not getting your list of values ,then you need to raise input context by right clicking and raising to one higher parent node. This is called context change which is very important when you are doing java udfs.

Thanks

Kunal

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In XI, you could consider the function concept from 3 main points of view :

- in a graphical mapping : usually called UDF (user defined function), this could be compared to static method that can have input param from node values, but there is no real object involved (input can be string for instance)

- in a "pure" java mapping (compiled in a class file), then you could implement object oriented methods (what you call functions) as allowed in JAVA (but in a XI context, we'll have to follow some rules)

- in XSLT, function are usually found in <template> sections

Hope this helps

Chris

Edited by: Christophe PFERTZEL on May 3, 2008 10:01 PM