• No results found

Recognizing an Adaptable Application

In document FPM Developer's Guide 7.4 SP2 (Page 197-200)

Applications created using CBA are known as adaptable applications. You can recognize whether an application is adaptable in the following ways:

 In the Web Dynpro hierarchy browser

An extra component configuration is visible, the 'adaptable' floorplan component, for example FPM_ADAPTABLE_OVP.

At runtime, when you open the FPM configuration editor, FLUID, using the Customize Page icon on the main toolbar.

The Adaptations toggle-button is visible on the main toolbar. Choosing this button displays the Adaptations panel, listing all existing adaptations of the application configuration.

Enabling an Application for CBA

You can create adaptations of your application to use in context-specific cases. These are known as context-based adaptations (CBA).

For example, you can create several configurations of an application, each one adapted to the particular context in which it is called; a context is, for example, the role of the person who launches the application.

CBA negates the need for making extra copies of applications and for writing lots of additional code.

An application configuration must first be enabled with a 'wrapper' component for it to be used as an adaptable configuration; the wrapper component provides the context

information. You can create a wrapper component using the CBA Enabler application as described in the following procedure.

Prerequisites

You have an existing application configuration that you would like to convert to an adaptable configuration.

Procedure

To be able to create context-based adaptations of an application, you must complete the following steps:

1. Create the Adaptation Schema and Dimensions

Open transaction SM34. Enter FPM_VC_ADAPT_SCHEMA as the View Cluster name and create a new adaptation schema, for example, MY_SCHEMA, and the dimensions that you need (for example, Role and Country).

The index is used to determine the dominating adaptation dimension to avoid possible collisions. The data element is used for design-time purposes, allowing you to provide field help while configuring context-based adaptations.

2. Enable the Application as an Adaptable Application

You can use the CBA Enabler tool to enable your application for context-based adaptations. To do this, complete the following steps:

1. Start the CBA Enabler. Navigate to the following folder in the WD ABAP Workbench (transaction SE80): APB_FPM_CONF FPM Applications FPM_CFG_CBA_ENABLER .

2. In Step 1 (Enter Adaptation Settings) enter the following configuration data: Application Configuration Name

Enter the name of the existing application which you want to enable for CBA.

Adaptation Schema Enter an existing Schema.

Adaptation Configuration Name

Enter the name of the component configuration that contains the Schema information.

Origin of Adaptable Application Configuration

Here you can decide to use the existing application (whose name you entered already), or you can decide to create a completely new application and application configuration. If you choose the second option, you must enter the name of the CBA application to be created.

Be aware that if you create a new application any references that you had to the original application (for example in the SAP Enterprise Portal) will be lost.

 You can classify your application as administration-relevant (with regard to the Internet Communication Framework (ICF)) by selecting the Administration Flag for ICF Services checkbox. See More Field Help... in the context menu for further information on this topic. The addition of a namespace is optional.

3. Choose Step 2 (Assign Package and Transport Request) and enter the relevant information.

You have now enabled your application for CBA.

4. In the ABAP Workbench, navigate to your application configuration, and add the adaptation dimensions that you created in step 1 of this procedure to your application. Enter them on the Parameters tab in your application. The

dimensions can then be passed as parameters to your application.

You have enabled your application for CBA. You can now configure your adaptations in the Adaptations panel inside FLUID.

Creating and Editing an Adaptation of an Adaptable Application

You can create context-specific adaptations of an application. For example, an application that displays a form to both employees and managers can be adapted so that when a

manager opens the application, he or she is presented with a form that looks different to that which the employee sees.

Prerequisites

You have an existing adaptable application.

To check whether your application is adaptable, open the application using FLUID. If the application is opened at floorplan level, an Adaptations toggle button is visible in the main toolbar. If it is an adaptable application, an additional component,

Procedure

1. In the ABAP Workbench, select the application you want to edit and choose Start Configurator.

2. Choose Continue in Change Mode in the Editor for Web Dynpro ABAP Application Configuration window.

3. Choose the link to the floorplan component of the application. The FPM configuration editor, FLUID, is displayed.

4. From the main toolbar, open the Adaptations panel.

The Adaptations panel appears under the main toolbar. There is at least one row in the Schema table; this is the base configuration.

5. Select the base configuration and choose one of following buttons: o Add

Enter values for the adaptation dimensions in the Add Adaptation dialog box that appears and press OK.

o Change Dimension Values

Edit existing values for the adaptation dimensions in the Change Dimension Values dialog box that appears and press OK.

6. A new adaptation appears in the Schema table underneath the base configuration. Using the Preview panel or the tab pages below the Adaptation panel, you can now make the desired changes to this adaptation (for example, add an extra field in a form for the manager role).

7. To test your new adaptations, run the application as you would normally. You see the original application, unchanged. To see how the adapted application looks, add the relevant parameter and values to the URL (for example &ROLE=MANAGER and refresh the screen. Note that the values you enter for your parameter in the URL are case- sensitive.

Any changes you make in the base configuration are inherited by the adaptations, even if you make changes after you have created an adaptation.

In document FPM Developer's Guide 7.4 SP2 (Page 197-200)