Skip to Content

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.


To report this post you need to login first.

14 Comments

You must be Logged on to comment or reply to a post.

  1. Stephan Molden

    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

    (0) 
    1. Umang Mathur 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… 🙂

      (0) 
  2. Roman Richter

    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

    (0) 
    1. Umang Mathur 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 🙂

      (0) 
      1. Roman Richter

        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

        (0) 
          1. Roman Richter

            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

            (0) 
            1. Umang Mathur 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

              (0) 
  3. Arpit Varma

    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.

    (0) 
  4. Refilwe Moselane

    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

    (0) 
    1. 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

      (0) 
  5. Sagar Chouhan

    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,

    (0) 
  6. 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.

    (0) 

Leave a Reply