Friday, February 5, 2016

Display logo in selection screen of report


REPORT  zgm_test  NO STANDARD PAGE HEADING LINE-SIZE 255.


DATAok_ode TYPE sy-ucomm,
      r_dock_container  TYPE REF TO cl_gui_docking_container,
      r_dock_container1 TYPE REF TO cl_gui_docking_container,
      htmlviewer TYPE REF TO cl_gui_html_viewer,
      r_grid TYPE REF TO cl_gui_alv_grid,
      picture_control_1 TYPE REF TO cl_gui_picture,
      picture TYPE REF TO cl_gui_picture,
      url(256TYPE c,
      repid TYPE sy-repid,
      file_name TYPE sapb-sapfiles,
      file_type TYPE bdn_con-mimetype.


  PARAMETERSUser TYPE sy-uname.

AT SELECTION-SCREEN OUTPUT.

  CHECK r_dock_container IS INITIAL.

  CREATE OBJECT r_dock_container
    EXPORTING
*          PARENT                      =
      repid                       repid
      dynnr                       sy-dynnr
      side                        cl_gui_docking_container=>dock_at_right
      extension                   800
    EXCEPTIONS
      cntl_error                  1
      cntl_system_error           2
      create_error                3
      lifetime_error              4
      lifetime_dynpro_dynpro_link 5
      OTHERS                      6
      .

  repid sy-repid.

  IF htmlviewer IS INITIAL.
    CREATE OBJECT picture_control_1
      EXPORTING
        parent r_dock_container.
  ENDIF.

  CHECK sy-subrc 0.

  CALL METHOD picture_control_1->set_3d_border
    EXPORTING
      border 0.

* ZLOGO2 needs to be maintained in SMW0 transaction

  CALL FUNCTION 'DP_PUBLISH_WWW_URL'
    EXPORTING
      objid                 'ZLOGO2'
      lifetime              'T'
    IMPORTING
      url                   url
    EXCEPTIONS
      dp_invalid_parameters 1
      no_object             2
      dp_error_publish      3
      OTHERS                4.
  IF sy-subrc 0.
    CALL METHOD picture_control_1->load_picture_from_url_async
      EXPORTING
        url url.
  ENDIF.