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: 

downloading data to a text file using ooabap

Former Member
0 Kudos

hi,

I would like to know how to download an alv tree structured data into a text file. The data in the text file should be in tree structure and should be displayed in a table format.

regards

Jags

2 REPLIES 2

former_member184313
Participant
0 Kudos

hi Jagdeesh,

I know of no other way than do this manually.

1. Make a new button in the toolbar of your ALV-Tree:

See the ABAP BCALV_TREE_04.

2. Add download functionality to this button:

With this FM your internal table will open automatically in an Excel.


CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
 EXPORTING
   DATA_FILENAME             = 'test.xls'
   DATA_TABLE                = lt_itab.

If you use CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD and set the importing parameters WRITE_FIELD_SEPERATOR to 'X' your will get a tab delimited txt file of your internal table.

I hope this helps.

Cheers

Daniel

Former Member
0 Kudos

HI DANIEL,

Thanx for giving your valuable suggestion. But I am unable to get the required output. Please let me know how can we get column aligned(with grids) output in notepad file when we downloading the data from output list. Really its urgent if you know it please let me know.

regards,

Jagadeesh