Entering content frame

Background documentation Integrating a PDF Form in a Web Dynpro Application Locate the document in its SAP Library structure

The following describes the procedure for using a PDF form in a Web Dynpro application. Forms can be created and maintained independently of Web Dynpro applications using the Form Builder (transaction SFP). Information about the creation of forms and using the Form Builder is available under Structure linkDesigning Forms with the Form Builder. You can integrate a form within every view of any component, but it can often be useful to create a separate view for the integration of a form.

Procedure documentation Including an Existing PDF Form in a Web Dynpro View

...

       1.      In the Web Dynpro Explorer, create a view for your component or select a view into which to integrate the form.

       2.      In the layout of this view, drag the UI element InteractiveForm from the Adobe Library into the Layout Designer.

       3.      For the templateSource property, enter the name of the selected form (an input help is available). Based on the interface of the selected form, a context node with attributes is automatically created for the UI element InteractiveForm. The dataSource property of the UI element is automatically bound to this context node.

       4.      To define that your form is an interactive form, select the option for the enabled property in the properties table of the UI element InteractiveForm. By default, enabled is inactive – that is, it is usually a non-interactive form.

After filling the created context structure – for example using a suitable supply function – and including it in the navigation of the window, you can activate and test the application.

Procedure documentation  Creating a PDF Form Within a Web Dynpro View

Since in many cases the required form is not available, the Web Dynpro Explorer also allows you to create a new from when designing the Web Dynpro view. However, there is a different procedure for this:

       5.      In the Web Dynpro Explorer, create a view for your component or select a view into which to integrate the form.

       6.      In the view context, create the node with attributes that is later to be bound to the form.

       7.      In the layout of this view, drag the UI element InteractiveForm from the Adobe Library into the Layout Designer.

       8.      Now enter a name for the new form in the line templateSource of the UI element properties table and double-click the name.

       9.      The subsequent dialog box informs you that you must specify an interface before you can create the new template. At this point, you can use an existing interface, but you can also create a new interface adapted to suit your Web Dynpro view.  To create a new interface, enter a name and choose Context. Since the creation process is connected to the view you are processing, the context of this view is provided for the selection of a suitable node.

   10.      Choose the context node created in step 2 and close the dialog box.

   11.      In the next two dialog boxes, you save a new interface and a form that uses this interface, each as a separate transport object.  Only on the third dialog box do you save the processed view and branch to the Form Builder to Structure linkdesign the form layout.

NoteBased on your selected Web Dynpro context, an XML schema is created for the new interface, which is available to the new form for data selection.

If you switch back to view editing after completing the form design and select the UI element InteractiveForm in the view layout, you will see that view context node was automatically connected with the form or relevant interface.

You have now finished integrating the newly created form and can complete the inclusion of the view context in the application logic of the component.

Subsequent Changes to the Web Dynpro Context

To provide new elements in the data view for the form, you must first enhance the respective Web Dynpro context accordingly. You do this, as usual, in the context editor of the Web Dynpro Explorer. The triggering of forwards navigation on the UI element InteractiveForm branches subsequently back to the Form Builder. The XML schema, and thus also the data view of the Form Builder, is automatically adjusted.

Caution If you used an existing templateSource for the form integration whose interface is not based on an XML schema, you cannot add any further data fields at a later stage.

Caution Note that other forms may have used your interface and check carefully before you change an interface.

 

Form Data in XML Format

In the two procedures described above, only the two properties templateSource and dataSource of InteractiveForm were bound to the view context. The templateSource property contains information about the form template, while the context node, to which the dataSource property was bound, contains the values to be displayed in the form as individual Web Dynpro context attributes.    

You can store or process the values of the form, completed at runtime by user input, in XML format. To do so, you have to include an additional attribute of the type xstring in the view context. You then bind the pdfSource property of the UI element InteractiveForm to this context attribute.

The XML representation of the PDF values can be read and processed here. Using a suitable template and this XML data, you can create a complete PDF again at a different point.

Note The transfer of form data from an xstring attribute, whose contents originate from the back end, into separate attributes of a Web Dynpro context node is not supported.

 

 

Leaving content frame