Skip to Content

Display PDF inside a container

hi,

i have a Z-programm which has a selection screen on the left side. on the right side the result should be displayed as PDF in a HTML container element.

AT SELECTION-SCREEN OUTPUT.

     CREATE OBJECT lo_docking_container

      EXPORTING

        repid     = sy-repid

        dynnr     = sy-dynnr

        side      = lo_docking_container->dock_at_right

        extension = 1200.

    CREATE OBJECT lo_html

      EXPORTING

        parent = lo_docking_container.

start-of-selection.

.

.

.programm logic for getting the PDF from a spool file.....

.

.

.

end-of-selection.

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

      OTHERS               = 4 ).

lo_html->show_url( url = lv_url in_place = 'X' ).

Now i have the problem that the PDF is NOT displayed inside the container element on the right side. it is empty after the "show_url", as it is at the init in the "AT SELECTION SCREEN OUTPUT". see screenshot:

So HOW can i get the PDF content into the right side container element ? It should be in the same dynpro as the selection screen is (standard dynpro 1000). what i am doing wrong here ? 😔

br Martin

Capture.PNG (26.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 28, 2015 at 08:08 PM

    have solved it on my own: i have created an dynpro and put the selection fields into that dynpro and then called the container. it seems that in "standard dynpro" 1000 with standard selection screen it is not possible to display the pdf in the container 😊

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2015 at 09:06 AM

    Hi.

    If you declared l_html as  CL_GUI_HTML_VIEWER then this should work well.

    If not you'll need to verify PDF association.

    If you launch SAPHTML_DEMO1  report and you put as URL a file reference like C:\test.pdf, you should see your content.


    If not, it's a PDF problem association and you'll have to check your workstation PDF program viewer association.


    If yes, then check in Debug Mode if URL is filled with value and if lt_data contain data.


    Hope to help

    Bye

    Add comment
    10|10000 characters needed characters exceeded