The issue is resolved. In create stream method I required to convert the xstring which I was getting form the application to Base64 and then decode it.
Below is chunk of code.
-
- DATA lv_filedata TYPE xstring.
- DATA lv_string TYPE string.
- lv_filedata = is_media_resource-value.
- DATA: lo_conv_x2c TYPE REF TO cl_abap_conv_in_ce.
- lo_conv_x2c = cl_abap_conv_in_ce=>create( ).
-
- lo_conv_x2c->convert( EXPORTING input = lv_filedata
- IMPORTING data = lv_string ).
-
- CALL FUNCTION 'SSFC_BASE64_DECODE'
- EXPORTING
- b64data = lv_string
- * B64LENG =
- * B_CHECK =
- IMPORTING
- bindata = ls_photo-content
- * EXCEPTIONS
- * SSF_KRN_ERROR = 1
- * SSF_KRN_NOOP = 2
- * SSF_KRN_NOMEMORY = 3
- * SSF_KRN_OPINV = 4
- * SSF_KRN_INPUT_DATA_ERROR = 5
- * SSF_KRN_INVALID_PAR = 6
- * SSF_KRN_INVALID_PARLEN = 7
- * OTHERS = 8
- .
- IF sy-subrc <> 0.
- * Implement suitable error handling here
- ENDIF.
thanks.
Ishtiyaq Ahmed