Skip to Content

Send internal table data to Spool

Hello All,

We have a FI report which we are using to download the internal table into local desktop in .TXT file with "|" separator using GUI_DOWNLAOD. The internal table has single field called LINE with character 3000.

When we execute this report in background mode we need to write the same internal table into spool(they wont have access to AL11).Please let me know which one is better way to achieve this.

When user download the output from spool and save the file in .TXT into their local desktop we need the file format and everything should be same as GUI_DOWNLAOD.

I tried by simple write statement and some FM as well however nothing has worked out.

sincerely appreciate your feedback and comments on this.


Manimaran K

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Mar 14, 2018 at 10:41 AM

    I'd use CL_SALV_TABLE. It produces a nice report in background. If you need more then use full ALV: (Just don't use that execrable FM to do it...)

    CL_SALV_TABLE=>FACTORY( IMPORTING r_salv_table = alv 
                            CHANGING t_data = my_internal_table ).
    alv->display( ).
    Add comment
    10|10000 characters needed characters exceeded

    • Hello Matthew,

      Thanks for your response.

      Using write statement i could display the internal table data into spool, however the problem is up to 255 character only getting displayed in the spool where as in my internal table has 540 character in a column(only one column i have in my internal table). Now by increasing Line Size of the report and writing from string variable i could get the desired output.


      Manimaran K

  • Mar 14, 2018 at 09:11 AM

    During your WRITE test, did you provide print parameters with a wide enough size (3000?)

    Else could you consider some EXPORT of the internal table TO DATABASE, in some Z-INDX type file, and a small report that will IMPORT this data back before calling GUI_DOWNLOAD and DELETE the data.

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Raymond,

      Yes you are right i am selecting same format for output device LOCL but still it displayed only 255 character.

      So what i understood was in debug mode if we check the wa_out-line in Fast Display view we could see only 255 character, so i guess may be the same has been displayed in the spool as well.

      Though it is wired the issue has been resolved by writing from String variable instead of character.

      BEGIN OF ty_out,

      line(3000) TYPE c,

      END OF ty_out,

      DATA: it_out TYPE TYPE STANDARD TABLE OF ty_out,

      wa_out type ty_out,

      lv_string TYPE string.

      LOOP AT it_out INTO wa_out.

      lv_string = wa_out-line.

      WRITE:/ lv_string.



      Manimaran K

  • Mar 14, 2018 at 01:22 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2018 at 02:56 PM

    If I may suggest, just have the program email a TXT file to the users when it's done. It'll save you from this headache and save users time. Really, the business users should have no business (no pun intended) digging around spools in SP01. Make the software work for people.

    Add comment
    10|10000 characters needed characters exceeded