on 06-04-2009 8:45 AM
Hello,
is it possible to create new specific Java classes and objects within UDFs in a mapping?
I often have to do mappings from IDoc (e.g. ORDERS) to some totally different Inhouse structures. I have to work a lot with java in order to map the source structure to the target structure.
It would be easyier if I could define classes like "CAR" and create objects like "myCar1", store them in the globalContainer and read these objects at another position of the target structure.
Is something like that possible?
Thanks,
Christoph
Hello,
thanks for the feedback.
@Shabarish: That means I create a java class e.g. "CAR" and import it as a java class / package? I would prefer do define the class just within the mapping in a UDF which is executed at the first element of the target structure. I am wondering if the class is then known / can be accessed from within the whole mapping?
@ Gourav Khare: Which feature do you mean?
Thanks,
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I still need help as I am not an Java expert
I generated a class "Car" in a package MappingObjects with eclipse. I generated a JAR file and imported it in PI. In my mapping, i added the Archive used and imported MappingObjects.*.
In a UDF i try to generate a Car object with "Car testCar = new Car();"
While compiling I get the error message:
cannot access MappingObjects.Car bad class file: /usr/sap/PIE/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5e168b30528411deab780050568f4fb3/classpath/MappingObjects_6.jar(MappingObjects/Car.class) class file has wrong version 50.0, should be 49.0
My class:
______________
package MappingObjects;
public class Car {
int price;
String name;
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Thanks,
Christoph
This feature is available in PI7.1.
Regards,
Gourav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can always write a class / package, compile and save it under the imported archives.
the package can then be then referenced in your UDF .
an example /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners - here you will find a XSLT mapping referring a java class
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.