<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Abap: How to allign spreadsheet in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048758#M1968594</link>
    <description>&lt;P&gt;Hi All, &lt;/P&gt;
  &lt;P&gt;I have a query. I have a report where a Email is sent along with an spreadsheet attachment.&lt;/P&gt;
  &lt;P&gt; Question here is when I open the spreadsheet from mail inbox,the alignment of the spreadsheet is not proper also I need borders with correct font size. Can this be done.If so can you please tell me how. &lt;/P&gt;
  &lt;P&gt;I know how to generate a new spreadsheet using OLE.But changing the spreadsheet during attachment not sure how to do it. Thanks.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Not Aligned:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1753679-not-alligned.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Aligned&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1753680-aliigned-correct.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;:&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 04:07:34 GMT</pubDate>
    <dc:creator>former_member290783</dc:creator>
    <dc:date>2019-12-06T04:07:34Z</dc:date>
    <item>
      <title>Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048758#M1968594</link>
      <description>&lt;P&gt;Hi All, &lt;/P&gt;
  &lt;P&gt;I have a query. I have a report where a Email is sent along with an spreadsheet attachment.&lt;/P&gt;
  &lt;P&gt; Question here is when I open the spreadsheet from mail inbox,the alignment of the spreadsheet is not proper also I need borders with correct font size. Can this be done.If so can you please tell me how. &lt;/P&gt;
  &lt;P&gt;I know how to generate a new spreadsheet using OLE.But changing the spreadsheet during attachment not sure how to do it. Thanks.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Not Aligned:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1753679-not-alligned.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Aligned&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1753680-aliigned-correct.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;:&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 04:07:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048758#M1968594</guid>
      <dc:creator>former_member290783</dc:creator>
      <dc:date>2019-12-06T04:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048759#M1968595</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/24327/premjitger.html"&gt;Premjit Ger&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It can be set using 'ColumnWidth' parameter.&lt;/P&gt;&lt;P&gt;Refer to below sample code which I have used in one of custom report. where I have set column width to 30&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM fill_cell_value USING iv_row TYPE syst_tabix
                           iv_column TYPE syst_tabix
                           iv_value TYPE any.

  DATA:lo_cell     TYPE ole2_object,
       lo_interior TYPE ole2_object,
       lo_font     TYPE ole2_object.

  CALL METHOD OF go_excel 'Cells' = lo_cell EXPORTING #1 = iv_row #2 = iv_column.
  SET PROPERTY OF lo_cell 'Value' = iv_value.
  SET PROPERTY OF lo_cell 'ColumnWidth' = 30.

  IF iv_row EQ 6 AND iv_value EQ 'Mandatory'.
    GET PROPERTY OF lo_cell 'Font' = lo_font.
    SET PROPERTY OF lo_font 'ColorIndex' = 3.
  ENDIF.

  CHECK iv_column LE 3.
  GET PROPERTY OF lo_cell 'Interior' = lo_interior.
  SET PROPERTY OF lo_interior 'ColorIndex' = 43.

ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 04:19:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048759#M1968595</guid>
      <dc:creator>ThangaPrakash</dc:creator>
      <dc:date>2019-12-06T04:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048760#M1968596</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks.If possible can you send me your code,so that it would be easy for me to compare.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 05:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048760#M1968596</guid>
      <dc:creator>former_member290783</dc:creator>
      <dc:date>2019-12-06T05:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048761#M1968597</link>
      <description>&lt;P&gt;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. At the same time, the person will be informed of your comment (currently not).&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 16:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048761#M1968597</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-06T16:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048762#M1968598</link>
      <description>&lt;P&gt;You have many questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Borders&lt;/LI&gt;&lt;LI&gt;Font size&lt;/LI&gt;&lt;LI&gt;"alignment"? (column width?)&lt;/LI&gt;&lt;LI&gt;(and background color maybe?)&lt;/LI&gt;&lt;LI&gt;Change the spreadsheet during attachment to email&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The questions about the formatting are very simple to manage by yourself, use Excel VBA recorder, and translate manually the recorded VBA code into ABAP (cf my answer and comments here: &lt;A href="https://answers.sap.com/questions/287201/como-eliminar-filas-vacias-en-ole-abap.html"&gt;https://answers.sap.com/questions/287201/como-eliminar-filas-vacias-en-ole-abap.html&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;I don't understand what is the issue about changing the spreadsheet during attachment to email, which in fact can be summarized to just changing the spreadsheet (I don't see what you want to do "during attachment to email", it's too late...) With OLE you can open an Excel file, change it and save it. What issue do you have?&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;P&gt;why don't you use &lt;A href="https://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx"&gt;abap2xlsx&lt;/A&gt; instead of OLE?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 16:55:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048762#M1968598</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-06T16:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048763#M1968599</link>
      <description>&lt;A href="https://answers.sap.com/users/24327/premjitger.html"&gt;Premjit Ger&lt;/A&gt;&lt;PRE&gt;&lt;CODE&gt;* Create OLE Excel application
  DATA:lo_mapl      TYPE ole2_object,
       lo_map       TYPE ole2_object,
       lo_worksheet TYPE ole2_object.

  CREATE OBJECT go_excel 'EXCEL.APPLICATION'.
  CALL METHOD OF go_excel 'Workbooks' = lo_mapl.
  SET PROPERTY OF go_excel 'Visible' = 1.
  CALL METHOD OF lo_mapl 'Add' = lo_map.
  GET PROPERTY OF go_excel 'ACTIVESHEET' = lo_worksheet.
  SET PROPERTY OF lo_worksheet 'Name' = 'First Sheet'.

*Then fill the value of every cell by using VALUE property and width by using 'ColumnWidth' property
  CALL METHOD OF go_excel 'Cells' = lo_cell EXPORTING #1 = iv_row #2 = iv_column.
  SET PROPERTY OF lo_cell 'Value' = iv_value.
  SET PROPERTY OF lo_cell 'ColumnWidth' = 30.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 18:38:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048763#M1968599</guid>
      <dc:creator>ThangaPrakash</dc:creator>
      <dc:date>2019-12-06T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Abap: How to allign spreadsheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048764#M1968600</link>
      <description>&lt;P&gt;Thank you all...It worked.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 03:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-how-to-allign-spreadsheet/m-p/12048764#M1968600</guid>
      <dc:creator>former_member290783</dc:creator>
      <dc:date>2019-12-09T03:20:05Z</dc:date>
    </item>
  </channel>
</rss>

