You are on page 1of 48

Digital signature in Adobe forms

By Phani Diwakar Marepalli, YASH Technologies

A digital signature is a security mechanism for protecting digital data. The digital signature does
the same function for processing digital data as hand written signature does for the paper based
documents.
Step1: SFP is the transaction to create adobe form. Provide the interface name and click on create
button.

Provide the description and save it.

Activate the interface and come back to initial screen of form builder.

Step2: Provide the form name and click on create button.

Provide the interface name and form description.


Step3: Drag and drop the system field date to context tab.
Step4: Go to layout tab,

Drag the date field to layout editor.

Drag the signature field from library to layout editor as shown.

Activate the form.

Step5: Execute the form.

Sign icon (Marked as Yellow color) as shown in tool bar is in disable mode. After the signature has been
filled this icon becomes enable mode.

Step6: Steps to create digital signature

Click on signature field.

The following screen appears.


Now select the radio button ‘A new digital ID I want to create now’ and click on next button.
Clicking on next button, the following screen appears as shown
below.

Click here to continue...

Digital signature in Adobe forms


...Previous

Select the radio button ‘windows certification store’

The following Add Digital ID screen will appear when click on Next button and fill the related
information.
Now click on finish button.

Click on sign button as shown below.

Now the created signature will appear on the signatory field as shown below.
Click on signature field, you will get the pop up box as shown below.

If you want to check the signature properties then click on signature properties button.

If the signature is valid then you will get 'Signed and all signatures are valid' message appear at the
top of the window.

Here we can also change the field entries even after the signature field has been filled. When saving
the form after we modified the any of the field entries in the form, you will get the following message at
the top ‘Signed and all signatures are valid, but with unsigned changes after the last signature’.
Click on signature panel at the top right side corner (Shown on above picture), there you can find the
log as shown below.

When you click on highlighted statement under Form Fields Filled In, it would show the modified value
of the field. And also you can check the value before modification in the Click to view this version
under signature details.

Click here to continue...

Digital signature in Adobe forms


...Previous

When selected New PKCS#12 digital ID file:


Click on Next button.

Provide the required information and press Next button as shown below.
We get the following screen. It asks for password. Provide the password and press finish button.
We get the following screen.

After providing the password only you can able to sign in. Suppose if you press the sign button without
giving password, it asks for password saying that ‘A password is required to use this digital ID’.
Click here to continue...

Digital signature in Adobe forms


...Previous

Now press the sign button. The signature would be appeared in signature field.

In the above two cases, we can able to change the field entries after the signature field is filled in the
form. But, we can also have an option to avoid / restrict making changes to the content of the fields
(‘Date’ in this case) once the signature field is filled.

Now go to library tab-Web Dynpro native. Drag and drop the signature-sign and lock to layout
editor.
Save and activate the form.

Execute the form.

Click on signature&lock field. The following screen appears. Select the existing id or create new id as
shown below.
Select ID Phani

Click on sign button.


Now the date field becomes locked. We can not modify the value. In this way we can lock the fields
after the signature has been done.

sap digital signature ABAP reports (


ABAP programs )
Our SmartSearch algorithm sorts through tens of thousands of SAP tcodes, tables and other
objects and helps you in quickly finding any SAP tcode or table. Stop wasting your time reading
through forum posts, become a premium member today and get instant access!

{:value=>true} Search Abap reports

Abap report Description Functional Area

Mini-Online Store (digital Basis - Secure Store


SSFSDEMO
signature) and Forward

Cross Application -
RCSIGSEA Find digital signatures
Digital Signature

Uploading PSE Files for digital


SIPT_SAFT_STORE_PSE FI - Localization
signature

Portugal: digital signature


SIPT_INTERVAL_SIGN_FI Generation for Numbering Intervals FI - Localization
in FI

Basis - Secure Store


SSF01 SSF Test Program
and Forward

HINCF160 Print program for form 16 Payroll - India

Test Program for Destination Basis - Forms


FP_CHECK_DESTINATION_SERVICE
Service of Templates Processing
Test Program: Server-Side Basis - Forms
FP_PDF_TEST_07
signature Processing

SAPLQSS6 Dokumentzugriffe im QM -

LIQS0F15 PM Notification Status Management -

