TYPE-POOLS cndp.
*&---------------------------------------------------------------------*
*& Data Declaration.
*&---------------------------------------------------------------------*
DATA: docking    TYPE REF TO cl_gui_docking_container,
      htmlviewer TYPE REF TO cl_gui_html_viewer,
      picture    TYPE REF TO cl_gui_picture.

DATA url  TYPE cndp_url.
*&---------------------------------------------------------------------*
*& SELECTION SCREEN.
*&---------------------------------------------------------------------*
PARAMETERS: s_matnr TYPE mara-matnr.

*&---------------------------------------------------------------------*
*& AT SELECTION-SCREEN OUTPUT.
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.

  PERFORM build_htmlviewer.

  CALL METHOD picture->set_display_mode
    EXPORTING
      display_mode = cl_gui_picture=>display_mode_normal_center.


  CALL FUNCTION 'DP_PUBLISH_WWW_URL'
    EXPORTING
      objid    = 'ZLOGO'
      lifetime = cndp_lifetime_transaction
    IMPORTING
      url      = url
    EXCEPTIONS
      OTHERS   = 1.

* Load the picture.
  IF sy-subrc = 0.
    CALL METHOD picture->load_picture_from_url_async
      EXPORTING
        url = url.
  ENDIF.
*&---------------------------------------------------------------------*
*&      Form  build_htmlviewer
*&---------------------------------------------------------------------*
FORM build_htmlviewer .
  DATA: repid LIKE sy-repid.
  repid = sy-repid.

  IF docking IS INITIAL.

    CREATE OBJECT docking
      EXPORTING
        REPID                       = repid
        DYNNR                       = sy-dynnr
        SIDE                        = cl_gui_docking_container=>dock_at_top
        EXTENSION                   = 150
      EXCEPTIONS
        CNTL_ERROR                  = 1
        CNTL_SYSTEM_ERROR           = 2
        CREATE_ERROR                = 3
        LIFETIME_ERROR              = 4
        LIFETIME_DYNPRO_DYNPRO_LINK = 5
        others                      = 6.

    IF htmlviewer IS INITIAL .
      CREATE OBJECT picture
        EXPORTING
          parent             = docking .
    ENDIF .
  ENDIF .
ENDFORM.
 
 
 
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant