<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: XSLT excel in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501588#M17377</link>
    <description>&lt;P&gt;So, you want to generate an Excel file in XMLSS format (AKA XML2003 for Excel). This format has been superseded by XLSX. Are you sure you can't use XLSX? (cf abap2xlsx project). &lt;/P&gt;
  &lt;P&gt;Now back to your question, note that it's an XSLT question, not an ABAP one. You may find assistance at any XSLT place in the web. Note that the input XML document corresponds to your variable in format ASXML (documented in the ABAP documentation), passed via CALL TRANSFORMATION SOURCE root = variable (automatically converted to ASXML), and you access to it via xpath expressions.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;  &amp;lt;Row&amp;gt;
    &amp;lt;xsl:attribute name="ss:Index"&amp;gt;&amp;lt;xsl:value-of select="xpath expression to your variable in ASXML format"/&amp;gt;
    ...
  &amp;lt;/Row&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Dec 2017 21:23:18 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2017-12-13T21:23:18Z</dc:date>
    <item>
      <title>XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501586#M17375</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I'm using XSLT_TOOL to generate an excel file.&lt;BR /&gt;In this XSLT in make a loop an internal table. Depending on severals conditions I would like create a row with data.&lt;/P&gt;
  &lt;P&gt;It is possible to pass the index number of the row as variable.&lt;/P&gt;
  &lt;P&gt;instead of&lt;BR /&gt;&amp;lt;Row ss:Index="2"&lt;/P&gt;
  &lt;P&gt;I would like&lt;/P&gt;
  &lt;P&gt;&amp;lt;Row ss:Index=VARIABLE&lt;/P&gt;
  &lt;P&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt;Joseph&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:33:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501586#M17375</guid>
      <dc:creator>joseph_fryda2</dc:creator>
      <dc:date>2017-12-13T09:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501587#M17376</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
  &lt;P&gt;I'm not sure if I'm answering your question. What I understood you are asking is can you pass a variable to the transformation, in you case that variable would be used in &amp;lt;Row ss:Index=VARIABLE. If this is the question then the answer is yes.&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Because there are many ways of handling a transformation and I am unclear on the whole process/flow of your need, I can advise you to read the documentation on the &lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapcall_transformation.htm"&gt;subject&lt;/A&gt;. In addition, check out all the DEMO programs that are offered by SAP in the documentation under Executable Examples (in the link I provided).&lt;/P&gt;
  &lt;P&gt;Just to clarify how vast the options are I suggest you take a look at HR_EXCEL_SHEET transformation and also check out the "where-used" of it to get a handle on the API for passing parameters (in this case it using a structure named param and it is passed via SOURCE).&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 13:04:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501587#M17376</guid>
      <dc:creator>iftah_peretz</dc:creator>
      <dc:date>2017-12-13T13:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501588#M17377</link>
      <description>&lt;P&gt;So, you want to generate an Excel file in XMLSS format (AKA XML2003 for Excel). This format has been superseded by XLSX. Are you sure you can't use XLSX? (cf abap2xlsx project). &lt;/P&gt;
  &lt;P&gt;Now back to your question, note that it's an XSLT question, not an ABAP one. You may find assistance at any XSLT place in the web. Note that the input XML document corresponds to your variable in format ASXML (documented in the ABAP documentation), passed via CALL TRANSFORMATION SOURCE root = variable (automatically converted to ASXML), and you access to it via xpath expressions.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;  &amp;lt;Row&amp;gt;
    &amp;lt;xsl:attribute name="ss:Index"&amp;gt;&amp;lt;xsl:value-of select="xpath expression to your variable in ASXML format"/&amp;gt;
    ...
  &amp;lt;/Row&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2017 21:23:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501588#M17377</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-12-13T21:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501589#M17378</link>
      <description>&lt;P&gt;Sandra,&lt;/P&gt;
  &lt;P&gt;thank you for you answer.&lt;/P&gt;
  &lt;P&gt;I really new at XSLT.&lt;/P&gt;
  &lt;P&gt;I create a variable name "myindex". I passed the value 7.&lt;BR /&gt;I want to pass this value to the cell's index.&lt;/P&gt;
  &lt;P&gt;I have this piece of code:&lt;/P&gt;
  &lt;P&gt; &amp;lt;tt:root name="myindex"/&amp;gt;&lt;BR /&gt; &amp;lt;tt:template&amp;gt;&lt;BR /&gt; &amp;lt;Workbook 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:html=&lt;BR /&gt; "http://www.w3.org/TR/REC-html40"&amp;gt;&lt;/P&gt;
  &lt;P&gt;.....&lt;BR /&gt;&amp;lt;Row ss:AutoFitHeight="0" ss:Index="9"&amp;gt;&lt;BR /&gt;&amp;lt;Cell ss:Index=&lt;STRONG&gt;&lt;U&gt;"$.myindex"&lt;/U&gt;&lt;/STRONG&gt;&amp;gt;&lt;BR /&gt;&amp;lt;Data ss:Type="String"&amp;gt;&amp;lt;tt:copy ref="myindex"/&amp;gt;&amp;lt;/Data&amp;gt;&lt;BR /&gt;&amp;lt;NamedCell ss:Name="_FilterDatabase"/&amp;gt;&lt;BR /&gt;&amp;lt;/Cell&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;/Row&amp;gt;&lt;/P&gt;
  &lt;P&gt;....&lt;/P&gt;
  &lt;P&gt;My XML looks like this:&lt;BR /&gt;....&lt;/P&gt;
  &lt;P&gt;&amp;lt;Cell ss:Index="&lt;STRONG&gt;&lt;U&gt;$.myvar"&lt;/U&gt;&lt;/STRONG&gt;&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Data ss:Type="String"&amp;gt;7&amp;lt;/Data&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;NamedCell ss:Name="_FilterDatabase"/&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;/Cell&amp;gt;&lt;/P&gt;
  &lt;P&gt;.....&lt;BR /&gt;Why the cell's index has value &lt;U&gt;$.myvar"&lt;/U&gt; and not "7" ?&lt;BR /&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt;Joseph&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:42:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501589#M17378</guid>
      <dc:creator>joseph_fryda2</dc:creator>
      <dc:date>2017-12-14T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501590#M17379</link>
      <description>&lt;P&gt;Sorry instead of "&lt;U&gt;$.myvar"&lt;/U&gt; i should be "&lt;STRONG&gt;&lt;U&gt;$.myindex"&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 17:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501590#M17379</guid>
      <dc:creator>joseph_fryda2</dc:creator>
      <dc:date>2017-12-14T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501591#M17380</link>
      <description>&lt;P&gt;Oh, you made a big confusion &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; you are using Simple Transformation (ST), not XSLT. XSLT_TOOL is misleading, because you have the choice between ST and XSLT. I prefer using the transaction STRANS (an alias of XSLT_TOOL). I consider the "name" XSLT_TOOL deprecated because of the confusion. So, no XPATH anymore.&lt;/P&gt;
  &lt;P&gt;Second confusion : we are dealing with a &lt;STRONG&gt;variable in ABAP&lt;/STRONG&gt;, it's converted into XML source when CALL TRANSFORMATION ... SOURCE myindex = variable_myindex is invoked (converted into ASXML format), but &lt;STRONG&gt;it's no more a variable in the XSLT&lt;/STRONG&gt;, it's just the XML source. So you must not use the prefix $ which is reserved to XSLT variables only.&lt;/P&gt;
  &lt;P&gt;In ST, enter the attribute as follows (close to XSLT), and see how the &lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/e6/011540bf1af72ee10000000a1550b0/frameset.htm"&gt;"data node address"&lt;/A&gt; is to be entered instead of using XPATH (.MYINDEX, case insensitive):&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;Cell&amp;gt;
  &amp;lt;tt:attribute name="ss:Index" value-ref=".MYINDEX"/&amp;gt; 
&amp;lt;/Cell&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Dec 2017 18:10:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501591#M17380</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-12-14T18:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501592#M17381</link>
      <description>&lt;P&gt;Sandra,&lt;/P&gt;
  &lt;P&gt;Thank you for your clarification about my misunderstanding of XSLT and ST.&lt;/P&gt;
  &lt;P&gt;It works fine! :)))&lt;/P&gt;
  &lt;P&gt;Joseph&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 18:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501592#M17381</guid>
      <dc:creator>joseph_fryda2</dc:creator>
      <dc:date>2017-12-14T18:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: XSLT excel</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501593#M17382</link>
      <description>&lt;P&gt;By the way, ST is a SAP proprietary language (not XSLT), meaning that you can't get help about ST outside SAP, and "ABAP development" is the right place to post.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 19:42:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xslt-excel/m-p/501593#M17382</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-12-14T19:42:52Z</dc:date>
    </item>
  </channel>
</rss>

