cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Signature Pad Image to SAP

Former Member
0 Kudos

Hi gurus,

I am trying to achieve the following:

  1. 1) Create a signature pad.

I have successfully designed the page to capture the signature as image.

  1. 2) Upload the image created on the signature pad to SAP

Need help in this

When I am using the simple image upload through fileuploader control ... which opens up a file selection pop-up window when I click "Browse", then I am able to successfully upload this image in SAP through my Odata.

Could you please help me in getting the image saved to SAP when I use the signature pad.

regards,

Ishtiyaq

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

DK007
Active Participant
0 Kudos

Posted my answer here: