<?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 Re: Convert Excel To PDF with ABAP Code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142078#M1976055</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Hello Juan. Thanks for your answer. Finally, I have a request from you. I want to rotate the table 90 degrees. Can you help me? Thanks.&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/1776950-ekran-alıntısı.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2020 08:38:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2020-02-04T08:38:42Z</dc:date>
    <item>
      <title>Convert Excel To PDF with ABAP Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142075#M1976052</link>
      <description>&lt;P&gt;Hello Friends, I have a simple Excel file and I want to translate it to PDF with ABAP codes. Converting from DOC file to PDF is done with the code below but it doesn't happen when you try to integrate Excel into this code. Please Help Me.!!&lt;/P&gt;
  &lt;P&gt;***********************************************************************************&lt;/P&gt;
  &lt;P&gt;data: lv_wordapp type ole2_object,&lt;BR /&gt;lv_worddoc type ole2_object,&lt;BR /&gt;lv_wordadoc type ole2_object,&lt;BR /&gt;lv_wordcont type c length 8.&lt;BR /&gt;create object lv_wordapp 'WORD.APPLICATION'.&lt;BR /&gt;set property of lv_wordapp 'Visible' = 0.&lt;BR /&gt;call method of lv_wordapp 'Documents' = lv_worddoc.&lt;BR /&gt;call method of lv_worddoc 'Open'&lt;BR /&gt;exporting&lt;BR /&gt;#1 = 'D:\ITSM\huseyins.docx'. "Bu uzantıyı .xlsx şeklinde yaptığımda PDF formatına dönüştürmüyor.&lt;BR /&gt;call method of lv_wordapp 'ActiveDocument' = lv_wordadoc.&lt;BR /&gt;call method of lv_wordadoc 'Content' = lv_wordcont.&lt;BR /&gt;call method of lv_wordadoc 'SaveAs'&lt;BR /&gt;exporting&lt;BR /&gt;#1 = 'D:\ITSM\huseyins.pdf'&lt;BR /&gt;#2 = 17. "save as a PDF file&lt;BR /&gt;call method of lv_wordapp 'Quit'.&lt;BR /&gt;free object lv_wordapp .&lt;/P&gt;
  &lt;P&gt;***********************************************************************************&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 20:25:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142075#M1976052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-01-31T20:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel To PDF with ABAP Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142076#M1976053</link>
      <description>&lt;P&gt;Thank
you for visiting SAP Community to get answers to your questions. I recommend
that you familiarize yourself with
&lt;A href="https://community.sap.com/resources/questions-and-answers" target="test_blank"&gt;https://community.sap.com/resources/questions-and-answers&lt;/A&gt; (if you haven't
already), as it provides tips for preparing questions that draw responses from
our members. For example, you can outline what steps you took to find answers
(and why they weren't helpful), share screenshots of what you've seen/done,
make sure you've applied the correct tags, and so on. The more details you
provide, the more likely it is that members will be able to assist you.&lt;/P&gt;&lt;P&gt;Should
you wish, you can revise your question by selecting Actions, then Edit
(although once someone answers your question, you'll lose the ability to edit
the question). While editing, you can also "insert code" in the
question (not just copy as text into the body of the question). You'll see the
"insert code" option to the far right of the options (next to the
"insert file" icon). &lt;/P&gt;&lt;P&gt;--Jerry&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 20:28:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142076#M1976053</guid>
      <dc:creator>jerryjanda</dc:creator>
      <dc:date>2020-01-31T20:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel To PDF with ABAP Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142077#M1976054</link>
      <description>&lt;P&gt;This will work. Paths are case sensitive:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;*----------------------------------------------------------------------*
*  Use Excel to convert a spreadsheet to pdf
*----------------------------------------------------------------------*
REPORT y_excel_ole_pdf.
LOAD-OF-PROGRAM.
* Allow OLE calls to COM enabled programs on Workstation (e.g. Excel)
  INCLUDE ole2incl.
* handles for OLE objects
  DATA: oexcel           TYPE ole2_object,    " Excel object
        owbs             TYPE ole2_object,    " collection of workbooks
        owb              TYPE ole2_object.    " workbook
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ErrorHandler
*&amp;amp;---------------------------------------------------------------------*
*       outputs OLE error if any was returned by SAP
*----------------------------------------------------------------------*
  FORM errorhandler.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      WRITE: / 'OLE-Automation Error:'(010), sy-subrc.
      CALL METHOD OF oexcel 'Quit'.
      FREE OBJECT oexcel.
      STOP.
    ENDIF.
  ENDFORM.                    " ErrorHandler
  PARAMETERS: p_source TYPE string LOWER CASE.
  PARAMETERS: p_dest   TYPE string LOWER CASE.
START-OF-SELECTION.
* Start a new copy of Excel
  CREATE OBJECT oexcel 'EXCEL.APPLICATION'.
  PERFORM errorhandler.  "Set oExcel = CreateObject()
* Hide Excel window for now (faster)
  SET PROPERTY OF oexcel 'Visible' = 0.
  PERFORM errorhandler.  "oExcel.Visible = False
* Tell Excel not to update entire worksheet with each change (faster)
  SET PROPERTY OF oexcel 'ScreenUpdating' = 0.
  PERFORM errorhandler.  "oExcel.ScreenUpdating = False
* Get list of workbooks, initially empty
  CALL METHOD OF oexcel 'Workbooks' = owbs.
  PERFORM errorhandler.  "Set oWBs = oExcel.Workbooks
* Open excel file, returning workbook
  CALL METHOD OF owbs 'Open' "= owb
    EXPORTING #1 = p_source.
  PERFORM errorhandler.  "oWBs.Open P_Source
  CALL METHOD OF owbs 'Item' = owb
    EXPORTING #1 = 1.
  PERFORM errorhandler.  "Set oWB = oWBs.Item(1)
* Export file as PDF using the name User defined previously
  CALL METHOD OF owb 'ExportAsFixedFormat'
    EXPORTING #1 = 0       "Type = xlTypePDF
              #2 = p_dest. "FileName
  PERFORM errorhandler.  "oWB.ExportAsFixedFormat xlTypePDF, P_Dest
* Close Excel file without saving changes
  CALL METHOD OF owb 'Close'
    EXPORTING #1 = 0. "Save = False
  PERFORM errorhandler.  "oWB.Close ( Save = False)
* Tell Excel to resume updating entire worksheet with each change
  SET PROPERTY OF oexcel 'ScreenUpdating' = 1.
  PERFORM errorhandler.  "Application.ScreenUpdating = True
* Tell Excel to show worksheet to the User
  SET PROPERTY OF oexcel 'Visible' = 1.
  PERFORM errorhandler.  "oExcel.Visible = True
  CALL METHOD OF oexcel 'Quit'.
  PERFORM errorhandler.  "oExcel.Quit
* Disconnect from Excel
  FREE OBJECT oexcel.
  PERFORM errorhandler.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 22:35:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142077#M1976054</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2020-01-31T22:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Excel To PDF with ABAP Code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142078#M1976055</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello Juan. Thanks for your answer. Finally, I have a request from you. I want to rotate the table 90 degrees. Can you help me? Thanks.&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/1776950-ekran-alıntısı.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 08:38:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-excel-to-pdf-with-abap-code/m-p/12142078#M1976055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-02-04T08:38:42Z</dc:date>
    </item>
  </channel>
</rss>

