cancel
Showing results for 
Search instead for 
Did you mean: 

FileName in ABAP XSLT Mapping

Former Member
0 Kudos

Dear SDN,

In an integration scenario we are using sender File Adapter and a ABAP XSLT Mapping.

Is there any way to get the source FileName from such mapping. Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.

regards,

GP

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi GP -

Personally haven't tried accessing ASMA from ABAP mapping, but apparantly there is an ABAP interface for it as mentioned in the following help link: http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm

The interface <i>IF_MAPPING_DYNAMIC_CONF</i> is mentioned there. If you go to txn SE24 and put in IF_MAPPING_DYNAMIC_CONF and access the Interface documentation (button), there are more details there.

Regards,

Jin

Former Member
0 Kudos

Realized my previous post is probably irrelevant for your case. The only thing that comes close is probably here: http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm

The ASMA will definitely be in the message header (when configured in the sender adapter), but given that a ABAP XSLT runs on its own ABAP engine, its unclear whether the ASMA is accessible from it.

Regards,

Jin

Former Member
0 Kudos

Thank you for your help,

I just try to access the adapter-specific attibutes using:

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">

<xsl:variable name="filename" select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />

.....

</xsl:stylesheet>

but the following error raised:

<SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>

have you had this situation?

Former Member
0 Kudos

From what I can tell, since the ABAP XSLT runs on the ABAP engine, you won't be able to access the <i>com.sap.aii.mapping.api</i> related java classes which run on the Java engine. So the Java enhancement functions won't work for ABAP XSLT.

If using XSLT, why not use it the usual way (as an imported archive in IR)? Then you can use Java enhancements and ASMA.

Regards,

Jin

Former Member
0 Kudos

I didn't read what you said about ASMA, yes that is the problema i think, May be adding one more mapping step previous to the XSLT ABAP one where I can send to ABAP the filename.

Former Member
0 Kudos

I am using abap extensions, so I'd have to do many modifications to the current mapping

Former Member
0 Kudos

<i>>>>May be adding one more mapping step previous to the XSLT</i>

Yes, that would work...

Former Member
0 Kudos

Yes, it does work now

Answers (1)

Answers (1)

moorthy
Active Contributor
0 Kudos

Hi,

for Adapter Specific Attributes refer this-

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Rgds,

Moorthy

Former Member
0 Kudos

Hi ,

U can use user defined Function to get the file name and call this function in mapping. here is an example:

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

Regards

Vijaya