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: 

write to excel file (into AL11 directory)

Former Member
0 Kudos
5,381

Hi,

I am able to loop an internal table and write to csv file in AL11 directory.

But how to write to excel file instead of csv file. And how to format the excel file (for example, column B should be format to numeric and column E should format to date format), and are we able to put like red color on column C for example?

Thanks in advance.

6 REPLIES 6

former_member181995
Active Contributor
0 Kudos
449

I think you cannot get a similer view of files(.xls) in Application server. but by giving proper tab spaces you can get proper view of files in application server.But not exactly like Excel.

refer:

http://sap.ittoolbox.com/groups/technical-functional/sap-dev/how-to-create-excel-file-xls-on-sap-app...

Former Member
0 Kudos
449

Hi,

You need to add the tab inbetween all the fields of internal table and upload to application server using

OPEN DATASET

TRANSFER

CLOSE DATASET.

to add the tab inbetween the fields..you can use this code....

concatenete itb-field1 itab-field2......... into string seperated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

one exception whicle uploading data to the Application server you need to convert dec or currency field to char type otherwise it will give you short dump.

0 Kudos
449

Thanks that help. But how to format the excel file then?

0 Kudos
449

HI,

As of my knowledge you cannot format the Coloums to date or numeric.It considers only the Char format.

0 Kudos
449

I mean after I output the excel file in AL11, I want to format the excel file from AL11.

Any ABAP code to read the excel file from AL11, and then format the columns. For example, column B to numeric and column C to date and etc. I believe ABAP can do that. Anyone can helps?

Former Member
0 Kudos
449

Hi,

I hope it cannot be done in excel file from AL11.

Regards,

Joan