Skip to Content
Author's profile photo Former Member

Digital Signature in Adobe Forms

This blog will help in creating a digitally signed Adobe Form.

With digital signatures getting a nod in many countries, a lot of organizations are looking up to digital signatures to save the time spent on a redundant task such as, signing the hard copy. By using digital signatures, a soft copy can be digitally signed and secured.

I have used, ABAP to design the form. The reason of using SFP transaction is, easier integration of form and interface with various other platforms, that is not easily ans seamlessly possible with WD JAVA.

The following steps need to be verified by the basis team for digital signature to be active in the system.

1. Uploading a digital signature in the system

2. Create connection between ADS (Adobe Document Services) and R/3 system – It is recommended to name the connection, “ADS_HTTPS”

The following steps will create an Adobe for with digital signature.

Go to transaction SFP

    SFP.JPG

    Give the interface, you want to design, a name. The interface is that part, in which we write the logic for pulling data from the tables. Click on create.

           Interface.JPG                   

Maintain the data to be used in the form under Global Data. Both input and output elements can be used here. We need to define the name and the type.

Global Data.JPG 

Go to Code initialization. Here we write the logic of extracting the data from the tables. Here we need to define the Input & Output parameters. The Input / Output parameters are the ones, defined in Global Data. Here we don’t need to define the Type.

Note: The name used in The Input / Output parameters should be the same that is used in Global Data.

Input Output.JPG

Once the code is written in the interface, save it and go back to Form (Transaction SFP)

Give the form a name and create the form.

In the form properties, provide the name of the interface which the form will call.

   Form.JPG

In the context, bind the global data with the form context. This can be done by simple drag and drop.

Binding.JPG 

Click on layout, to design the form.

Design the form and bind the UIs with the data available in the data view.

After form design, insert the signature field in the form.

Insert Signature.JPG

Once the form has been designed and the digital signature field has been incorporated in the form, the code for digitally signing the form will be written in the RFC that will call the form.

We’ll have to define the HTTP Connection, the position of the Digital Signature UI and the name of the digital signature in the form.

Following is the code that we need to write to define the above mentioned fields.

P_DEST          TYPE RFCDEST VALUE ‘ADS_HTTPS’, // The name of connection
S_FIELD
(100)    TYPE C VALUE ‘data.#subform[0].END.SIGNATURE.SignatureField1’, // The position of digital signature

FORM_NAME = ‘ZMM_V2V_RATE’. // The form RFC needs to call
S_ALSIGN = ‘Umang_Test’// Name of Digital Signature

Following is the code that needs to be written for digitally signing the form.

FORM_NAME = ‘ZMM_V2V_RATE’.
S_ALSIGN
= ‘Umang_Test’.

GS_FPOUTPARAMSNODIALOG = ‘X’.
GS_FPDOCPARAMS
FILLABLE = ‘X’.
CALL FUNCTION ‘FP_JOB_OPEN’
CHANGING
IE_OUTPUTPARAMS
= GS_FPOUTPARAMS
EXCEPTIONS
CANCEL         
= 1
USAGE_ERROR   
= 2
SYSTEM_ERROR   
= 3
INTERNAL_ERROR 
= 4
OTHERS          = 5.
IF SYSUBRC <> 0.
ENDIF.
TRY.
CALL FUNCTION ‘FP_FUNCTION_MODULE_NAME’
EXPORTING
I_NAME   
= FORM_NAME
IMPORTING
E_FUNCNAME
= GV_FMNAME.
CATCH CX_ROOT INTO LV_W_CX_ROOT.
LV_MESG
= LV_W_CX_ROOT->GET_TEXT( ).
ENDTRY.

CLEAR: FORMOUTPUT.

CALL METHOD L_PDFOBJ->SET_DOCUMENT
EXPORTING
PDFDATA
= FORMOUTPUTPDF.


CALL METHOD L_PDFOBJ->SET_SIGNATURE
EXPORTING
KEYNAME 
= S_ALSIGN
FIELDNAME
= S_FIELD.

CLEAR: L_OUT.
CALL METHOD L_PDFOBJ->EXECUTE( ).
L_PDFOBJ
->SET_USAGERIGHTS( DEFAULT_RIGHTS = C_FALSE ).
CALL METHOD L_PDFOBJ->GET_DOCUMENT
IMPORTING
PDFDATA
= L_OUT.

CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’
EXPORTING
BUFFER                = L_OUT
*   APPEND_TO_TABLE       = ‘ ‘
* IMPORTING
*   OUTPUT_LENGTH         =
TABLES
BINARY_TAB           
= BINARY_CONTENT.

*  ENDLOOP.

CALL FUNCTION ‘FP_JOB_CLOSE’
EXCEPTIONS
USAGE_ERROR   
= 1
SYSTEM_ERROR 
= 2
INTERNAL_ERROR
= 3
OTHERS        = 4.

The above mentioned code will digitally sign the document.


