Show TOC Start of Content Area

Procedure documentation Creating Form Instances  Locate the document in its SAP Library structure

Use

A form instance is the runtime representation of a composite form object and is generated from a form template.

According to the data that you want to display in the form, you can create a form instance with different input parameters:

      You can execute the prefilling services when creating the form instance with specific input values provided as an enumeration.

      You can also choose not to run the prefilling services before the form instance is created; in this case, you have to provide the form context value.

You can also define whether the form should be interactive (the user can enter data and submit the form), or static (used to display data only).

Procedure

...

       1.      Using the InteractiveFormsFacade class, get a reference to the IFormProcessor interface.

Example

package com.sap.caf.eu.gp.api.test;

 

import com.sap.caf.eu.gp.forms.api.IFormProcessor;

import com.sap.caf.eu.gp.forms.api.InteractiveFormsFacade;

 

 

public class APITest {

  

   IFormProcessor formProcessor = InteractiveFormsFacade.getFormsProcessor();

...

}

       2.      Call the appropriate createFormInstance() method for your scenario.

       createFormInstance(String templateID, int globalVersion, int localVersion, String recipientAddress, IUser processor, Boolean isInteractive, Date expireTime, Enumeration inputSvcsValues)

This method creates a form for offline processing that optionally can be sent to a user by e-mail. If you want to create an impersonalized form (it can be submitted to the system multiple times), you do not need to provide a user.

To find out what structures you need to put in the enumeration input parameter, you must call the getPrefillingServicesStructureInfo method of the IFormTemplateInfo interface.

       createImpersonalizedFormInstance(String templateID, int globalVersion, int localVersion, Date expireDate, String formName, int maxAllowedReturnCount)

This method creates an impersonalized form for offline processing. The form can be submitted to the system multiple times. You can define the number of allowed submissions by the last parameter in the list.

       createFormInstance(String templateID, int globalVersion, int localVersion, String recipientAddress, IUser processor, Boolean isInteractive, Date expireTime, IGPStructure formContextValue, Boolean executePrefillingServices)

With this method, you can choose not to execute the prefilling services when creating the form. Instead, you can provide form context values.

To get the information for the form context structure, you must call the getFormContextStructure method of the IFormTemplateInfo interface.

       createFormInstance(String templateID, int globalVersion, int localVersion, String recipientAddress, IUser processor, Boolean isInteractive, Date expireTime, String boElementKey)

If you create a form instance using this method, it is filled with data from a business object. The relevant data is identified by the business object instance ID.

End of Content Area