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

Regarding display image

Former Member
0 Likes
453

Dear all,

i am using following code to display image through MIME repository. but i want to use dynamic image display with same frame.

please help me for the same.


data: lr_mime_rep type ref to if_mr_api.
data: lv_url type char255.
data: lv_content  type xstring.
data: lv_repid type sy-repid.
data: lt_data type standard table of x255.
data: lo_docking type ref to cl_gui_docking_container.
data: lo_picture type ref to cl_gui_picture.
data: p_path1 type string.

parameters : p_path type string default 'sap/public/img/test.jpg'.
*parameters: p_check.

at selection-screen output.

CREATE OBJECT LO_DOCKING
    EXPORTING
      REPID     = LV_REPID
      DYNNR     = SY-DYNNR
      SIDE      = LO_DOCKING->DOCK_AT_LEFT
      EXTENSION = 50.
 
  CREATE OBJECT LO_PICTURE
    EXPORTING
      PARENT = LO_DOCKING.

  LR_MIME_REP = CL_MIME_REPOSITORY_API=>IF_MR_API~GET_API( ).

  LR_MIME_REP->GET(
             EXPORTING
                  I_URL      = P_PATH
             IMPORTING
                   E_CONTENT = LV_CONTENT
             EXCEPTIONS
                   NOT_FOUND = 3 ).

  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      BUFFER     = LV_CONTENT
    TABLES
      BINARY_TAB = LT_DATA.

  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      TYPE    = 'IMAGE'
      SUBTYPE = 'JPG'
    TABLES
      DATA    = LT_DATA
    CHANGING
      URL     = LV_URL.
  LO_PICTURE->LOAD_PICTURE_FROM_URL_ASYNC( LV_URL ).

1 REPLY 1
Read only

Former Member
0 Likes
397

solved