Skip to Content

Fix the length of columns in excel sheet created as attachment.


We are creating a report which needs to send the report output table data as an excel attachment .

The issue we are facing is that, the column width for all the fields are given by default.

I would like to know if we can specify the output length of each of these fields separately in the excel.

For example, The length of column like LIFNR should be 16 chars and output length of 'Description' field should be set at 50 chars so that the user can view complete data without manually adjusting the columns if he excel.

Inputs would be greatly appreciated.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2012 at 11:10 AM


    Is this an online report or this may be run at background as well?

    If it is online, use simple concepts of OLE for the formatting.

    For using XML, the Microsoft website will give you all the info on the tags required. You can also create an Excel file, save it as XML, and inspect it in Notepad. A bonus you get for not using OLE is you can run the ABAP code even in background, since you are just creating a text attachment (XML).

    With the XML approach I've been able to format individual cells, set column widths, and do a number of levels of operations via Excel formulas.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.