Cross Application -
DSIG_BOOKING_EX Report DSIG_BOOKING_EX
Digital Signature

FI - Information
RFSOPO00 General Ledger Line Items
System

Test Program: Get signatures of Basis - Forms


FP_PDF_TEST_12
PDF File Processing

Uploading TIFF Files to SAPscript


RSTXLDMC Basis - SAPscript
Texts

Test Program: Version Information Basis - Forms


FP_PDF_TEST_00
(for Analysis Only) Processing

Program CRM - E-Mail


CRM_ERMS_MAILFORMS
CRM_ERMS_MAILFORMS Integration

WSS_SETUP Basis - Security

BW - Business
UPP_LAYOUT_CHECKIN Program UPP_LAYOUT_CHECKIN Planning and
Simulation

Personnel Mgmt -
Creation of digital Personnel File
RPASRCREATEDPF HR Administrative
Using Personnel No. or Ref. No.
Services

PDF stands for Portable Document Format.


Definition:
It is a Universal file format developed by Adobe that preserves all the fonts, formatting, graphics, and
color of any source document,
regardless of the application and platform used to create it. PDF files are compact and can be shared,
viewed, navigated, and printed exactly as intended by anyone with Adobe Reader software.
Why PDF Forms?
1.It's an open standard
2.An Ideal document format
3.It provides security options like -
a.Digital signature validation
b.Disable save option
c.Disable select option
d.Disable print option.
Benefits Adobe Provides for SAP -
1.Use of PDF format ensures that the appearance of the form remains same, irrespective of the
environment it is being used in.
2.It helps in optimization of business process by automating the creation of data for SAP systems.
Thus saving time and costs (in case of interactive forms).
3.Integrate business processes with more users.
4.Overcome limitations of paper based forms like -manual data entry, error prone and easily
outdated, traceability, high costs in production and storage.
Use of PDF Forms
1.PDF-based forms can be used for the following:
2.Order confirmations
3.Invoices
4.Account statements
5.Checks
6.Salary statements
7.Delivery notes
8.Customs forms
9.Industry-specific forms, such as quality forms in the
automotive Industry

Creating PDF:
Using transaction 'SFP' to go to Form Builder or through SE80 (to create an interface and then the
form).
Before creating a PDF, you need to have an interface which contains all the fields which you will be
using in the form.
Hence before creating a form you need to create an Interface and assign this interface in the pop-up,
which comes while you create the respective form.
SFP stands for SAP Forms Process.
Structure of PDF Form:

The steps involved in developing PDF are


Interface - parameter defining.
A form interface that sends the application data to the form.
Interface can be reached through SE80 or SFP transaction. Interface in smart forms and PDF are
not compatible.
If you click in the check box - 'Smart Form compatible interface' at the properties tab, the print
program for Smart Forms can be used for PDF also.
In PDF interface you use only TYPE statements. Never check the 'pass by value' checkbox as it will
affect the performance, unless required.
If it's a table, the entire table will be passed.Exceptions can be created and raised in the Interface
level.
PDF cannot fetch currency information from the data dictionary. These details have to be provided at
the currency fields at the Interface stage itself.
Context - mapping parameters from interface.
A form context that contains the form logic. This logic controls the dynamic formatting of the form. In
the context (also known as the form context), you
specify which data is copied from the interface to the form.
Layout - form designing.
A layout in which you define how the output data is positioned, its appearance in graphics, and the
design of the pages.

Form interfaces and form contexts with layout are called as form objects. These are different
transportable object types. The same interface can be used
by multiple forms (like say in purchasing order, scheduling forms etc).

Enter transaction SFP and you go to the screen shown in the next Figure.

Creating a Form Object


