<?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: PDF output in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859163#M927597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please note that I haven't tried all the steps chained together, but I've used different parts for different projects so my gut feel is that it should work... caveat emptor... anyhow I think the process would be something like this (note that I've assumed SAPScript functions here, not SmartForms):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First get the data from your screen (in PAI) - this will now be in the global memory for your module pool / report ... and it needs to be for the SAPScript to get the values, of course.  Execute the SAPScript form using the usual function modules e.g. "OPEN_FORM" {remembering to set itcpo-tdgetotf as "X" so you can get the contents back at the end}... "WRITE_FORM" for any header data... and looping around data with "WRITE_FORM" however many times are needed for your repeating data... then "CLOSE_FORM" and grab the "otfdata" internal table from there...then call "CONVERT_OTF" with the otfdata array with the "format" parameter = "PDF" - the PDF data should be returned in the "lines" table from that function... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically you might then use this PDF data table to download, email or whatever, but for your purposes you now want to try loading it directly into the HTML control... I know you can do this with straight HTML generated inside an ABAP program , so hopefully it will be fine with a PDF data stream - but I've never tried it -  so first follow the logic in the SAP demo HTML program to define your container, and create the control instance etc but rather than getting data from a real URL, do something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  l_url = 'my_temp_pdf.pdf'. "or something
  call method go_html_control-&amp;gt;load_data
    importing
      assigned_url = l_url
    changing
      data_table   = lt_pdf_data[]  "from the 'lines' returned by convert_otf
    exceptions
      others       = 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I find a spare couple of hours, I might give it a go myself but that won't be until next week at earliest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2008 03:08:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-16T03:08:18Z</dc:date>
    <item>
      <title>PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859158#M927592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help on the below query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a process where user will select multipl rows from a screen ( a table control or a ALV ) and on a push of button , data selected has to be written on a PDF in the screen itself with buttons on the top to 'Approve' or "Reject" those lines. the selected data will be displayed in the PDF in that screen itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i achieve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on version 4.7 enterprise edition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 02:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859158#M927592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T02:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859159#M927593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ABAP HTML control can be used to display a PDF using the Adobe web plug-in, and then all you have to do is transform your screen data into the data stream ... and a simple SAPScript {Smartform?) could be built to generate the layout which you can have returned to your program as PDF {plenty of SDN postings on that topic - the function modules OPEN_FORM / WRITE_FORM / CLOSE_FORM / CONVERT_OTF could be part of this solution}.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 03:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859159#M927593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T03:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859160#M927594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on 4.7ee and does this Adobe Web Plug-in comes with it or do we have to update?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you give me info on ABAP HTML controls..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 03:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859160#M927594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T03:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859161#M927595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "plug in" I was referring to was just the one in Internet Explorer that allows you to view a PDF document without opening a separate Acrobat session... e.g. if you click on [How to Define Web Dynpro Themes|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3ea0d790-0201-0010-80b8-b680496a3838] on my computer this will open the PDF document inside IE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To check if you have the HTML Control ( &lt;EM&gt;I thought 4.7EE did but I'm not working on that release now&lt;/EM&gt; ) go to SE38 and up in the menu bar there's something like Environment &amp;gt; Examples &amp;gt; Control Examples which has simple demos of splitters, tree controls, the HTML control etc etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 06:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859161#M927595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-15T06:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859162#M927596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me some code snippet which can help me in Jump staring my solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could understand what you meant, On push of a button, i need to take that data that i want to publish, invoke the HTML controls, but i am confused as to when i call the Smartform and how to pass it to Html controls and when to convert the form to PDF using FM convert_otf_2_pdf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Small code snippets of the flow would greatly help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 01:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859162#M927596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T01:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859163#M927597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please note that I haven't tried all the steps chained together, but I've used different parts for different projects so my gut feel is that it should work... caveat emptor... anyhow I think the process would be something like this (note that I've assumed SAPScript functions here, not SmartForms):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First get the data from your screen (in PAI) - this will now be in the global memory for your module pool / report ... and it needs to be for the SAPScript to get the values, of course.  Execute the SAPScript form using the usual function modules e.g. "OPEN_FORM" {remembering to set itcpo-tdgetotf as "X" so you can get the contents back at the end}... "WRITE_FORM" for any header data... and looping around data with "WRITE_FORM" however many times are needed for your repeating data... then "CLOSE_FORM" and grab the "otfdata" internal table from there...then call "CONVERT_OTF" with the otfdata array with the "format" parameter = "PDF" - the PDF data should be returned in the "lines" table from that function... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically you might then use this PDF data table to download, email or whatever, but for your purposes you now want to try loading it directly into the HTML control... I know you can do this with straight HTML generated inside an ABAP program , so hopefully it will be fine with a PDF data stream - but I've never tried it -  so first follow the logic in the SAP demo HTML program to define your container, and create the control instance etc but rather than getting data from a real URL, do something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  l_url = 'my_temp_pdf.pdf'. "or something
  call method go_html_control-&amp;gt;load_data
    importing
      assigned_url = l_url
    changing
      data_table   = lt_pdf_data[]  "from the 'lines' returned by convert_otf
    exceptions
      others       = 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I find a spare couple of hours, I might give it a go myself but that won't be until next week at earliest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 03:08:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859163#M927597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T03:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: PDF output</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859164#M927598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate it. I could get an idea of how to build the PDF for a push of a button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 01:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-output/m-p/3859164#M927598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T01:23:25Z</dc:date>
    </item>
  </channel>
</rss>

