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

Displaying Image on Screen

Former Member
0 Likes
755

Dear gurus

I have to Picture Container in my Screen

and i want to display pictures on them.

Im facing a problem on that

when i execute the program i get the same picture on the other container.

how to resolve it?

Dear gurus

I have to Picture Container in my Screen

and i want to display pictures on them.

Im facing a problem on that

when i execute the program i get the same picture on the other container.

how to resolve it?

4 REPLIES 4
Read only

former_member242255
Active Contributor
0 Likes
728

please check the container names and the assignment you have given so taht it is not repeated..

Read only

0 Likes
728

Container name are different..

CALL METHOD cl_gui_cfw=>flush.   "First Container Coding.

CREATE OBJECT:
  container EXPORTING container_name = 'PICTURE_CONTAINER',
  picture EXPORTING parent = container.

  CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
    EXPORTING
      p_object       = 'GRAPHICS'
      p_name         = 'Snak TpF Logo'
      p_id           = 'BMAP'
      p_btype        = 'BCOL'
    RECEIVING
      p_bmp          = l_graphic_xstr
  EXCEPTIONS
    NOT_FOUND      = 1
    INTERNAL_ERROR = 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.

  graphic_size = XSTRLEN( l_graphic_xstr ).
  l_graphic_conv = graphic_size.
  l_graphic_offs = 0.

  WHILE l_graphic_conv > 255.
    graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
    APPEND graphic_table.
    l_graphic_offs = l_graphic_offs + 255.
    l_graphic_conv = l_graphic_conv - 255.
  ENDWHILE.
  graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).

  APPEND graphic_table.

  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type     = 'IMAGE'
      subtype  = 'X-UNKNOWN'
      size     = graphic_size
      lifetime = 'T'
    TABLES
      data     = graphic_table
    CHANGING
      url      = url.

  CALL METHOD picture->load_picture_from_url
    EXPORTING
      url = url.
  CALL METHOD picture->set_display_mode
    EXPORTING
      display_mode = picture->display_mode_fit_center.

Read only

0 Likes
728

Container name are different..

Read only

Former Member
0 Likes
728
CALL METHOD cl_gui_cfw=>flush. "Second Container Coding

  CREATE OBJECT:
  container EXPORTING container_name = 'PICTURE_CONTAINER2',
  picture EXPORTING parent = container.

  CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
    EXPORTING
      p_object       = 'GRAPHICS'
      p_name         = 'SNAK LOGO'
      p_id           = 'BMAP'
      p_btype        = 'BCOL'
    RECEIVING
      p_bmp          = l_graphic_xstr
  EXCEPTIONS
    NOT_FOUND      = 1
    INTERNAL_ERROR = 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.

  graphic_size = XSTRLEN( l_graphic_xstr ).
  l_graphic_conv = graphic_size.
  l_graphic_offs = 0.

  WHILE l_graphic_conv > 255.
    graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
    APPEND graphic_table.
    l_graphic_offs = l_graphic_offs + 255.
    l_graphic_conv = l_graphic_conv - 255.
  ENDWHILE.
  graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).

  APPEND graphic_table.

  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type     = 'IMAGE'
      subtype  = 'X-UNKNOWN'
      size     = graphic_size
      lifetime = 'T'
    TABLES
      data     = graphic_table
    CHANGING
      url      = url.

  CALL METHOD picture->load_picture_from_url
    EXPORTING
      url = url.
  CALL METHOD picture->set_display_mode
    EXPORTING
      display_mode = picture->display_mode_fit_center.