Wednesday, July 30, 2008

Forms with ABAP Dictionary-Based Interface Web Dynpro ABAP Integrating Forms

Before the introduction of the XML-based interface, an ABAP Dictionary-based interface was created for a form during integration of the same. Such an interface, however, was not easily linked to the context of a Web Dynpro component. All the forms created from within the Web Dynpro context are not automatically equipped with an XML-based interface. In certain situations, however, it can be necessary to integrate an old form with a function module-based interface into a Web Dynpro application. The Web Dynpro runtime makes it possible, in principle, to display or print such a form within a Web Dynpro application. In special cases, it is even possible to integrate a form of this type in an interactive mode.

Note that forms with a function module-based interface can only be used as PDF-based print forms.

Setting Up Limited Input Enablement

The UI element InteractiveForm can also be used here with limited input enablement. The values entered by the user are not, however, distributed to the respective attributes. The form is displayed in change mode and, after the user has completed his or her entries, it is stored as a whole in the context attribute – which is then mapped to the property pdfSource. This is particularly helpful whenever you want to print or archive entries in a form. Validation of the entries, in this case, is not provided by the framework.


Once a form is set to input enabled, this property is retained. It cannot be reset to a pure display mode again.

The interface of the UI element InteractiveFormcontains the method SET_LEGACY_EDITING_ENABLED, which in turn contains a Boolean parameter. The form is then ready for input when

The parameter has the value X.

The property enabled in the UI element InteractiveForm is selected.

The property pdfSource is mapped to a context attribute of the type XSTRING.

The property dataSource is mapped to a context attribute that is compatible with the form context.

The form context is used to exchange data between InteractiveForm and the Web Dynpro context. If the form is based on an ABAP Dictionary-based interface, data from the interface is passed to the form context. You have the option of change the attribute names here. You cannot do this in the scenario presented here; you must use the attribute names specified.

The following code fragment shows how to configure the form for input:

method WDDOMODIFYVIEW .

data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM,

LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.

check first_time = abap_true.

LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT( 'INTERACTIVE_FORM_1' ).

LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.

LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).

.

.

.

endmethod.

No comments:

Archive