Application Development and Automation 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: 
Read only

Export data to Excel

Bhaskar_Tripath
Participant
0 Likes
695

Hi All,

I want to export data into local file. The line of internal table is greater than 1023 characters. I have used List->Export->Local File.... But when I open that file in excel the data is wrapped (here with wrapping I mean the fields of the internal table comes in two rows of the excel sheet and so is the data). I want my record to be in a single row in the excel sheet.

Thanks & Regards,

Bhaskar Tripathi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
552

Hi,

try with below code

Use Function moduleSCMS_STRING_TO_FTEXT to split lengthy strings into lines to desired lengths.

You can declare flext_tab with only one field of desired length.

Write the contents of this internal table by looping ...

Regards

Sreeni

3 REPLIES 3
Read only

Former Member
0 Likes
552

Hi,

Try downloading into a flat file and then open it in excel. Check if this solves your problem.

Regards,

Siddhesh S.Tawate

Read only

Former Member
0 Likes
553

Hi,

try with below code

Use Function moduleSCMS_STRING_TO_FTEXT to split lengthy strings into lines to desired lengths.

You can declare flext_tab with only one field of desired length.

Write the contents of this internal table by looping ...

Regards

Sreeni

Read only

venkat_o
Active Contributor
0 Likes
552

Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

DATA: t100_lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.
SELECT * FROM t001
  INTO TABLE t100_lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
  EXPORTING
    i_filename     = p_file
  TABLES
    i_tab_sap_data = t100_lines.
Regards, Venkat.O