Creating a Form Object in the Repository Browser
You are in the Repository Browser of the ABAP Workbench.
Select a package.
To create a form interface, proceed as follows:
1.In the context menu of the package, choose
Create -> Form Object -> Interface.
2.Enter the name of the interface in the Create Interface dialog box.
To create a form with a context and layout, proceed as follows:
1.In the context menu of the package, choose
Create -> Form Object -> Form.
2.Enter the name of the form in the Create Form dialog box.
3.Enter the name of the interface that you want the form to use.
4.Choose Save.
5.The Create Object Directory Entry dialog box appears.
6.Enter your data and save the object.
Page concept and elements of Form
Definition
You specify the page layout for a form, and determine the order of the pages that have differing
structures. Texts, data, tables, and various other types of objects
can be displayed in the output range of a form page.
The following different page types can be used to structure a form:
1.Master pages
2.Body pages
You can position various elements on these pages:
1.Standard objects
a.)Static objects such as texts, graphics, squares and rectangles, circles, lines.
b.)Dynamic objects such as buttons, checkboxes, date/time fields, drop-down etc.
2.User-defined objects
3.Barcodes.
Form Builder

Create the interface.


Click in the corresponding check box, enter the name and create the interface.
Enter the description and save it as a local object. In the end, you get the screen

below.
Form Interface:
When you click the field 'Import', you get the above screen. Here you can add ( ) the fields we need
in the form. Here I have added the field 'EMPLOYEE_NAME' and
activated the interface
Note that the parameter, '1BCDWB/DOCPARAMS' is common for all interfaces. It comes by default
and this has a type of SFPDOCPARAMS. This parameter is used
to pass the country key, language and other related details while calling the form through the
standard function module.

When you double-click Export, you see the standard parameter /1BCDWB/FORMOUTPUT of the
generated function module. You cannot
change this parameter.
You use this parameter in your application program, to make the generated form available as a PDF
for further processing, for example.

As we have activated the interface, now we can create a form and assign this interface to the form.
For that, return back and create the form as in fig below.
Global Definitions:
Use
Global definitions belong to the interface in the Form Builder. Here, you have the option of defining
your own fields to be used anywhere in the form. You can initialize
global data before you start to process the form, for example, to convert selected application data.
Features
Global Data
Here, you define any data needed by the form, but which has not been provided by the form
interface (for example, to display totals).
Types
Here, you create data types as free ABAP code, if the ABAP Dictionary does not provide a type.
Field Symbols
You can use field symbols as pointers when you extract data from internal tables.
Initialization:
Use
You can initialize global data before you start to process the form, for example, to convert selected
application data.
Prerequisites
You have defined global data.
Features
You use the ABAP Editor to write the program code (Code Initialization) that is executed before the
form is processed. You can include subroutines (Form Routines)
when you do this.
Specifying a Currency or Quantity Reference:
Use
In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of
these fields, the system can then insert the relevant currency or
unit.
If the value field is in the same table as the corresponding currency or quantity field, the system
recognizes the reference automatically, and formats the value field
according to the currency or unit in the assigned field.
If the value field is in a different table from the currency or quantity field, the system cannot
recognize this reference automatically.

Creating the Form


Assigning Interface
In the dialog box that pop up, assign the interface, which you need to use (the one that you have
already created and activated) as in fig below.

Form Builder: Schematic View.


The graphic above , shows the structure of the screen that appears when you select the Context tab
in the Form Builder. The interface on which the form is based is displayed, but cannot be changed
here.
Once you have created the form (save it as a local object), you get the screen above, which will have
the assigned interface at the left and the context at the right.

Including the fields..


Now for the form to access the field, we need to include the required field in the context of the form.
This is done by dragging the required fields and putting it in the context level. (Here for the
demonstration purpose, I have created only a single parameter and it has been included in the
context by dragging it from the interface level)
Properties in Context
Use
Properties describe the content or meaning of a node.
Activities
1.Double-click the node to open the properties screen.
2.You can now change general properties such as the name or description of the node, or set the
node as Active or Inactive.
3.Only active nodes are sent to the layout in the Form Builder, and used in the form output.
4.Depending on the chosen node, the system also displays additional node-specific properties, as
well as the general properties. For an
explanation, see the description of the node.
5. As well as the properties, for some nodes you can also specify conditions for the form output.

Conditions

Use
1.You can define conditions for individual nodes, or for whole subhierarchies of the context.
2.A node, or all its subnodes, is then only processed if the related condition is met.
3.To select from two alternative subhierarchies in the form output, use the alternative node.

Prerequisites
A node exists for which you want to define conditions. This node must allow conditions to be defined.

Features
You can define conditions using logical relationships.
Layout

Once the required parameters are included in the context, you can now go to the layout to design the
form. Click in the tab 'Layout' and you get the screen below, which is basically the Adobe designer.

