Adobe Interactive Forms

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

Adobe Interactive Forms (Joan Ayala)

Unit 2. Interface
Types of an Interface

Figure 5: Interface: Properties

To access interface maintenance, use transaction SFP. Alternatively, use transaction


SE80 and choose Other object. Choose the More tab page and select Interface. In the
example above, the interface is called BC480.
On the Properties tab page you determine the type of the interface. These types differ in
the number and types of parameters and other elements they have. The types .ABAP
Dictionary based. and .Smart Forms compatible. are used for print scenarios, whereas
the type .XML schema based. (which was introduced in SAP NetWeaver 2004s) is
primarily used for Web Dynpro scenarios.

Parts of Interface: Types “ABAP Dictionary” or


“SmartForms”
The import parameters defined in the interface can be passed from the application
program to the form at runtime, and vice versa for export parameters. A form interface
of the type .ABAP Dictionary. has only one default import parameter
(/1bcdwb/docparams of type sfpdocparams). It is used to determine a form's locale
(language and country) and whether the form will allow interactive features. The default
export parameter is /1bcdwb/formoutput of type fpformoutput. This parameter has to be
evaluated in the calling program if the resulting document needs to be handled by the
program itself. Export parameters can be added only for those interfaces that are
compatible with Smart Forms.
If an interface is compatible with Smart Forms, you might also have tables parameters.
You should use them only if you have an internal table that needs to be changed with
ABAP coding within the form. Exceptions that you declare in an interface can be raised
in ABAP coding of a form. They are based on the traditional exception concept (not the
class-based concept that was introduced in SAP Web Application Server 6.10).
You raise an exception as such:
RAISE <exception>.
(Alternative:
MESSAGE <message_type><message>(<message_class>) RAISING 
<exception>
Adobe Interactive Forms (Joan Ayala)

In the global definitions, you have the following nodes:


 Global fields: You can set the values of global fields by specifying a default
value or by using initial ABAP coding. In migrated Smart Forms, you can also
use them in program line (ABAP) nodes. Global fields can be integrated in the
form layout
 Field symbols: Field symbols might act as placeholders for variables. They are
useful in dynamic programming and for speeding up the processing of internal
tables. In the form, they can be used in the same places as global fields, although
the coding differs. In PDF based forms, values can be assigned to field symbols
in ABAP coding. For details on how to use field symbols in ABAP coding,
check the ABAP documentation, keyword FIELD-SYMBOLS
 Global types: If your global fields (or any fields that you might declare within
ABAP coding) need types other than ABAP types (i, n, f, c, p, and so on) or
Dictionary types, you can create local types in the editor that opens when you
choose Types. For details on how to create local types, check the ABAP
documentation, keyword TYPES.

During initialization, data coming from the program can be changed before it is sent to
the form. In forms that have not been migrated from Smart Forms, initialization is the
only time when ABAP coding can be executed.

Unit 3. Context
The screen on the Context tab of transaction SFP is split into four areas:
 Interface: all fields that are displayed in the Interface area (all interface fields
plus the system fields sfpsy-date, sfpsy-time, sfpsy-username, sfpsy-subrc) can
be selected for the context by dragging and dropping them there. If your
interface is compatible with Smart Forms, you will have the Smart Forms
system fields (SFSY-...) instead.
 Context: The context area contains those elements that will be available in the
form layout. These fields are a subset of the interface, and include additional
elements like graphics or texts. You can create new elements by right-clicking on
the context.
 Properties of interface field: Double-clicking on a field from the interface will
display its details in the bottom left area.
 Properties/details/conditions of context element: Double-clicking on an element
from the context will display its details in the bottom right area. For example,
you would set the source for an image or the name of an external text here.

With regards to PDF-based forms, the main difference between Text Modules and
SAPscript Texts is that text modules are client-independent and have an automatic link
to the Transport Organizer, whereas SAPscript texts are client-dependent and must be
manually included in a transport request.
Adobe Interactive Forms (Joan Ayala)

Unit 4. Designer
Masterpages

Every form design contains at least one master page that Adobe LiveCycle Designer
creates automatically. You can put objects on a master page that will appear on any
resulting page at runtime, for example, your company logo. Such objects that never
change are called boilerplate objects.
Everything that is on an (abstract) master page will reappear on every (concrete) body
page. To some extent, the boilerplate objects of a master page could be compared to
secondary windows in SAPscript or Smart Forms.
On a master page, you must include at least one content area. This defines the size to be
used for dynamic output. Content areas can be included only on master pages.
Dynamic content is wrapped up in body pages. A body page will use the space provided
by a content area. If, at runtime, this happens not to be sufficient due to a large amount
of data, the body page will look for the next content area (which might involve an
automatic page break).
You should think of a body page as nothing more than a wrapper or a container for
dynamic content. So you might have one single body page in a form with lots of items
at runtime; consequently, the printout would have many pages.
To some extent, the combination of a content area and a body page included there could
be compared to the main window in SAPscript or Smart Forms. (Note, however, that
this is only a very rough equivalent!)
For further organising body pages (or, though rarely, master pages), they can contain
subforms. It is a good idea to always start out with the static part of a form: the master
pages.
Adobe Interactive Forms (Joan Ayala)

Body Pages

A body page is a top-level subform. It serves as an organising unit for dynamic content
and can be laid down only in a content area of a master page. Make sure to have its
place set to Top of Next Page (which will take the next master page from the hierarchy)
or Top of Page... if you want to start a new page.
For the first body page, the place Following previous actually means to start with the
first master page in the Hierarchy. If you set a body page.s place to On Page <Master
Page>, there are two possible scenarios:
 If the preceding subform was already laid out on that master page, the body page
will follow on the same output page (provided there is enough space).
 If the preceding subform was laid out on a different master page, a page break
will be inserted and a new output page will begin using the desired master page.
To display the terms and conditions on a separate page with a special layout, you need
to define an extra master page (let's call it TERMS) and create a new body page. For the
new body page (which is, like all body pages, a subform), choose Top of Page →
TERMS for Place.
Instead of creating a new body page, you could tell the previous subform to go to the
top of page TERMS after it has been laid down. (But it is a good a idea to have a new
body page for every forced page break . this helps to read the Hierarchy palette more
easily.)

Subforms
Adobe Interactive Forms (Joan Ayala)

In a very simple approach, subforms can be thought of as folders containing several


objects. They can be used for the simple reason of keeping order in the Hierarchy, as it
is possible to expand and compress subforms.
Subforms also help to rearrange several objects at a different place in the form. Be
aware that nesting subforms will slow down the processing performance. There are two
types of subforms:
 If of type Positioned, objects of subforms can be laid down at their exact
position at runtime, relative to the subform. For example, if a text field has been
positioned at the top left corner of a subform of type Positioned, it will always
be positioned at the top left corner of the subform, independent where on a page
this subform is included. (The Hierarchy position of an object within a subform
of type Positioned is irrelevant for its layout position.)
 If of type Flowed, the objects will follow each other, depending on the space
they require at runtime. A body page (as the topmost subform) is typically of this
type.

If you want to make sure that certain objects appear on one page, proceed as follows:
1. Mark the objects.
2. In the Hierarchy, choose Wrap in subform from the context menu.
3. Disallow a page break for this subform. You do this on the Object palette, Subform
tab. Deselect Allow Page Breaks within Content.
This option is not available on a master page or if the subform itself is included in
another subform of type Positioned. You can also prevent a page break between several
subsequent subforms. On the Object palette, Pagination tab, select Keep w/ith Previous
and/or Keep with Next.
 Keep with Previous: Keeps the subform on the same page as the previous
subform, content area, or body page, depending on which one is selected in the
Place box.
 Keep with Next: Keeps the subform on the same page as the next subform,
content area, or body page, depending on which one is selected in the Place box.

Unit 5. Layout
Floating Fields
Adobe Interactive Forms (Joan Ayala)

Sometimes it is necessary to include fields in static texts. For example, you want to
avoid something like .Dear sir or madam. and rather address your customers with their
real names. You achieve this by using floating fields:
1. In an existing static text, set the cursor to the position where the floating field should
be inserted.
2. Choose Insert → Floating Field for every field that you want to integrate.
3. Within the static text, place the cursor on one of the text fields just created (make sure
it is marked). Then, in the Object palette, Binding tab, enter the appropriate data
binding. It is safest to do this by clicking on the small triangle to the right of the Binding
field and then choosing a field from the form context.
4. Do not be confused that in the Hierarchy, the floating fields appear as individual
elements; it is not discernible that they have been included in a static text. To make
things a bit clearer, you might want to specify a meaningful name for the fields. You can
do so by right-clicking on them and choosing Rename from the context menu.

Unit 6. Scripting in the Form


You can attach scripts to all kinds of non-static objects, that is, for all objects
apart from content areas, static texts, static images, and graphical elements (lines,
circles, rectangles). However, scripting that is attached to a non-static object can
access all other objects of the form, including the static ones.

Unit 7. Integration into ABAP


Programs
Adobe Interactive Forms (Joan Ayala)

From the form printing perspective, every ABAP application program consists of the
following parts:
1. The business data is selected from the database, which is by far the most
comprehensive part. Additional calculations should also be done here, as the
form should contain as little calculation as possible. The idea of Enterprise
Services Architecture implies that no additional data is selected from within the
form. For performance reasons, you might want to find out which fields are
actually used in the form. Call function module FP_FIELD_LIST. It will return a
single-column, internal table with the names of the fields (in the case of
structures, the individual fields will be listed).
2. The name of the function module generated for the form must be determined, as
the name differs depending on the form and system. Call the function module
FP_FUNCTION_MODULE_NAME and pass the form name to it.
3. and 5.: If you call a form with the new interface, you must explicitly open and
close form printing. Call function modules FP_JOB_OPEN and
FP_JOB_CLOSE to do so.
4. Within the bracket of FP_JOB_OPEN and FP_JOB_CLOSE, call the form's
generated function module as many times as needed. Several PDF documents
will result, which will be separate parts of one spool request. Using transaction
SP01, you can print them individually or separately. Note, however, that it is not
possible to mix Smart Forms and PDF-based forms in one job.

Reuse of Smart Forms Application Programs


Adobe Interactive Forms (Joan Ayala)

If you have migrated a Smart Form to a PDF-based form, you might want to reuse your
old application program without having to change it. This is possible because function
module SSF_FUNCTION_MODULE_NAME (that is, the Smart Forms equivalent to
FP_FUNCTION_MODULE_NAME) has been enhanced so that it can look up whether
a Smart Form should be used or whether a migrated Smart Form, that is, a PDF-based
form, should be used. Parameter fm_name will automatically contain the name of the
appropriate generated function module. Since this generated function module is always
called dynamically, no changes in the application program are necessary.

How do you tell SSF_FUNCTION_MODULE_NAME which function module to


return? After migrating a Smart Form to a PDF-based form, run transaction
SMARTFORMS and choose Utilities→Migration→PDF-based Form→Switch
Runtime. This will create an entry in an administration table (STXFPCUST) with the
name of the old Smart Form and its new PDF-based replacement. This entry will
automatically be evaluated by SSF_FUNCTION_MODULE_NAME.
You could also create new PDF-based forms (with Smart Forms-compatible interfaces),
and use them in old application programs. However, it is recommended to use the new
technology for both form and application program.
If your form uses a Smart Form-compatible interface, the generated function module
will have different parameters.
Here are some of the import parameters:
 control_parameters: Amixture of /1bcdwb/docparams and of the equivalent of
FP_JOB_OPEN's ie_outputparams.
 output_options: Spool settings
 user_settings: If 'X', the user's default settings will be taken for the spool.

Please note that some parameters that are possible in a Smart Forms-compatible
interface can no longer be used in a meaningful way.
For details, see the Smart Forms documentation.
Adobe Interactive Forms (Joan Ayala)

You might also like