cancel
Showing results for 
Search instead for 
Did you mean: 

Split Mapping an Excel File output with Dynamic Filename

joel_langoyan
Participant
0 Kudos

Hi Experts,

I have scenario that requires output of plain text file or an Excel file based on user selection from S4/HANA (Proxy to File). In proxy structure I added FILENAME (for dynamic filenaming) and OUTPUT_TYPE (to check the output file selected). The text file not much of issue but the excel file is where the difficulty is.

The excel file be derived via XSLT mapping as with code below. Initially I had issue getting the file output so I applied note 2520361 because of runtime error encountered related to being a split mapping.

My issue now is that the dynamic Filename is not working at the same time the <ns1:THIS_IS_DT_NAME xmlns:ns1="urn:multimap-java-xslt"> must be removed on the adapter to leave <Workbook> as root to derive and Excel file.

Any ideas?

<?xml version="1.0"?>

<?mso-application progid="Excel.Sheet"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:map="java:java.util.Map" xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration" xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey" xmlns:html="http://www.w3.org/TR/REC-html40"><xsl:param name="inputparam" />

<xsl:output indent="no" />

<xsl:template match="/">

<!-- begin v1.03 applying note 2520361--> <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"> <ns0:Message1> <ns1:THIS_IS_DT_NAME xmlns:ns1="urn:multimap-java-xslt"> <!-- end v1.03 -->

<xsl:variable name="fname" select="//FILENAME" />

<xsl:variable name="dynamic-conf" select="map:get($inputparam,'DynamicConfiguration')" />

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

<xsl:variable name="dynamic-value" select="dyn:get($dynamic-conf,$dynamic-key)" />

<xsl:variable name="new-value" select="concat($dynamic-value,$fname)" />

<xsl:variable name="filename" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />

<Workbook><Worksheet><Table><Column></Column><Row><Cell><Data></Data></Cell></Row><Table></Worksheet></Workbook>

Accepted Solutions (1)

Accepted Solutions (1)

joel_langoyan
Participant
0 Kudos

this issue is now resolved. in operation mapping added a first message mapping with direct pass applying DynamicConfiguration UDF. second mapping in the XSL in the OM.

Removed in the XSL the lines added related to note 2520361.

Answers (0)