Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

create Excel file out of WebDynpro application

richard_pietsch
Active Contributor
0 Kudos
266

Hi experts,

I am trying to export a table I display in WebDynpro to an Excel file.

After reading lots of threads I am trying to do this via XML transformation.

Therefore I followed the guide from ABAP WebDynpro - Download Formatted Excel using XML | ABAP Help Blog

I created a transformation and put the xml code of my Excel template into it. The test is succesful - the template file is generated as expected.

In the next step I try to put the table data into the transformation - I need to add the rows under the header columns. So on ABAP side I fill an internal table itab which should be processed in the transformation.

In the transformation I added a loop to read this itab into rows:

      <tt:loop name="line" ref=".ROOT">
        <Row ss:AutoFitHeight="0" ss:Height="25.5">
          <Cell ss:Index="2" ss:StyleID="s69">
            <Data ss:Type="String">
              <tt:value ref="$line.zcustno"/>
            </Data>
          </Cell>
          <Cell ss:StyleID="s69">
            <Data ss:Type="String">
              <tt:value ref="$line.zname"/>
            </Data>
          </Cell>
        </Row>
      </tt:loop>

The xml file is generated without problems, during transformation rows according to the itab data are added. But when opening the file in Excel, I receive the message that the file is corrupt

Why is that?

Regards, Richard

1 ACCEPTED SOLUTION

richard_pietsch
Active Contributor
0 Kudos
74

I finally found the issue.. the number of columns defined in the table settings in STRANS did not match the filled data.. also the ss:Index was not correct..

1 REPLY 1

richard_pietsch
Active Contributor
0 Kudos
75

I finally found the issue.. the number of columns defined in the table settings in STRANS did not match the filled data.. also the ss:Index was not correct..