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 Viewer

Former Member
0 Likes
5,605

Hi,

Is there any way to use the PDF Document viewer inside SAP. Which can replace sapscript or smart forms??

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
2,184

Hi Bala,

PL use the function module 'HR_IT_DISPLAY_WITH_PDF'.

Regards,

Suresh Datti

6 REPLIES 6
Read only

furlan
Participant
0 Likes
2,184

Bala,

There is no way to generate PDF inside SAP. What I know is gereate PDF from spool. So to generate spool you stil need sapscrip, smart forms, simple report or ALV.

Regards!

Furlan

Read only

athavanraja
Active Contributor
0 Likes
2,184

<i>Is there any way to use the PDF Document viewer inside SAP</i>

do you mean a viewer to view PDF forms within SAPGUI?

if yes , yes this can be done.

check out the class

<b>cl_gui_pdfviewer</b>

and the demo program

<b>SAP_PDF_VIEWER_DEMO</b>

you could also simply use the HTML viewer control to view the PDF documents.

Regards

Raja

Message was edited by: Durairaj Athavan Raja

Read only

0 Likes
2,184

> <i>Is there any way to use the PDF Document viewer

> inside SAP</i>

>

> do you mean a viewer to view PDF forms within

> SAPGUI?

>

> if yes , yes this can be done.

>

> check out the class

>

> <b>cl_gui_pdfviewer</b>

>

> and the demo program

>

> <b>SAP_PDF_VIEWER_DEMO</b>

>

> you could also simply use the HTML viewer control to

> view the PDF documents.

>

>

> Regards

> Raja

>

>

> Message was edited by: Durairaj Athavan Raja

Thanks so much, I was having trouble opening a PDF from a custom container within a dynpro screen using SAPGUI, and the method OPEN DOCUMENT in class cl_gui_pdfviewer worked great. Thanks again!

Rebecca Levings

FL Dept of Revenue

Read only

Former Member
0 Likes
2,184

Hi Bala,

You can open Sap Script in PDF viewr directly.Follow the below steps to do it.

1) First you call function module open_form

*-Setting print parameters

dt_options-tdimmed = 'X'.

dt_options-tddest = 'DEST'.

dt_options-tdnewid = 'X'.

dt_options-tdnoprev = 'X'.

dt_options-tdpreview = ' '.

dt_options-tdcopies = 1.

dt_options-tdprogram = sy-repid.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • application = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

device = 'PRINTER'

dialog = ' '

form = 'FI_APP_COMM'

language = sy-langu

options = <b>dt_options</b>

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJECT =

  • RAW_DATA_INTERFACE = '*'

IMPORTING

  • LANGUAGE =

  • NEW_ARCHIVE_PARAMS =

result = dt_itcpp

EXCEPTIONS

canceled = 1

device = 2

form = 3

options = 4

unclosed = 5

mail_options = 6

archive_error = 7

invalid_fax_number = 8

more_params_needed_in_batch = 9

OTHERS = 10.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

2) After that call write form depending on your requirement.

3)Then call Close form passing dt_itcpp

*--Close form

CALL FUNCTION <b>'CLOSE_FORM'</b>

IMPORTING

result = <b>dt_itcpp</b>

  • RDI_RESULT =

  • TABLES

  • OTFDATA =

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

send_error = 3

OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

4)*--Convert Script spool to PDF

DATA:dl_sppolid LIKE tsp01-rqident.

dl_sppolid = dt_itcpp-tdspoolid.

5) Call function module

CALL FUNCTION <b>'CONVERT_OTFSPOOLJOB_2_PDF'</b>

EXPORTING

src_spoolid = dl_sppolid

no_dialog = 'X'

IMPORTING

pdf_bytecount = numbytes

TABLES

pdf = dg_pdf_script

EXCEPTIONS

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11

OTHERS = 12.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

This will open scrpt in PDF viewer.Hope this will help you.

Thanks & REgards,

Siri.

Message was edited by: Srilatha T

Message was edited by: Srilatha T

Read only

suresh_datti
Active Contributor
0 Likes
2,185

Hi Bala,

PL use the function module 'HR_IT_DISPLAY_WITH_PDF'.

Regards,

Suresh Datti

Read only

markus_meisl
Advisor
Advisor
0 Likes
2,184

Hi Bala,

there is one other new way to generate PDFs in SAP.

SAP NetWeaver '04 contains a forms solution called Interactive Forms, which can also be used for print forms and is based on Adobe technology. Read more about it at http://sdn.sap.com/irj/sdn/adobeforms.

Regards,

Markus Meisl

SAP NetWeaver Product Management