Show TOC Start of Content Area

Procedure documentation Building and Using a Form Context  Locate the document in its SAP Library structure

Use

When you want to prefill a composite form with data, or if you want to expose data from the form to other applications and services at runtime, you use the form context to handle the data that you want to transfer. The data you use to build the form context is to be displayed in the form at runtime. This is done by mapping the form context parameters to the composite form fields.

You build the form’s context when you configure the composite form object in the Guided Procedures (GP) design time.

Prerequisites

If you want to use pre-processing services, you must have created and activated the relevant callable objects in advance. As a pre-processing service, you can use any callable object that is executed in the background and defines input parameters, such as RFC or background execution callable objects.

More information:

      Creating Callable Objects for Background Execution

      Exposing RFCs as Callable Objects

Procedure

1. Enter the Basic Data for the Composite Form

...

       1.      Launch the GP design time, and choose Create Composite Form from the contextual navigation panel.

       2.      Enter the required data for the new form:

       You can enter an arbitrary name and description.

       From the Original Language dropdown box, choose English.

       You can choose an existing folder, or create a new one.

       Make sure you select PDF Template for template type.

       For use type, select:

       Field-Based Template,if you want to upload or create a form that you can reuse.

       Schema-Based Template, if you want to generate the form schema from the form context.

       3.      Choose Next.

2. Add Pre-processing Services

...

       1.      In the Pre-Processing screen, choose Add Service.

Browse the folders in the gallery to locate the callable objects that you want to use.

       2.      To add a callable object, select it and then choose Select.

       3.      Repeat the previous step to add more services.

       4.      Finally, choose Done.

At runtime, the pre-processing services are executed in the order that you define when adding them. You can change it using Move Up and Move Down.

Note

Order is important when one or more services use as input the output from the execution of the preceding services.

3. Add Parameters to the Form Context

...

       1.      Select a service in the Pre-Processing Service table.

The service output parameters are displayed in the Build Form Context tab page.

       2.      To add a parameter to the form context, select it in the Service Parameters table, and choose Add Parameter.

It appears in the Form Context table.

       3.      To add parameters from another service, select it in the Pre-Processing Service table, and repeat the above step.

Note

By default, the composite form context contains a structure for the additional fields that are added in the next wizard step.

In addition, there is a default input parameter for an e-mail address where the form can be sent if configured accordingly. This configuration is done when the form is encapsulated in a callable object.

More information: Exposing Composite Forms as Callable Objects

4. Map Services Input and Output Parameters to Form Context Entries or Set Defaults

Pre-processing services can use input data from the form context to be executed.

To enable this, you add the service parameters that you want to use as input to the form context, and then map the form context entries to the input parameters of the relevant services.

To add the result data to the form context, you map the service output parameters to the relevant form context entries.

You can also set default values for input parameters and form context entries. For example, you can set defaults for the input parameters of the first pre-processing service.

...

       1.      Open the Map Input Parameters tab page.

                            a.      To map the service input parameters to the form context, select an entry under Input Parameters, and then a parameter from the form context.

The mapping is automatically done. To undo it, choose Remove Mapping.

                            b.      To add a default value, select an input parameter, and choose Set Default.

Enter the required default, and choose Done.

       2.      Open the Map Output Parameters tab page.

                            a.      To map the service output to the form context, select an entry under Form Context, and then a parameter under Output Parameters.

The mapping is done automatically. To undo it, choose Remove Mapping.

                            b.      To add a default value, select a form context parameter, and choose Set Default.

Enter the required default, and choose Done. 

Note

Once you create the composite form, you can view pre-processing service definitions and mappings on the Pre-Processing tab page of the form design time. You can also edit services by toggling edit mode.

5. Map Template Input and Output Parameters to Form Context Entries or Set Defaults

Prefilling of form templates can use input data from the form context to be executed. You can prefill manually only field-based forms. Schema-based forms are prefilled automatically.