About the Layout Editor

1.You create the body and master pages for the form design in the Layout Editor.
2.You can also view and edit the form design and preview the form (the form that the user will work
with) in PDF.
3.The Layout Editor contains four tabs: Body Pages, Master Pages, XML Source, and PDF Preview.

Types of Form layout


Live Cycle Designer offers two types of form layout techniques for you to work with:
Static layout :
These forms have fixed layouts. When presented to the end user, the form retains its original layout,
regardless of the amount of data available to fill the form.
Dynamic layout :
A form with a dynamic layout is designed to expand or shrink according to the amount of data
available to fill it.
What's in a form design?
The following key components make up a form design:
1.Master pages
2.Body pages
3.Content areas
4.Subforms
5.Fields
6.Boilerplate objects
Master Pages
Every form design contains at least one master page that Live Cycle Designer creates automatically.
Master pages define the orientation and dimensions of body pages.
Master pages are responsible for formatting body pages.
Provide a background and layout format for more than one of the body pages in a form design.
Each master page is created with a default content area that covers the whole page.
Body pages
Body pages represent the pages of a form.
Each body page derives its page size and orientation from a master page.
Each body page is associated with the default master page that LiveCycle Designer creates.
You can choose which master page to assign to a body page.
Content areas
Content areas define where objects can be placed or laid down on body pages.
When you design a form, you cannot place an object on a body page unless it is inside the area
bounded by a content area.
You can add content areas to master pages only.
Sub Forms
Subforms are container objects that you can use to group form design objects including:
fields,address,images etc.
A subform provides anchoring, layout, and geometry management for objects.
You can also configure subform objects to be repeatable.
Field objects
In layout there are number of field objects that are capable of capturing, merging, and displaying
data like
1.Button
2.Check box
3.Date/time field
4.Drop-down list
5.Image field
6.Text field
7.List box
8.Numeric field

Boilerplate objects
Boilerplate objects are read-only objects that improve the aesthetic appeal of a form and may provide
context or assistance for users. They can be added to
body pages or master pages.
The following objects are boilerplate objects:
1.Circle
2.Image
3.Line
4.Rectangle
5.Text
About Palettes
If you are not seeing any palettes at either ends, then search them in the field 'Palettes'. (Fig Above)

Palettes provide easy access to the tools without cluttering your workspace. Palettes can include one
or more tabs, each containing common properties.
For example, all objects are stored in the Library palette. As you can see in the following figure, the
objects are further grouped into tabs.
You can arrange the palettes in the workspace to suit your work style. For example, you can hide the
rarely used palettes and move the frequently used ones
into one palette window.
Palettes continued..
The Data view palette contains the parameters and structures that we have defined in the context
level.
(Here the parameter - 'EMPLOYEE_NAME'). The hierarchy palette contains the flow with which we
have defined the fields in the layout. All the objects /
fields which you use in the layout design are reflected in the hierarchy. By default, the hierarchy
contains a master page and the body page. You place
the fields in the layout by dragging them from the Data view palette.
(refer the fig: below).
The properties of all objects in the layout are maintained in palettes - 'Layout', 'Border', 'object' and
'Accessibility'.
Designing of the form can be made, at your comfort level, by setting the scales and measurements in
the palette 'Drawing Aids'.

Hierarchy Palette
The Hierarchy palette is a graphical representation of the contents in the Body Pages and Master
Pages tabs. The palette also displays referenced objects
under the Referenced Objects node. A referenced object is an object that is only added to a form
when it is required.

Data View Palette


You can create the content of a form design to correspond to a data source.

Library Palette

The Library palette contains all the objects that you can add to a form design.
Objects are organized into groups. Each group is contained in a tab labeled with the group's name.
Object Palette
Use the Object palette to modify properties that are specific to the selected object. The object that is
selected in the Layout Editor determines which tabs are available in this palette.

Border Palette

Use the Border palette to edit the border properties for objects in the form design. You can edit the
borders individually (left, right, top, and bottom) or together. You can also specify the type of border
corner and background color.

Accessibility
Use the Accessibility palette to specify custom text for an object that a Microsoft Active Accessibility
(MSAA) compliant screen reader reads as it passes through the form. If custom screen reader text is
available for the object, the screen reader will read the custom text and not the tool tip.

