Skip to Content
P D

Excel Download from AL11

Hi Experts,

I am facing an issue downloading AL11 data into the excel. I have a got an ALV report and before the report is getting displayed we are trying to sent the final internal contents to the AL11 directory. So our AL11 file looks something like this.

Coloumn Headings

     Coloumn Data

The '#' (as delimiter) i have annexed so that each data will sit in a cell in the excel. But it is not working. The whole line data is coming in a single cell. I am using the the standard option to download to excel . system -> List -> Save -> Local File. So is it possible to download to excel from AL11 with data in exact cells as we see in ALV ?

P.S. I am on 4.6 C

B.R.

Capture13.PNG (1.2 kB)
Capture14.PNG (5.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Oct 27, 2015 at 08:26 AM

    One more trick.....

    DATA: message TYPE string .
       DATA: number TYPE n LENGTH 3 .

       DATA: my_string TYPE string .

       CONSTANTS: c_max_cols TYPE i VALUE 300 .

       OPEN DATASET dataset_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT MESSAGE message . " Output type


       TRANSFER '<style>'  TO dataset_path .
       TRANSFER 'table, th, td {  border: 1px solid black;  border-collapse: collapse}' TO dataset_path .

       TRANSFER 'th {  text-decoration: underline; text-transform: capitalize; font-style: italic;}' TO dataset_path .
       TRANSFER '</style>'  TO dataset_path .

       TRANSFER '<TABLE>' TO dataset_path .

       TRANSFER '<TR>' TO dataset_path .

    * Headings
       DO c_max_cols TIMES .

         TRANSFER '<TH>' TO dataset_path .

         number = sy-index .

         CONCATENATE 'Head-' number INTO my_string RESPECTING BLANKS .

         TRANSFER my_string TO dataset_path  .

         TRANSFER '</TD>' TO dataset_path .

       ENDDO .

       TRANSFER '</TR>' TO dataset_path .

    * Detail lines
       DO 20 TIMES .

         TRANSFER '<TR>' TO dataset_path .

         DO c_max_cols TIMES .

           TRANSFER '<TD>' TO dataset_path .

           number = sy-index .

           TRANSFER number TO dataset_path .

           TRANSFER '</TD>' TO dataset_path .

         ENDDO .

         TRANSFER '</TR>' TO dataset_path .

       ENDDO .

       TRANSFER '</TABLE>' TO dataset_path .

       CLOSE DATASET dataset_path .


    html :



    Excel:



    pastedImage_2.png (10.2 kB)
    pastedImage_6.png (16.6 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • P D Raymond Giuseppi

      Raymond Giuseppi


      I always wanted to ask but restrained from asking you 'maestro', how did you build this much knowledge ? Some times I feel like  you know everything under the sun. 🤣You are always hiding behind an avatar. It would be great to see a blog from you saying, how you grew up in your career,technical tips and how to stay inquisitive ?😊

  • Oct 22, 2015 at 02:29 AM
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 22, 2015 at 09:26 AM

    Or maybe you it is time to industrialize your communications/data exchanges with data integration tools such as Talend, Informatica, etc.


    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2015 at 02:23 AM

    Hi B.R.

    The quick solution is to use the "Text to Columns" feature in Excel.

    Alternatively you'd need to look at the exceptionally high volume of SCN posts on downloading to Excel.

    Checkout this WIKI page for a start, not sure it's applicable to your release though

    http://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx

    Regards

    Arden

    Add comment
    10|10000 characters needed characters exceeded