To enable prefilling, you map the composite form fields as an input to the relevant parameters in the form context. Next, you map the form context entries to the output parameters of the composite form.

You can also set default values for the template input and output parameters. For example, you can set defaults for template input parameters so that specific values are selected as elements of the prefilling during the creation of the form PDF file.

Note

For parameter structures that consist of text and value parameters, such as Dropdown and List, the input parameter value you enter (text) may differ from the output parameter value of the composite form after submitting the form. Whereas the input is used for prefilling of the form template fields, the output is used for continuing the process flow, such as executing an action or completing a step.

...

       1.      Open the design time of the composite form and go to the Logical Criteria tab page. Choose the Define Mappings pushbutton.

       2.      Open the Map Input Parameters tab page.

                            a.      To map a form template parameter to a form context parameter, select an entry under Template Parameters and then an entry from the form context.

The mapping is done automatically. To undo it, choose Remove Mapping.

                            b.      To add a default value, select a form context parameter, and choose Set Default.

Enter the required default and choose Done.

       3.      Open the Map Output Parameters tab page.

                            a.      To map a form context entry to a template output parameter, select an entry under Form Context and then an entry from Template Parameters.

The mapping is done automatically. To undo it, choose Remove Mapping.

                            b.      To add a default value, select a form context parameter, and choose Set Default.

Enter the required default and choose Done.

You can choose from the following template parameters:

Template Parameters

Adobe UI Element in Template File

Composite Form Template Parameters

Parameter Type

Description

Drop-down List

DropDownList

String

Defines a dropdown list prefilling.

You can set a value that is selected as an element of the prefilling during the creation of the form PDF file.

List Box

ListBox

String

Defines a dropdown list prefilling.

You can set a value that is selected as an element of the prefilling during the creation of the form PDF file.

Table

Table

Structure

Table rows are not prefilled. If cells contain some form fields, their values are prefilled and more table rows containing form fields are created. To prefill the table cells, you have to properly configure the table in the Adobe designer. You also have to map the table row to a list structure in the form context.

Check Box

Checkbox

Boolean

      Defines the prefilling of a checkbox. You can set a default value such as yes to have the checkbox selected. The names of the values are configured in the Adobe designer.

Date/Time Field

DateTimeField

      Date

      Time

      Time Stamp (includes both date and time)

Defines the prefilling of a Date/Time field. In the Adobe designer, you can choose which date format to use when designing the form template.

Numeric Field

NumericField

Float

Defines the prefilling of a numeric field.

Text Field

TextField

String

Defines the prefilling of a text field.

Decimal Field

DecimalField

Decimal

Defines the prefilling of a decimal field.

Radio Button

RadioButtonList

String

Defines the prefilling of a radio button.

You can set a default value such as yes to have the radio button selected. The names of the values are configured in the Adobe designer.

      Drop-down List

      Check Box

Prefill

Structure

Contains the parameter structures from the pre-processing service that answer to Dropdownlist and Listbox or the name you have specified in the Abode designer.

Each of the structures contains two fields: text and value. The structures also have to be a List so that the combination text=value can occur indefinitely.

The input parameter value you enter (text) may differ from the output parameter value of the composite form after submitting the form

Image Field

Not applicable

Binary

Not supported by GP.

Password Field

Not applicable.

String

Not supported by GP.

Signature Field

Not applicable.

String

Not supported by GP.

Text

Not applicable.

Not applicable.

Not supported by GP.

Note

The names listed in the Template Parameter column of the table are the default names used in Adobe LiveCycle Designer. You can customize the names of the template fields when designing the form template. If you customize the names at a later point, you have to add the updated form template to the composite form object in the design time.

       4.      When you are done, choose Save.

Result

You can now instantiate the form template and see the pre-filled form elements in the generated PDF form.

More information

Instantiating and Testing Guided Procedure Forms

Form Context

End of Content Area