Application Development and Automation 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: 
Read only

PDF output

Former Member
0 Likes
921

Hi Friends,

I need help on the below query.

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.

how can i achieve it?

I am working on version 4.7 enterprise edition.

thanks in advance

Regards,

Simha

Hi Friends,

I need help on the below query.

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.

how can i achieve it?

I am working on version 4.7 enterprise edition.

thanks in advance

Regards,

Simha

6 REPLIES 6
Read only

Former Member
0 Likes
889

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}.

Jonathan

Read only

0 Likes
889

Hi Jonathan,

I am working on 4.7ee and does this Adobe Web Plug-in comes with it or do we have to update?

can you give me info on ABAP HTML controls..

Thanks in advance,

Simha

Read only

0 Likes
889

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.

To check if you have the HTML Control ( I thought 4.7EE did but I'm not working on that release now ) go to SE38 and up in the menu bar there's something like Environment > Examples > Control Examples which has simple demos of splitters, tree controls, the HTML control etc etc.

Jonathan

Read only

0 Likes
889

Hi Jonathan,

Thanks for the info.

Can you give me some code snippet which can help me in Jump staring my solution.

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.

Small code snippets of the flow would greatly help me.

Thanks in advance,

Simha

Read only

0 Likes
889

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):

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...

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:


  l_url = 'my_temp_pdf.pdf'. "or something
  call method go_html_control->load_data
    importing
      assigned_url = l_url
    changing
      data_table   = lt_pdf_data[]  "from the 'lines' returned by convert_otf
    exceptions
      others       = 1.

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.

Jonathan

Read only

0 Likes
889

Hi Jonathan,

Thanks a lot for your info.

Appreciate it. I could get an idea of how to build the PDF for a push of a button.

Thanks,

Simha