Skip to Content
-2

"MIME" must be a character-type data object (data type C, N, D, T, or STRING).

Hi,

After Unicode conversion there is an error for:

content_length = STRLEN( mime ).

"MIME" must be a character-type data object (data type C, N, D, T, or STRING).

This is because mime is type w3mime i.e. RAW 255.

I have solved this by using the code below, and it seems to work, but I wanted to find out here if there is a better way of doing this firstly, and secondly if this solution is in fact correct? It appears to work, however i am not certain.

CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = mime
IMPORTING
ex_container = ls_str
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
content_length = strlen( ls_str ). "the ls_str is type string.

All help greatly appreciated.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • May 03 at 06:14 PM

    XSTRLEN instead of STRLEN:

    DATA mime TYPE w3mime.
    ...
    content_length = XSTRLEN( mime-line ).

    But as mime is a X of length 255, content_length will always be 255.

    So you must take the length from the "source".

    Add comment
    10|10000 characters needed characters exceeded