Layout Palette

When you select an object on a body or master page, the Layout palette automatically displays the
selected object's settings. Any changes that you
make to the settings in the Layout palette are applied to the selected object.
Similarly, you can edit most of an object's layout settings directly in the Layout Editor. For example, to
change an object's position, you can drag it to
the new location on the page.

Integration into ABAP Programs.


The 5 basic steps involved are -
1.Data retrieval in the report program.
2.Call Function 'FP_FUNCTION _MODULE_NAME( to get the generated
function module name).
3.Call Function 'FP_JOB_OPEN '.
4.Call Function <generated function module name>.
5.Call Function 'FP_JOB_CLOSE'.
If you need to have copies of the same form to be generated, you may call
the function module by using (do ('n' times) - enddo) loops.
There are standard test forms for training provided by SAP. Search "FP*"
in the SFP transaction.
Demo of Print Program for executing PDF Forms.
DATA: CUSTOMER TYPE SCUSTOM,
BOOKINGS TYPE TY_BOOKINGS,
CONNECTIONS TYPE TY_CONNECTIONS,
FM_NAME TYPE RS38L_FNAM,
FP_DOCPARAMS TYPE SFPDOCPARAMS,
FP_OUTPUTPARAMS TYPE SFPOUTPUTPARAMS.

* GETTING THE DATA


<data selection>

* PRINT:

* Sets the output parameters and opens the spool job


CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
IE_OUTPUTPARAMS = FP_OUTPUTPARAMS
EXCEPTIONS
CANCEL =1
USAGE_ERROR =2
SYSTEM_ERROR =3
INTERNAL_ERROR =4
OTHERS = 5.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.

* Get the name of the generated function module


CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
I_NAME = '<form name>'
IMPORTING
E_FUNCNAME = FM_NAME.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.

* Call the generated function module


CALL FUNCTION FM_NAME
EXPORTING
/1BCDWB/DOCPARAMS = FP_DOCPARAMS
CUSTOMER = CUSTOMER
BOOKINGS = BOOKINGS
CONNECTIONS = CONNECTIONS
* IMPORTING
* /1BCDWB/FORMOUTPUT =
EXCEPTIONS
USAGE_ERROR =1
SYSTEM_ERROR =2
INTERNAL_ERROR = 3.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.

* Close the spool job


CALL FUNCTION 'FP_JOB_CLOSE'
* IMPORTING
* E_RESULT =
EXCEPTIONS
USAGE_ERROR =1
SYSTEM_ERROR =2
INTERNAL_ERROR =3
OTHERS = 4.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.
Troubleshooting
Features
You are provided with various function modules for troubleshooting purposes.
You can use these function modules to extract the following information:
Texts about the cause of the error (with the FP_GET_LAST_ADS_ERRSTR FM)
A trace of the Adobe document services (with the FP_GET_LAST_ADS_TRACE FM)

POSTED BY MUKESH KUMAR AT 08:59:00


LABELS: ABAP, ADOBEFORMS, SAP
Share

3 COMMENTS:

1.

paavan sharmaJune 30, 2016 5:59 pm

Nice article..

Reply

Replies

Reply

2.

smrithiNovember 04, 2016 9:59 am

It was very nice blog to learn about Selenium.Thanks for sharing new
things.selenium training in chennai

Reply

Replies

Reply

3.

ShaliniJanuary 09, 2017 11:00 am


Hi, This is shalini from Chennai learned SAP Training in Chennai from
mr.karthick. The training really was good and i got selected in leading mnc
company as SAP Consultant.

You can contact 8122241286 for Best SAP Training in Chennai or reach
www.thecreatingexperts.com

Reply

DIGITALSIGNATURE BY ADOBE NON INTERACTIVE

Digital Signatures in Adobe Forms


(Non-Interactive)
This question is answered
Hi everyone,
I need to sign a receipt that will be sent by e-mail. The form is non-interactive, it´s only a simple receipt.
This form may be printed or sent by e-mail; in case of being sent it must be signed before sending it. The
receiver should be able to open it using Adobe Reader.
I´ve read other posts/help about singatures in Adobe Forms, but none of them of non-interactive forms; I
need to know if it is possible to do this if the form is not interactive, and how it can be done.
Thanks!
Pablo

