cancel
Showing results for 
Search instead for 
Did you mean: 

How to merge attached images in xstring for Adobe Forms?

bobi04
Explorer
0 Kudos

Hello,

I'm developing a Adobe form in which I have a Image Field which I want to show images ( 1 to 5 images ) previously attached to the QM notification. I am able to do it but the point is when I attach more than 1 image it just shows the last attached image.

This is my code which is in a loop in the images, there is not errors. I think that the problem is that by concatenating the xstrings of each images doesn't work and it just shows the last image.

CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
    EXPORTING
      input_length = lv_input_len
    IMPORTING
      buffer       = lv_buffer
    TABLES
      binary_tab   = lt_hex_cont
    EXCEPTIONS
      failed       = 1
      OTHERS       = 2.

  IF sy-subrc <> 0.
    CONTINUE.
  ELSE.
    FIELD-SYMBOLS: <lv_img> TYPE xstring.
    READ TABLE lt_ref INTO ls_ref WITH KEY instid_a = <ls_srgbtbrel>-instid_a.
    IF sy-subrc = 0.
      CONCATENATE ls_ref-mncod '_IMG' INTO lv_ref.
      ASSIGN (lv_ref) TO <lv_img>.
      IF sy-subrc = 0.
*        <lv_img> = lv_buffer.
        CONCATENATE <lv_img> lv_buffer INTO <lv_img> IN BYTE MODE.
      ENDIF.
    ENDIF.
  ENDIF.<br>

Any ideas?

Regards.

View Entire Topic
Tomas_Buryanek
Active Contributor

You cannot simply concatenate binary data (xstring) of the files to "merge them".

Simplest and probably most correct solution is use five image fields in Adobe form. And map each to separate image data (xstring).

If you want to merge images, then you would need some complex image processing library (depending on image format - BMP, JPEG, PNG...). That would be probably something outside of ABAP server.

bobi04
Explorer

Thank you for your quick answer!