cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.1 Access to Dynamic Configuration through Java Class

Former Member
0 Kudos

My Current scenario involves IDCO -> FILE communications in PI 7.1 using XSL where the file name is dynamic.

I have attempted calling a Java Class from XSL with the use SAPXMLTOOL kit option set in the adaptor and it works but I need to be able to call the transform method

 public void transform(TransformationInput arg0, TransformationOutput arg1) 

from XSL so I can access the message and update the File Name via Dynamic Configuration.

Whilst I can call a static class with in the object I can not call transform with the correct arguments (arg0, arg1). I need access to arg0 (payload) to set/figure out the filename. I can calculate the filename in XSL and pass it to the Java but in a static method it is useless as it need to access the arg0 which is a object and obviously non-static context.

Is this possible ? How do I get access to Dynamic Configuration from XSL through Java in 7.1 ?

I have successfully called a static method but that is no help.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

yes,dynamic file name generation using the XSLT mapping with Java enhancement is possible.

Please refer below links for details,

http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm

Regards,

Swetha.

Former Member
0 Kudos

I may be incorrect, but PI 7.1 seems to be a little different to 2004s (7.0), any reference to StreamTransformationConstants in the code will not work is my understanding as that lib is no longer available on a 7.1 system. and has been changed to an extention of AbstractTransformation. Implementing the tranform method.

former_member204873
Contributor
0 Kudos

hi,

Java Mapping API's for PI 7.0 can still be used in PI 7.1. Give it a try.

U may also check:

http://help.sap.com/javadocs/pi/SP3/xpi/index.html

http://help.sap.com/saphelp_nwpi71/helpdata/EN/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

Thanks!!

former_member187339
Active Contributor
0 Kudos

Hi Richard,

Check the comment section in this blog /people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom, you can use the java logic to tweak your code

Regards

Suraj

Former Member
0 Kudos

Suraj,

Unfortunately you link isnt operational but thankyou anyway, I have managed to call as Java class as per my original post, but a static method does not allow me to get a handle to the Dynamic Configuration Variables in the message.

It seems importing the 7.0 LIBS may be an option and Im not entirely sure I have that option.

It certainly isnt possible to use the JDK5 XML implementation to even call a static method on an Java OBJ from XSL (obviously the USE SAPXMLTOOLKIT option is there for a reason).

I think and again I could be wrong but direct access via XSLT..

LINK:http://help.sap.com/saphelp_nwpi71/helpdata/EN/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

Is what Im looking for, I shall report back success or failure but the doco seems to fit the bill. Im not sure why I wanted to instatiate a sperate Java class when it can all exist in the XSLT.

former_member187339
Active Contributor
0 Kudos

Hi Richard,

May be i am not able to understand you completely.. But again revisiting your problem can you try something like this:

1. In the current operation mapping you are calling a XSL mapping.

2. Now call one more graphical mapping (after the above XSL mapping), which has input and output structure as the output strucutre from XSL mapping. Do a one to one mapping

3. In the graphical mapping, use an udf and set the necessary Filename through DynamicConfiguration. You can use this with the root node of the target .

PS: The earlier blog url was having a comma at the end remove that and you can see the blog.

Regards

Suraj