Application Development 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: 

Open PDF file in R3

Former Member
0 Kudos

Hi every body,

I have a report, i want to open the report in PDF file inside the R3,

I know how to download to my PC, but i need to open it automatically by PDF.

BR,

Ali

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi see the code given by Rich in the following thread

кu03B1ятu03B9к

8 REPLIES 8

viquar_iqbal
Active Contributor
0 Kudos

Hi

you can use this FM to read PDF

POC_PDF_FORM_READ

FOPC_REPORT_SHOW_PDF

SSFCOMP_PDF_PREVIEW

go to se37 -> Just type pdf and hit F4 and you would find many FM regarding PDF

Former Member
0 Kudos

Hi,

Use this FM..Hope it helps.

CONVERT_ABAPSPOOLJOB_2_PDF

Regards

Kiran

0 Kudos

I alrady use the FM

CONVERT_ABAPSPOOLJOB_2_PDF

but i need to open the pdf after converting ,

Any help

0 Kudos

Use the fm above to write the file to the file system on the server or locally. Create a dialog page with an html viewer. Pass the path to the html viewer and open the page with the default browser.

Your browser can handle pdf files so no problem.

You could also look at a direct call to the browser passing in the path.

Enjoy :>)

0 Kudos

Hi,

check this WIki

[Redierct SapScript output to PDF|https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/redierct+SapScriptoutputtoPDF]

Thanks

Raj

0 Kudos

hi tooCann,

Can you explain more about your answer or give an example to get more idea.

BR,

Ali

0 Kudos

Ali:

This one really got me going after looking at Rich's Hielman's post. Unfortunately, I am not on a 7.00 unicode system, rather 4.6C.

I started looking at this from the perspective of a smartform. My original idea was to generate the pdf file write it to the file system and then call it using an html viewer in a dialog page.

I subsequently found a better approach, at least for smartforms and sapcript using the fm 'HR_IT_DISPLAY_WITH_PDF'.

This fm takes an otf table from the smartform and does all the work for you. Enjoy



REPORT z_render_spool_as_pdf .

DATA: ls_control_param      TYPE ssfctrlop.
DATA: ls_composer_param     TYPE ssfcompop.

ls_control_param-device = space.
ls_control_param-getotf = 'X'.

ls_control_param-getotf = 'X'.
ls_control_param-no_dialog = 'X'.

DATA: l_document_output_info TYPE ssfcrespd,
l_job_output_info TYPE ssfcrescl,
l_job_output_options TYPE ssfcresop.


* Subsitute your smartform name below:
CALL FUNCTION '/1BCDWB/SF00000034'
 EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
    control_parameters         = ls_control_param

*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
 IMPORTING
      document_output_info = l_document_output_info
      job_output_info = l_job_output_info
      job_output_options = l_job_output_options
 EXCEPTIONS
   formatting_error           = 1
   internal_error             = 2
   send_error                 = 3
   user_canceled              = 4
   OTHERS                     = 5
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
     TABLES
          otf_table = l_job_output_info-otfdata.
.

Former Member
0 Kudos

Hi see the code given by Rich in the following thread

кu03B1ятu03B9к