cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert alv list into excel file?

Former Member
0 Kudos

Hi Experts,

i have created one report for Due Date Analysis.

Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.

So i need the Function Module to Convert the Data into Excel File.

Thanks,

Neptune.M

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI

GOOD

TO THROUGH THE FOLLOWING LONKS

http://www.leeds.ac.uk/iss/projects/sap_upgrade/ALV_Superuser_message.doc

THANKS

MRUTYUN

Former Member
0 Kudos

Hi Neptune,

you have an option in the excel to export it to EXcel format..

just click on the icon on the top to export it ..

it will prompt you to select an option

one of them wud be excel..

regards

satesh

Former Member
0 Kudos

Hi Satesh,

I know the Icon to export to excel file. But My Question is Different.

My Requ is,

While i am running the Report , then Contents of the Alv List (output of the Report) will go to Customer thro Email in Excel Format.

I think Now you can Understand my Question. No way to Click the Icon or something else. Just I want to Execute the Report, the Automatically mail triggered to the Customer which the mail has the attachement in Excel Format.

Thanks,

Neptune.M

Former Member
0 Kudos

Use FM:

SAP_CONVERT_TO_XLS_FORMAT

to convert your internal table to XL format.

Regards,

Wenceslaus.

Former Member
0 Kudos

Hi,

Thers is no Such a FM in Sap. Instead of this Fm,

SAP_CONVERT_TO_XLS_FORMAT is there. But the above FM also not working Properly.

Is there any other FM?

Thanks,

Neptune.M

Former Member
0 Kudos

Hi neptune,

Check this code..

Give your filename where you want to save the excel file.

parameters: p_file like rlgrap-filename default 'c:tmptest.xls'.
data: itab like t001 occurs 0 with header line.
select * from t001 into table itab.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
  EXPORTING
    I_FILENAME                 = p_file
  TABLES
    I_TAB_SAP_DATA             = itab
.

Former Member
0 Kudos

Hi,

U can use function module gui_download.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = 'C:\Transportaionlane.XLS'

filetype = 'DAT'

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

TABLES

ata_tab = t_trans_lane_dis[]

  • OTHERS = 22

.

if u want with header then pass the header.

regards

Ahasan

Former Member
0 Kudos

Hi,

How can i include the header details into the xls file when i used GUI_DOWNLOAD FM?

Thanks,

Neptune.M

Former Member
0 Kudos

Hi Neptune,

You need to pass the header details in the first row of the internal table (to be passed in GUI_DOWNLOAD).

Check the Function Module documentation for further details...

You can also try the FMs

SAP_CONVERT_TO_XLS_FORMAT

WS_EXCEL

MCP_PRINT_EXCEL

Hope it helps...

Lokesh

pls. reward appropriate points

Former Member
0 Kudos

Hi Lokesh,

As per your statement i have included the header to the first line of the internal table itab_result. and i have used gui_download function to download the datas into excel file.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:\YNEW1.XLS'

FILETYPE = 'DAT'

HEADER = '00'

TABLES

DATA_TAB = ITAB_RESULT.

Now i am using user FM to send a mail to the Customer while i am running the Report.

My Problem is,

My Excel file have no header when it reached the user side. But In MY BUSINESS WORKPLACE(SBWP) the attachment excel file has Header.

what is the reason? Plz help me

Thanks,

Neptune.M