cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to display the PDF document in a pop up in SAP ECC ?

GKhadeerBasha
Explorer
0 Likes
1,256

Hi,

I have generated the Adobe form PDF. Now, I have to display that pdf in a pop up. How to do this? Please advise.

Rgds,

G. Khadeer Basha

 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

yashoratna
Active Participant
0 Likes

First, you can convert PDF xstring data to binary format( FM SCMS_XSTRING_TO_BINARY )

Then use class cl_gui_html_viewer with methods load_data/ show_url to display PDF file in popup

 CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer     gv_pdf_xstring
      TABLES
        binary_tab lt_data.

CALL METHOD lo_ref_html_ctr->load_data
      EXPORTING
        type                   'application'
        subtype                'pdf'
      IMPORTING
        assigned_url           lv_url
      CHANGING
        data_table             lt_data
      EXCEPTIONS
        dp_invalid_parameter   1
        dp_error_general       2
        cntl_error             3
        html_syntax_notcorrect 4
        OTHERS                 5.
    IF sy-subrc EQ 0.
      CALL METHOD lo_ref_html_ctr->show_url
        EXPORTING
          url                    lv_url
          in_place               space
        EXCEPTIONS
          cntl_error             1
          cnht_error_not_allowed 2
          cnht_error_parameter   3
          dp_error_general       4
          OTHERS                 5.
      IF sy-subrc NE 0.
        CLEAR lv_url.
      ENDIF.

Raju_61
Explorer
0 Likes

In the command box type !pdf and enter