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 WEBGUI ?

Former Member
0 Kudos

hi there,

i have business documents in PDF-format.

i am opening it in ABAP with

CALL METHOD cl_bds_document=>display

this works perfect for SAP WINGUI, acrobat reader is opened with the document.

BUT: i have to use my abap in SAP WEBGUI.

there i only get the info 'xxxxxx bytes downloaded' and NO acrobat reader is opened. it seems

that the document is only downloades somewhere.

any ideas ? i need to open the document

reg, Martin

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

Try with the class

CL_GUI_HTML_VIEWER

0 Kudos

well, thank you, but:

how should i use class CL_GUI_HTML_VIEWER ? which method i should call ?

how can i handle this with my business document ?

reg, Martin

0 Kudos

This takes pdf data and shows it in browser.

you have to use two methods one load data and other show_url.

i am not sure in your case how to capture that pdf data..

**-Load PDF Data
*  call method cl_htmlviewer->load_data
*    EXPORTING
*      type                 = v_application
*      subtype              = v_pdf
*      size                 = v_numbytes
*    IMPORTING
*      assigned_url         = v_url
*    CHANGING
*      data_table           = lt_pdf
*    EXCEPTIONS
*      dp_invalid_parameter = 1
*      dp_error_general     = 2
*      cntl_error           = 3
*      others               = 4.
*
*
*  call method cl_htmlviewer->show_url   "data
*    EXPORTING
*      url                    = v_url
*      in_place               = ' '
*    EXCEPTIONS
*      cntl_error             = 1
*      cnht_error_not_allowed = 2
*      cnht_error_parameter   = 3
*      dp_error_general       = 4
*      others                 = 5.

0 Kudos

hi,

i have tried out with the following code:

but at the end nothing is displayed in webgui, the abap runs trough 'empty'

IF cl_htmlviewer IS INITIAL.

      CREATE OBJECT my_container
        EXPORTING
          container_name = 'HTML'.

      CREATE OBJECT cl_htmlviewer
        EXPORTING
          parent = my_container.

    ENDIF.


    CALL METHOD cl_htmlviewer->load_data
      EXPORTING
         type                 = 'APPLICATION'
        subtype              = 'pdf'
      IMPORTING
        assigned_url         = gf_url
      CHANGING
        data_table           = gt_content
      EXCEPTIONS
        dp_invalid_parameter = 1
        dp_error_general     = 2
        cntl_error           = 3
        OTHERS               = 4.

    CALL METHOD cl_htmlviewer->show_url   "data
      EXPORTING
        url                    = gf_url
        in_place               = 'X'
      EXCEPTIONS
        cntl_error             = 1
        cnht_error_not_allowed = 2
        cnht_error_parameter   = 3
        dp_error_general       = 4
        OTHERS                 = 5.