Assigned Tags

      21 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Umang,

      thanks for that great post, that's exactly what I'm looking for.

      Could you please tell me what kind of object l_pdfobj is?

      Unfortunatly data declaration is missing so I can not see it.

      Regards

      Stephan

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Stepan,

                       Thanks for liking the post. You can declare it as follows:

      L_PDFOBJ        TYPE REF TO IF_FP_PDF_OBJECT

      Hope it helps... ūüôā

      Author's profile photo Former Member
      Former Member

      Hi Umang,

      this is only for digital signatures, right? So the signature needs to be in the system first.

      I am asking because we want to use pads where any person can put his handwritten signature and this signature is directly shown in the pdf.

      This process is thought for service technicians out in the field. The technician works e.g. 2 hours at the customer and wants the customer to sign those 2 hours.

      The process after this step is not yet defined. There are some possibilites like saving this pdf with the signature to the CRM activity as an attachment.

      Do you have any experience with this? Or do you have any other thoughts to this?

      Best regards,

      Roman

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Dear Roman,

                          I am not yet clear with you requirement. What I can understand is that you will have handwritten signatures scanned and they will be used as your signature ?

      If this is what you wanted to infer, one process could be, an application, which would accept the signature from the pad in the form of a image. This image can be binded to the image UI of the adobe form. Generally the images are saved in R3 and can be accessed as a URL to the adobe form.

      I hope it helps you.

      If you want to know more about dynamic images in Adobe Forms, please let me know.

      Regards

      Umang ūüôā

      Author's profile photo Former Member
      Former Member

      Hello Umang,

      thank you for your response. In the meantime I was able to take a step forward. I did get a wacom signature pad (stu-300) and some Software plug-in for Adobe Reader.

      I created a signature field via Adobe livecycle designer in my interactive form. Right now I have the Problem that the wacom pad is not installed correctly. But for this I just got some Driver.

      I Keep you updated.

      By the way. I am creating the form for CRM not for ERP. Just for your info.

      BR, Roman

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Roman,

                       This seems to be an interesting scenario. Please keep your updates posted.

      Regards

      Umang

      Author's profile photo Former Member
      Former Member

      Hello Umang,

      I just wanted to let you know that the Driver of the pad was the last Thing missing. So now we are able to sign the document.

      I wanted to insert a screenshot but I think I don't have the rights in this Forum to do so.

      BR, Roman

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      That's great. Hope this solves your issue. I would encourage you to create a blog of the work you have done, since this is a unique requirement and would surely help people.

      Regards

      Umang

      Author's profile photo Former Member
      Former Member

      Hi Umang,

      This was wonderful post.

      I am doing one Digital Signature in Adobe Form(Not interactive) but while setting signature I am getting below error. Any idea if I have passed wrong parameters or something

      1. com.adobe.ProcessingException: Signature failure error detected while certifying a PDF for credential alias: DocumentCertification

      Processing exception during a "Certify" operation.#Request start time: Mon May 26 16:16:45 BST 2014#com.adobe.ProcessingException: Signature failure error detected while certifying a PDF for credential alias: DocumentCertification##Specific error informat

      Thank You.

      Regards,

      Arpit Varma.

      Author's profile photo Former Member
      Former Member

      Hi Umang,

      hope all is well with you.


      I'm currently busy with a development to attached the digital signature however my issues

      at the moment is that when a form has more than one pages the signature is only attached on the first page and the rest of the pages have a RED tick at the place where the signature must be attached. Below is the print screen of how the signatures are attached on the form.


      What am I missing?


      Your feedback will be highly appreciated.


      Regards,

      Refilwe

      DigitialSignature.png

      Author's profile photo Saurabh Jog
      Saurabh Jog

      Hi Refilwe,

      We have a similar requirement where we need to attach a digital signature in a PDF and then mail the PDF as an attachment. For this our client is using a third party key for the digital signature. Only when this dongle is connected to the system, the user is able to his digital signature in the documents. So we are looking for a way to retrieve this digital signature so that we can programatically embed it into the PDF.


      Any inputs are appreciated.


      Thanks and Regards,

      Saurabh

      Author's profile photo Former Member
      Former Member

      Hi Umang/SAP experts,

      Can you please tell me how we will store digital signature in SAP systems.

      Our requirement is to add a digital signature in Invoice printing(non-interactive) server side signing . I have done all the steps as mentioned, just not sure how we have uploaded 'Umang_test'. digital signature in SAP system.

      Can you please spare time to put some lights on in .Many thanks !!

      Regards,

      Author's profile photo Arunkumar Chandrasekar
      Arunkumar Chandrasekar

      Hi,

      Have you found solution for this. I am also struct in the same place.

      Could you pls help me on this.

      Thanks,

      Arun.

      Author's profile photo Kapil Thuthuku
      Kapil Thuthuku

      Hi Umang,

      Thanks for the document. Need your help in following.
      We are using pfx file. How to upload it into system.
      Also what is the keyname and fieldname in set_signature method.

      Thanks,
      Kapil.

      Author's profile photo John K
      John K

      Hi All,

      I'm new to Adobe form in SAP.

      By using above code I'm not able to do the signature. Hence can any one brief about the above coding ? Go through the below link for understanding of my doubt.

       

      https://answers.sap.com/questions/196898/server-side-digital-signature-sap-adobe-form.html

       

      Thanks & Regards,

      John K

       

      Author's profile photo Digvijay Inamdar
      Digvijay Inamdar

      Hi Umang,

      Can you please guide me on below error for digital signature,

      I'm stuck with this error,

      ERROR CODE : 100,101
      ERROR MESSAGE : SOAP Runtime Exception: CSoapExceptionTransport : HTTP receive failed with exception communication_failure
      SOAP Framework error: SOAP Runtime Exception: CSoapExceptionTransport : HTTP receive failed with exception communication_failure (100,101).

       

       

      if possible please share documents also...‚ėļ

      best regards,

      Digvijay

      Author's profile photo ANURODH BORKAR
      ANURODH BORKAR

      Hi,

      In the code snipet data declaration missing like L_PDFOBJ, FORMOUTPUT, L_OUT, so please can you send complete code snipet with data declaration.

      Regards,

      Anurodh

      Author's profile photo Ephideimaya Pariat
      Ephideimaya Pariat

      Hi SAP Experts,

       

      I have a requirement where the digital signature signed by a driver from a fiori APP, is sent to SAP system as an attachment in FPM (NWBC). The image coming from UI5 through Odata should be mapped to ADOBE FORM where it gets printed there as a PDF , and this PDF is sent as an attachment to SAP Transportation Management System (NWBC screen).

      The problem i have here i am unable to map the signature ( PNG Converted to Base64) from the Odata to adobe form field.

       

      Can someone help me in this issue ??

      thanks

      Ephi

      Author's profile photo Shaik Jani Basha G
      Shaik Jani Basha G

      Hello Umang,

      I have seen your posts.Appreciatable.

      Kindly help in this case whike i am trying fetch signature using your code giving one error.

       

      com.adobe.ProcessingException: Signature failure error detected while certifying a PDF for credential alias: DocumentCertification

      Processing exception during a ‚ÄúCertify‚ÄĚ operation.#Request start time: Mon May 26 16:16:45 BST 2014#com.adobe.ProcessingException: Signature failure error detected while certifying a PDF for credential alias: DocumentCertification##Specific error informat

      Kindly help me to resolve this.

       

      Thnak you,

       

      Jani Shaik.

      Author's profile photo SHUBhAM TAKLIKAR
      SHUBhAM TAKLIKAR

      Hi, Umage

      I am trying to print digital signature automatically .i use same code as u written in blog but unable to get signature in adobe form pdf. plz help me on this issue.

      Data : S_FIELD(100) TYPE C VALUE 'data.#subform[0].END.SIGNATURE.SignatureField1'.
      S_ALSIGN = 'shubham'. " this is my certificate alias name ".

        l_fp = cl_fp=>get_reference( ).

      try.
      *   create PDF Object
      l_pdfobj = l_fp->create_pdf_object( connection = CONV #('ADS') ).
      CALL METHOD L_PDFOBJ->SET_DOCUMENT
      EXPORTING
      PDFDATA = fp_formoutput-pdf.

      CALL METHOD l_pdfobj->set_template
      EXPORTING
      xftdata  = fp_formoutput-pdf
      FILLABLE = 'X'.

      CALL METHOD L_PDFOBJ->SET_SIGNATURE
      EXPORTING
      KEYNAME  = S_ALSIGN
      FIELDNAME = S_FIELD.

      CLEAR: L_OUT.
      TRY.

      CALL METHOD l_pdfobj->execute( ).

      CATCH cx_fp_runtime_internal INTO DATA(lc_interanl).
      MESSAGE lc_interanl->get_longtext( ) TYPE 'I'.
      CATCH cx_fp_runtime_system INTO DATA(lc_runtime).
      *    MESSAGE lc_runtime->get_longtext( ) TYPE 'I'.
      CATCH cx_fp_runtime_usage INTO DATA(lc_usage).
      MESSAGE lc_usage->get_longtext( ) TYPE 'I'.
      ENDTRY.
      L_PDFOBJ->SET_USAGERIGHTS( DEFAULT_RIGHTS = ABAP_FALSE ).
      CALL METHOD L_PDFOBJ->GET_DOCUMENT
      IMPORTING
      PDFDATA = L_OUT.
      endtry.

      Author's profile photo Mohamed Ismail. A
      Mohamed Ismail. A

      Hi Experts,

      I too have the same requirement to introduce Digital Signature in Invoice and mailed to customer.

      My question is, SAP says we need Adobe Interactive form license to use Digtial Signature.

      Is it possible and compliance with respect to license audit if we use Adobe static form for Digital signature ?

       

      Thanks in advance

      Ismail

      MEIA@NOVOZYMES.COM