cancel
Showing results for 
Search instead for 
Did you mean: 

** How to get Source File Name thru XSLT Mapping

jegathees_waran
Active Participant
0 Kudos

Hi friends,

We require source file name after message processing (SXMB_MONI) in the output structure. We understad from Forums and blog 2664, this is possible thru UDF - DynamicConfiguration class. This UDF will work if we use message mapping. But, in our case we are using XSLT mapping. So, how do we call the same from Java Pacakage ? (Imported Archives). For writing java class separately, what are the changes to be made in the program?

-


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

-


Kindly reply, friends.

Kind Regards,

Jeg P.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi !

Check this out:

/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

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

Regards,

Matias.

Answers (2)

Answers (2)

jegathees_waran
Active Participant
0 Kudos

Hi friends,

You have given How to call Java packaga inside XSLT and Runtime constants. There is no runtime constant to take the source file name. So, we handled this thru module level and solved the problem. In UDF, it is possible to take the file name thru 'DynamicConfigurationKey' class. But, if we use XSLT mapping, this is not possible. So, we handled this thru Module. (By referring the Note : 819761_Accessing Source Path from Module)

Thanks friends.

Former Member
0 Kudos

Hi,

I think a simpler way to do this would be to have two mappings called, instead of developing adapter module.

In the first mapping you can extract the file name using UDF and map all the other fields directly (one-to-one).

Then in the second mapping use XSLT where you can now access the file name populated earlier.

Regards,

Yaghya

Former Member
0 Kudos

Hi,

This is the example in this similar manner u have to call the method in which u have to write the code for picking the source file name.

<name>

<xsl:if test="function-available('javamap:concat')">

<xsl:value-of select="javamap:concat($first, $last, $inputparam)"/>

</xsl:if>

</name>

for reference check the Link,

http://help.sap.com/saphelp_nw04s/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm

Regards,

Phani