Former Member
December 18, 2015 at 13:26 PM
0 Likes
Correct Answer

Markus Meisl replied


January 11, 2007 at 16:11 PM
Hi Pablo
the link I provided is the only documentation available on the topic. I am not aware of any
comprehensive examples apart from the corresponding FP* program, which is a NetWeaver program, not
an application one. No SAP application ships processes using this technology at this point.
You do not need SSF for signing with the Adobe-based solution.
On a high level (and I have no more details): You need to place a signature field on the form. You need to
set up a Public Key Infrastructure with certificates (see general Security documentation). You need to
write a program that generates the form, then calls the server, which signs the form with its default
certificate on the generated form, then attaches the signed PDF to a mail (sent through, for example, the
Business Communcation Services of SAP NetWeaver AS.
Best
Markus
0 Likes 0 View this answer in context
Helpful Answer
by

 Markus Meisl

Not what you were looking for? View more on this topic or Ask a question
11 replies
Helpful Answer

Markus Meisl replied


January 09, 2007 at 13:55 PM
Hi Pablo,
if you want to sign the PDF before sending it (an action called certification of a form, which would be on
done the server), you will essentially turn your non-interactive form into an interactive one. Every
signature to be applied, whether by an end user on the frontend or by the server, requires a signature
field, which by definition is an interactive field. In the case of a server-side signature, it would usually be
an invisible field.
Using an interactive field on a form would have an effect on the licensing of the solution (in custom
scenarios, the Adobe-based forms solution requires a separate license to be purchased through SAP).
Best regards,
Markus Meisl
0 likes

Former Member replied


January 09, 2007 at 21:10 PM
Thanks Markus...
Now, in that case, is it possible to sign the document automatically without any action from the user?
In my case, when the user decides to send the receipt by e-mail, how can I make the system to sign the
document automatically? I need the document to be signed without any action from the user.
Best Regards,
Pablo
0 likes

Markus Meisl replied


January 10, 2007 at 13:09 PM
Yes, you can, if you create the necessary application logic (there is no standard NetWeaver mechanism to
do this). Read the section in the documentation: <a
href="http://help.sap.com/saphelp_nw2004s/helpdata/en/18/ecb69017ad4765855425b97f666470/fram
eset.htm">Digital Signatures and Certification in Forms</a>
Best.
Markus
0 likes

Former Member replied


February 29, 2012 at 10:07 AM
Yes, I´ve read that already... but it doesn´t explain how to sign the document; there is no clear
explanation of the technical way to do so.
Should I call a function inside my program before sending the document? Or just by inserting a signature
field the document will be signed automatically? I know that there must be something missing... but I just
can´t find it in the HELP from ADS.
Do you know how to do this? Con you send me an example or a link with a more detailed description?
I have also read the way to do it with SSF, but I understand that I don´t have to use SSF for ADS... is this
correct?
Thank you very much!
Pablo
0 likes

Correct Answer

Markus Meisl replied


January 11, 2007 at 16:11 PM
Hi Pablo
the link I provided is the only documentation available on the topic. I am not aware of any
comprehensive examples apart from the corresponding FP* program, which is a NetWeaver program, not
an application one. No SAP application ships processes using this technology at this point.
You do not need SSF for signing with the Adobe-based solution.
On a high level (and I have no more details): You need to place a signature field on the form. You need to
set up a Public Key Infrastructure with certificates (see general Security documentation). You need to
write a program that generates the form, then calls the server, which signs the form with its default
certificate on the generated form, then attaches the signed PDF to a mail (sent through, for example, the
Business Communcation Services of SAP NetWeaver AS.
Best
Markus
0 likes

Former Member replied


February 29, 2012 at 10:07 AM
Markus, thanks for your answer.
I've found an example on signing PDF documents: FP_PDF_TEST_07. I will use it as a base for my
application.
Regards,
Pablo Garcí
0 likes

Former Member replied


May 22, 2007 at 14:18 PM
hello pablo
could you forward me FP_PDF_TEST_07
0 likes

Former Member replied


May 22, 2007 at 14:32 PM
Hi Jinal,
Here it goes:
Copy Code

1. report fp_pdf_test_07.
2. * set signature
3.
4. class cl_fp definition load.
5.
6. selection-screen begin of block s_files with frame title text-100.
7. parameters: p_pdf(64) type c lower case obligatory,
8. p_out(64) type c lower case obligatory.
9. selection-screen end of block s_files.
10. selection-screen begin of block s_conn with frame title text-101.
11. parameters: p_dest type rfcdest default 'ADS' obligatory.
12. selection-screen end of block s_conn.
13. selection-screen begin of block s_sig with frame title text-102.
14. parameters: s_key(64) type c lower case,
15. s_field(64) type c lower case,
16. s_reason(64) type c lower case,
17. s_loc(64) type c lower case,
18. s_cinfo(64) type c lower case.
19. selection-screen end of block s_sig.
20.
21. types: ty_raw(255) type x,
22. ty_tab type standard table of ty_raw.
23.
24. data: l_filename_pdf type string,
25. l_filename_out type string,
26. l_fp type ref to if_fp,
27. l_pdfobj type ref to if_fp_pdf_object,
28. l_pdf type xstring,
29. l_out type xstring,
30. l_fpex type ref to cx_fp_runtime.
31.
32. l_filename_pdf = p_pdf.
33. l_filename_out = p_out.
34.
35. perform load_file using l_filename_pdf
36. changing l_pdf.
37.
38. * get FP reference
39. l_fp = cl_fp=>get_reference( ).
40.
41. try.
42. * create PDF Object
43. l_pdfobj = l_fp->create_pdf_object( connection = p_dest ).
44.
45. * set document
46. call method l_pdfobj->set_document
47. exporting
48. pdfdata = l_pdf.
49.
50. * set signature
51. call method l_pdfobj->set_signature
52. exporting
53. keyname = s_key
54. fieldname = s_field
55. reason = s_reason
56. location = s_loc
57. contactinfo = s_cinfo.
58.
59. * execute, call ADS
60. call method l_pdfobj->execute( ).
61.
62. * get result -> l_out
63. call method l_pdfobj->get_document
64. importing
65. pdfdata = l_out.
66.
67. catch cx_fp_runtime_internal into l_fpex.
68. perform error using l_fpex 'INTERNAL ERROR'.
69. catch cx_fp_runtime_system into l_fpex.
70. perform error using l_fpex 'SYSTEM ERROR'.
71. catch cx_fp_runtime_usage into l_fpex.
72. perform error using l_fpex 'USAGE ERROR'.
73. endtry.
74.
75. check l_fpex is initial.
76.
77. * download PDF
78. data: l_len type i,
79. l_tab type tsfixml.
80.
81. call function 'SCMS_XSTRING_TO_BINARY'
82. exporting
83. buffer = l_out
84. importing
85. output_length = l_len
86. tables
87. binary_tab = l_tab.
88. call method cl_gui_frontend_services=>gui_download
89. exporting
90. bin_filesize = l_len
91. filename = l_filename_out
92. filetype = 'BIN'
93. changing
94. data_tab = l_tab
95. exceptions
96. others = 1.
97. if sy-subrc = 0.
98. write:/ 'Datei erfolgreich geschrieben'(001).
99. else.
100. write:/ 'Fehler beim Schreiben der Datei'(002).
101. endif.
102.
103. form error using p_fpex type ref to cx_fp_runtime
104. p_str type string.
105. data: l_errcode type i,
106. l_errmsg type string,
107. l_string type string.
108.
109. write:/ '***************************************************'.
110. write:/ '***', p_str.
111. write:/ '***************************************************'.
112. skip 2.
113.
114. call method p_fpex->get_errall
115. importing
116. errcode = l_errcode
117. errmsg = l_errmsg.
118.
119. write:/ 'ERROR CODE : ', l_errcode.
120. write:/ 'ERROR MESSAGE : ', l_errmsg.
121.
122. l_string = p_fpex->get_text( ).
123. write:/ l_string.
124.
125. endform.
126.
127.
128. form load_file using p_filename type string
129. changing p_content type xstring.
130. data: l_rawtab type ty_tab,
131. l_len type i.
132.
133. call method cl_gui_frontend_services=>gui_upload
134. exporting
135. filename = p_filename
136. filetype = 'BIN'
137. importing
138. filelength = l_len
139. changing
140. data_tab = l_rawtab
141. exceptions
142. file_open_error = 1
143. file_read_error = 2
144. no_batch = 3
145. gui_refuse_filetransfer = 4
146. invalid_type = 5
147. no_authority = 6
148. unknown_error = 7
149. bad_data_format = 8
150. header_not_allowed = 9
151. separator_not_allowed = 10
152. header_too_long = 11
153. unknown_dp_error = 12
154. access_denied = 13
155. dp_out_of_memory = 14
156. disk_full = 15
157. dp_timeout = 16
158. not_supported_by_gui = 17
159. error_no_gui = 18
160. others = 19.
161. if sy-subrc <> 0.
162. message id sy-msgid type sy-msgty number sy-msgno
163. with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
164. endif.
165.
166. perform convert_tab_to_x using l_rawtab l_len
167. changing p_content.
168.
169. endform.
170.
171.
172. form convert_tab_to_x using p_rawtab type ty_tab
173. p_len type i
174. changing p_xstr type xstring.
175. data: l_line type ty_raw,
176. l_count type i,
177. l_len type i,
178. l_rest type i.
179.
180. describe table p_rawtab lines l_count.
181.
182. loop at p_rawtab into l_line.
183. if sy-tabix = l_count.
184. l_rest = p_len - l_len.
185. concatenate p_xstr l_line(l_rest) into p_xstr in byte mode.
186. else.
187. concatenate p_xstr l_line into p_xstr in byte mode.
188. add 255 to l_len.
189. endif.
190. endloop.
191.
192. endform.

Good Luck!
Pablo
0 likes
Former Member replied
March 16, 2007 at 11:50 AM
Hello,
Please anyone can help me include automatically (in the server-side) digital signature in pdf Forms (using
the Adobe Document Service). I know this is possible but I can’t find any documentation about the
system configuration.
thanks
Nuno Abrantes
0 likes

Former Member replied


December 18, 2015 at 13:26 PM
Hola Pablo,
I know that this is an old post. But I have to do the same thing that you did.
Do you remember the solution that you applied?
thank you,
Pasquale.
0

Digital signature on Adobe forms


Hi All,

I have done some research regarding Adobe signatures but I am not arriving at desired conclusion.
Request your help.

Requirement: Client currently signs PDF forms using dongle provided by third party services like E-Mudra.
At the time of signing the PDF, client needs to enter pin code. Only on entering the correct pin code, the
PDF gets signed. Can this be accomplished in SAP ? I need to get the Adobe forms signed automatically
from SAP using the same signature.

From what I know, following will be the process for digitally signing Adobe forms. Please confirm.

1. Get the license for Adobe Interactive forms ( mandatory ) as the signature field is interactive one.

2. Upload digital signature in system

3. ADS should be activate

4. Apply logic, similar to program FP_PDF_TEST_07 i.e. like below

* create PDF Object


l_pdfobj = l_fp->create_pdf_object( connection = p_dest ).

* set document
call method l_pdfobj->set_document
* set signature
call method l_pdfobj->set_signature
exporting
keyname = s_key
fieldname = s_field
reason = s_reason
location = s_loc
contactinfo = s_cinfo.

* execute, call ADS


call method l_pdfobj->execute( ).

* get result -> l_out


call method l_pdfobj->get_document
importing
pdfdata = l_out.

5. This will create desired PDF document.

However, I am not sure on below:

1. Is Adobe interactive license mandatory?

2. Where to upload digital signature ( Desktop or SAP Application server )

3. Is the keyname, which is passed in l_pdfobj->set_signature, an encoded key? If yes, how can it be
obtained?

4. Is there any additional scripting required or is normal ABAP coding sufficient?

5. The above process is sufficient or is any additional work required?

6. As client is entering pin code to digitally sign the document, nobody else can sign the document even if
dongle is available with the person ( as pin code is not known ). Can this be covered in SAP? As per my
understanding, client will have to continue with the current process.

Thanks,

Sanket
Tags:

 interactive
 adobe
 adobe_form
 digital_signature
 sap_interactive_forms_by_adobetagssap
 pdf

You might also like