Skip to Content

XSLT excel

Hi,

I'm using XSLT_TOOL to generate an excel file.
In this XSLT in make a loop an internal table. Depending on severals conditions I would like create a row with data.

It is possible to pass the index number of the row as variable.

instead of
<Row ss:Index="2"

I would like

<Row ss:Index=VARIABLE

Thanks in advance,

Joseph

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 13, 2017 at 09:23 PM

    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).

    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.

      <Row>
        <xsl:attribute name="ss:Index"><xsl:value-of select="xpath expression to your variable in ASXML format"/>
        ...
      </Row>
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 13, 2017 at 01:04 PM

    Hey,

    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 <Row ss:Index=VARIABLE. If this is the question then the answer is yes.

    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 subject. In addition, check out all the DEMO programs that are offered by SAP in the documentation under Executable Examples (in the link I provided).

    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).

    Add comment
    10|10000 characters needed characters exceeded