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

Custom container

Former Member
0 Likes
681

Can anybody tell me how to insert an image in custon containe header?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
656

try these demo programs

SAP_PICTURE_DEMO

RSDEMO_PICTURE_CONTROL

4 REPLIES 4
Read only

former_member745780
Active Participant
0 Likes
656

Hello

Try this


data:       pic_container    TYPE    REF TO cl_gui_custom_container.

  DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE, " Query string for WWW server
          html_table LIKE w3html OCCURS 1,                    " Contains HTML for WWW client
          return_code LIKE w3param-ret_code,    " Parameter definitions for various function modules
          content_type LIKE w3param-cont_type,  " Content type
          content_length LIKE w3param-cont_len, " Content length
          pic_data LIKE w3mime OCCURS 0,        " Contains MIME data for WWW client
          pic_size TYPE i.                      " Picture size

  REFRESH query_table.

  query_table-name = '_OBJECT_ID'.
  query_table-value = 'MAC_PICTURE'.

  APPEND query_table.

*Create container for picture
  CREATE OBJECT picture
    EXPORTING
      parent = pic_container
    EXCEPTIONS
      error  = 1
      OTHERS = 2    .

  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 '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.

  IF sy-subrc = 0.
    pic_size = content_length.
  ENDIF.

  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type                 = 'IMAGE'
      subtype              = cndp_sap_tab_unknown
      size                 = pic_size
    TABLES
      data                 = pic_data
    CHANGING
      url                  = url
    EXCEPTIONS
      dp_invalid_parameter = 1
      dp_error_put_table   = 2
      dp_error_general     = 3
      OTHERS               = 4.

  CALL METHOD picture->load_picture_from_url
    EXPORTING
      url    = url
    EXCEPTIONS
      error  = 1
      OTHERS = 2.


*Display mode of picture
  CALL METHOD picture->set_display_mode
    EXPORTING
      display_mode = cl_gui_picture=>display_mode_stretch
    EXCEPTIONS
      error        = 1
      OTHERS       = 2.

hope this will help you

Thanks

Anirudh Saini

Read only

Former Member
0 Likes
657

try these demo programs

SAP_PICTURE_DEMO

RSDEMO_PICTURE_CONTROL

Read only

Former Member
0 Likes
656

I am not able to inser my own images from TCODe OAER. Please help me how to proceed with that?

Read only

Former Member
0 Likes
656

Hi,

Go to tcode OAER .

Class name 'PICTURES' .

Give obj key: xxx

Class type OT

In Create tab-> Screen right click to Import

Your picture is stored in the document server.

Hope this will help you.

Regards

Guruprasad