Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2069

Re: Saving Signature Pad Image to SAP

$
0
0

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.

 

 

 

  1. // Below code is part of Create Stream method. 
  2.          DATA lv_filedata TYPE xstring. 
  3.          DATA lv_string TYPE string. 
  4.          lv_filedata = is_media_resource-value. 
  5.          DATA: lo_conv_x2c TYPE REF TO cl_abap_conv_in_ce. 
  6.          lo_conv_x2c = cl_abap_conv_in_ce=>create( ). 
  7.   // Convert from Xstring to String ( String will be in base64) 
  8.        lo_conv_x2c->convert( EXPORTING input = lv_filedata 
  9.                                IMPORTING data  = lv_string ). 
  10. // Decode the Base64 
  11.          CALL FUNCTION 'SSFC_BASE64_DECODE' 
  12.            EXPORTING 
  13.              b64data = lv_string 
  14. *           B64LENG = 
  15. *           B_CHECK = 
  16.            IMPORTING 
  17.              bindata = ls_photo-content 
  18. *        EXCEPTIONS 
  19. *           SSF_KRN_ERROR                  = 1 
  20. *           SSF_KRN_NOOP                   = 2 
  21. *           SSF_KRN_NOMEMORY               = 3 
  22. *           SSF_KRN_OPINV                  = 4 
  23. *           SSF_KRN_INPUT_DATA_ERROR       = 5 
  24. *           SSF_KRN_INVALID_PAR            = 6 
  25. *           SSF_KRN_INVALID_PARLEN         = 7 
  26. *           OTHERS  = 8 
  27.            . 
  28.          IF sy-subrc <> 0
  29. * Implement suitable error handling here 
  30.          ENDIF. 

thanks.

Ishtiyaq Ahmed


Viewing all articles
Browse latest Browse all 2069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>