Skip to Content
0
Jul 14, 2020 at 02:16 PM

DP_CREATE_URL from application server cropped image

104 Views Last edit Jul 14, 2020 at 02:18 PM 2 rev

hello Folks i'm having an issue with DP_CREATE_URL loading a jpg in a container. the image is cropped and i can't manage to understand how have the full image.

here is my piece of code

TYPES pict_line(256) TYPE x.
  DATA: lt_pict_tab  TYPE TABLE OF pict_line,
         wa_pict_line TYPE pict_line,
         len          TYPE i,
         lv_size TYPE i.

  DESCRIBE FIELD wa_pict_line LENGTH len IN BYTE MODE.
  OPEN DATASET i_url FOR INPUT IN BINARY MODE.
  IF sy-subrc = 0.
    DO.
      READ DATASET i_url INTO wa_pict_line MAXIMUM LENGTH len.
      IF sy-subrc = 0.
        lv_size =  XSTRLEN( wa_pict_line ) + lv_size.
        APPEND wa_pict_line TO lt_pict_tab.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
  ENDIF.
  CLOSE DATASET i_url.
  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type                       = 'IMAGE'
      subtype                    = cndp_sap_subtype_unknown
      size                       = lv_size
*   DATE                       =
*   TIME                       =
*   DESCRIPTION                =
*   LIFETIME                   =
*   CACHEABLE                  =
*   SEND_DATA_AS_STRING        =
    TABLES
      data                       = lt_pict_tab
    CHANGING
      url                        = lv_url
 EXCEPTIONS
   dp_invalid_parameter       = 1
   dp_error_put_table         = 2
   dp_error_general           = 3
   OTHERS                     = 4.

then i just use

CALL METHOD lo_picture->load_picture_from_url_async
EXPORTING
url = lv_url.

what do i miss please?

Is it a size issue?

Thanx in advance