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: 

Download data from internal table into XLSX

0 Kudos

Hi Everybody,

how can I export data from internal table to existing EXCEL (starting on the 14th row and the 3rd column)? Is that possible without using FM?

For example this internal table:

TABLES sflight.

DATA: lt_output TYPE STANDARD TABLE OF sflight,
      ls_output LIKE LINE OF lt_output.

SELECT * FROM sflight INTO TABLE lt_output UP TO 50 ROWS.

Thanks,

Nella

1 ACCEPTED SOLUTION
5 REPLIES 5

mateuszadamus
Active Contributor

Hi nella17

You will need to execute one or two function modules or class methods to achieve your goal.

1. Save data to an Excel file.

2. Save the file in the desired location (e.g.: class CL_GUI_FRONTEND_SERVICES method GUI_DOWNLOAD).

3. Not required, but it would be nice to allow user to select the desired location (e.g.: CALL class CL_GUI_FRONTEND_SERVICES method FILE_SAVE_DIALOG).

Now, depending on the functions/classes you're going to use for Excel file creation, it may or may not be possible to write your data to a specific row/column of an Excel file.

Regards,
Mateusz

0 Kudos

Hi Mateusz,

thank you for answering, but will it works if I have some data in Excel and have to add another? I know how I can export data to Excel file but I don't want transliterate existing data.

Sorry for this stupid questions, I am new in ABAP world.

Nela

0 Kudos

Hi nella17

It depends on the way you export to Excel. You will probably need to some more advances solution to Export, than standard export functions.

Regards,
Mateusz

Sandra_Rossi
Active Contributor

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.