Show TOC Entering content frame

Process documentation Integration of the ALV in Your Application Locate the document in its SAP Library structure

Purpose

If you want to use an ALV output in your application, you have to perform various steps, depending on what you want to achieve. The following variants show only the most important ways in which you can call the ALV:

·        Simple call without ALV configuration model

You only display an ALV output. You do not want to make any changes.

·        Simple call with ALV configuration model

You want to change the standard output using your application. To do this you require the ALV configuration model.

·        ALV output in external view without ALV configuration model

ALV output is just one element of many in a view. You do not want to change the ALV output. You do not need the ALV configuration model.

·        ALV output in external view with ALV configuration model

ALV output is just one element of many in a view. You want to change the standard output using your application. To do this you require the ALV configuration model.

You will recognize the majority of the steps listed below from your work with the Web Dynpro components. Some of them, however, are tailored specifically for use with the ALV.

Prerequisites

You must perform the following (ALV-independent) steps for all the above listed scenarios:

·        You generate a Web Dynpro component for your application and save it as active.

·        You generate a Structure linkcontext node with the cardinality 0..n. The structure of the attributes in this context node (name and data type) and the structure of the internal data table that you connect to this context node in the next step match.

·        You connect your internal data table to the context node (for example, using the supply method). In doing so, you use the method BIND_TABLE from the interface IF_WD_CONTEXT_NODE.

·        You provide the DATA context node in the ALV interface controller with your application data using external context mapping.

Process Flow

When the prerequisites listed above are satisfied, the procedure continues as follows (depending on the objective):

Simple call without ALV configuration model

...

       1.      You define a component usage for the ALV component SALV_WD_TABLE in your application component. In doing so, you specify a name for the component usage (for example, MY_ALV).

       2.      You embed the TABLE view of the ALV component SALV_WD_TABLE into a window of your component.

Simple call with ALV configuration model

...

       1.      You define a component usage for the ALV component SALV_WD_TABLE in your application component. In doing so, you specify a name for the component usage (for example, MY_ALV).

You also define this component usage in your component controller. Since you need the ALV configuration model for your modifications, choose the with controller access variant (component interface).

       2.      You embed the TABLE view of the ALV component SALV_WD_TABLE into a window of your component.

       3.      To configure the ALV output, two more steps are necessary:

¡        You instantiate the used ALV component in a method of the component controller (for example, WDDOINIT).

¡        You get the ALV configuration model and with it the object model, as well as all field objects and column objects.

The description of all the classes and methods of the ALV configuration model can be found in the system in the package SALV_WD_CONFIG.

ALV output in external view without ALV configuration model

...

...

       1.      You decide whether you require the context node in the component controller or in the context of your application view. If necessary, you generate an appropriate context node in your view and map the context node from the component controller to it.

       2.      You define a component usage for the ALV component SALV_WD_TABLE in your application component. In doing so, you specify a name for the component usage (for example, MY_ALV).

You also define the usage of this component in the properties for your view. Since you do not need the ALV configuration model, choose the without controller access variant (no component interface).

       3.      You generate the UI element ViewContainerUIElement in the layout of your view at the required position.

       4.      You have already embedded your view in the window of your application. Underneath this, you can see the name of the UI element ViewContainerUIElement that you have prepared in the previous step for the ALV output. You then embed the TABLE view for the SALV_WD_TABLE ALV component under this entry.

ALV output in external view with ALV configuration model

...

...

       1.      You decide whether you require the context node in the component controller or in the context of your application view. If necessary, you generate an appropriate context node in your view and map the context node from the component controller to it.

       2.      You define a component usage for the ALV component SALV_WD_TABLE in your application component. In doing so, you specify a name for the component usage (for example, MY_ALV).

You also define the usage of this component in the properties for your view. Since you need the object model for your modifications, choose the with controller access variant (component interface).

       3.      You generate the UI element ViewContainerUIElement in the layout of your view at the required position.

       4.      You have already embedded your view in the window of your application. Underneath this, you can see the name of the UI element ViewContainerUIElement that you have prepared in the previous step for the ALV output. You then embed the TABLE view for the SALV_WD_TABLE ALV component under this entry.

       5.      To configure the ALV output, two more steps are necessary:

¡        You instantiate the used ALV component in a method of your view (for example, WDDOINIT).

¡        You get the ALV configuration model and with it the object model, as well as all field objects and column objects.

Note

The description of all the classes and methods of the ALV configuration model can be found in the system in the package SALV_WD_CONFIG.

 

Leaving content frame