Application Development and Automation 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: 
Read only

Adding image/logo on selection screen

Former Member
0 Likes
1,815

How can I add image or logo on my selection - screen??

7 REPLIES 7
Read only

Former Member
0 Likes
1,125

HI Priya

Look at the transaction dwdm

Pushpraj

Read only

Former Member
0 Likes
1,125

This message was moderated.

Read only

Former Member
0 Likes
1,125

This message was moderated.

Read only

dev_parbutteea
Active Contributor
0 Likes
1,125

Hi,

in AT-SELECTION-OUTPUT EVENT put these codes:

data: lv_docking type ref to cl_gui_docking_container,

lv_picture_control_1 type ref to cl_gui_picture,

lv_url(256) type c ,

li_query_table type w3query occurs 1 with header line,

li_html_table type w3html occurs 1,

lv_return_code type w3param-ret_code,

lv_content_type type w3param-cont_type,

lv_content_length type w3param-cont_len,

li_pic_data type w3mime occurs 0,

lv_pic_size type i.

refresh :li_query_table ,li_html_table , li_pic_data.

clear :

lv_url,

lv_return_code,

lv_pic_size,

lv_picture_control_1,

lv_docking,

lv_content_type,

lv_content_length.

create object lv_picture_control_1

exporting

parent = lv_docking.

check sy-subrc = 0.

call method lv_picture_control_1->set_3d_border

exporting

border = 5.

call method lv_picture_control_1->set_display_mode

exporting

display_mode = cl_gui_picture=>display_mode_stretch.

call method lv_picture_control_1->set_position

exporting

height = 75

left = 1200

top = 250

width = 250.

if lv_url is initial.

refresh li_query_table.

li_query_table-name = '_OBJECT_ID'.

*IMAGE UPLOADED IN SWO0

li_query_table-value = 'ZLOGO'.

append li_query_table.

call function 'WWW_GET_MIME_OBJECT'

tables

query_string = li_query_table

html = li_html_table

mime = li_pic_data

changing

return_code = lv_return_code

content_type = lv_content_type

content_length = lv_content_length

exceptions

object_not_found = 1

parameter_not_found = 2

others = 3.

if sy-subrc <> 0.

  • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

call function 'DP_CREATE_URL'

exporting

type = 'image'

subtype = cndp_sap_tab_unknown

size = lv_pic_size

lifetime = cndp_lifetime_transaction

tables

data = li_pic_data

changing

url = lv_url

exceptions

others = 1.

endif.

call method lv_picture_control_1->load_picture_from_url

exporting

url = lv_url.

Read only

GauthamV
Active Contributor
0 Likes
1,125

Use this program and picture available in SMW0 transaction.



REPORT  Ztest.
DATA: docking TYPE REF TO cl_gui_docking_container,
      picture_control_1 TYPE REF TO cl_gui_picture,
      url(256) TYPE c .
DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
      html_table LIKE w3html OCCURS 1,
      return_code LIKE  w3param-ret_code,
      content_type LIKE  w3param-cont_type,
      content_length LIKE  w3param-cont_len,
      pic_data LIKE w3mime OCCURS 0,
      pic_size TYPE i.
PARAMETERS: date type sy-datum DEFAULT sy-datum .

AT SELECTION-SCREEN OUTPUT.
  PERFORM show_pic.START-OF-SELECTION.
*&-------------------------------------------------------------------
*& Form show_pic
*&-------------------------------------------------------------------
FORM show_pic.
DATA: repid LIKE sy-repid.
 repid = sy-repid.
  CREATE OBJECT picture_control_1 EXPORTING parent = docking.
  CHECK sy-subrc = 0.
  CALL METHOD picture_control_1->set_3d_border
    EXPORTING
      border = 5.
      CALL METHOD picture_control_1->set_display_mode
    EXPORTING
      display_mode = cl_gui_picture=>display_mode_stretch.
  CALL METHOD picture_control_1->set_position
    EXPORTING
      height = 100
      left   = 500
      top    = 50
      width  = 300.

IF url IS INITIAL.
 REFRESH query_table.
    query_table-name  = '_OBJECT_ID'.
   skip 5.
    query_table-value = 'ZLOGO'.
    APPEND query_table.  
  CALL FUNCTION 'WWW_GET_MIME_OBJECT'
      TABLES
        query_string        = query_table
        html                = html_table
        mime                = pic_data
      CHANGING
        return_code         = return_code
        content_type        = content_type
        content_length      = content_length
      EXCEPTIONS
        object_not_found    = 1
        parameter_not_found = 2
        OTHERS              = 3.
    CALL FUNCTION 'DP_CREATE_URL'
      EXPORTING
        type     = 'image'
        subtype  = cndp_sap_tab_unknown
        size     = pic_size
        lifetime = cndp_lifetime_transaction
      TABLES
        data     = pic_data
      CHANGING
        url      = url
      EXCEPTIONS
        OTHERS   = 1.

        ENDIF.
        CALL METHOD picture_control_1->load_picture_from_url
    EXPORTING
      url = url.
endform.

Read only

Former Member
0 Likes
1,125

This message was moderated.

Read only

Former Member
0 Likes
1,125

This message was moderated.